Commit Graph

54 Commits

Author SHA1 Message Date
Michael Vines 995d4a029f Remove tokio dev-dependency 2021-03-16 18:33:37 -07:00
Justin Starry e99dc71ec7
lending: fix flaky program test (#1448) 2021-03-15 09:01:27 +00:00
Justin Starry 90b4b33775
lending: Add SetLendingMarketOwner instruction (#1434) 2021-03-11 16:02:50 +00:00
Justin Starry e7d7db12bd
lending: Update test fixtures to v3 accounts (#1435) 2021-03-11 23:28:52 +08:00
Jordan Sexton f24d375b75
fix: token lending; repay and liquidate should set deposited collateral tokens (#1383) 2021-03-06 11:24:44 -06:00
Jordan Sexton 27c94293ce
token lending: DepositObligationCollateral & WithdrawObligationCollateral instructions (#1229) 2021-03-06 11:02:41 -06:00
Jordan Sexton 4b2b87bcec
fix: burn before transfer (#1375) 2021-03-05 10:38:07 -06:00
Jon Cinque 747252466c
Bump compute budget for flaky test (#1381) 2021-03-05 01:50:08 +01:00
Jon Cinque 9c12b50703
Update solana-program to 1.5.11 (#1362)
* Update solana-program to 1.5.11

* Update all programs
2021-03-02 19:19:50 +01:00
Justin Starry b389053d5d
lending: fix market and reserve initialization (#1346)
* lending: set lending market bump seed

* fix: Set correct reserve token account owner

* bump lending comp unit limit
2021-03-01 06:06:07 +00:00
dependabot[bot] 8fd665c271
build(deps): bump assert_matches from 1.4.0 to 1.5.0 (#1264)
Bumps [assert_matches](https://github.com/murarth/assert_matches) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/murarth/assert_matches/releases)
- [Commits](https://github.com/murarth/assert_matches/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 01:37:57 +00:00
dependabot[bot] 5b4c62ce49
build(deps): bump solana-program from 1.5.6 to 1.5.8 (#1261)
Bumps [solana-program](https://github.com/solana-labs/solana) from 1.5.6 to 1.5.8.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.5.6...v1.5.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-17 23:56:18 +00:00
dependabot[bot] cfe1cac2aa
build(deps): bump log from 0.4.13 to 0.4.14 (#1259)
Bumps [log](https://github.com/rust-lang/log) from 0.4.13 to 0.4.14.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.13...0.4.14)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-17 22:48:50 +00:00
Trent Nelson 188c03e9a1 chore: bump solana crates to 1.5.6 2021-02-11 16:30:03 -07:00
Jon Cinque 65c3af3217
lending: Add overflow check in proptest (#1199)
This issue was discovered during CI:
https://github.com/solana-labs/solana-program-library/runs/1833196857

The approach is to do the same calc as `_liquidate_obligation` and make
sure that the `MockConverter` doesn't overflow `Decimal`.  This seemed
like a simpler approach than doing a complex local proptest constraint.

On top of that, it includes the proptest regression to run it on every
`cargo test`.
2021-02-08 14:35:55 +01:00
Justin Starry f61d7a89a6
lending: Use fair obligation health factor calculation (#1119)
* lending: Use fair health factor calulation and handle dust

* ci: fix github action caching
2021-01-28 15:56:07 +08:00
Justin Starry 0834e01d90
lending: Handle the lost funds from defaulted loans (#1118) 2021-01-22 20:04:20 +08:00
Justin Starry d6571949a6
lending: Fixes and tests for borrow and liquidate (#1104)
* lending: Move borrow calculation to reserve

* lending: Test and fix borrow and liquidate

* fix: allow obligations to be disabled

* Test cleanup
2021-01-22 09:56:19 +08:00
Justin Starry 62e6a67eb2
lending: Split interest accrual into new instruction (#1115) 2021-01-22 08:40:44 +08:00
Justin Starry fceb120ff0
lending: Adjust borrow rate config validation (#1105) 2021-01-21 21:08:15 +08:00
Justin Starry 6f4c8ade36
lending: Misc fixes (#1106) 2021-01-21 08:41:12 +08:00
Justin Starry bbd4c63b83
lending: Add InitObligation instruction (#1088)
* lending: Add InitObligation instruction

* fix: accrue interest on deposit to correct exchange rate
2021-01-19 16:58:04 +08:00
Justin Starry fdf2f1f909
lending: Refactor and test obligation repays (#1084) 2021-01-19 08:55:37 +08:00
Justin Starry 3f54645a64
lending: Refactor reserve state module (#1083)
* lending: Reorder reserve state module

* lending: Refactor reserve info structs
2021-01-17 09:38:06 +00:00
Justin Starry 8004e436f7
lending: Split state module (#1082) 2021-01-17 07:41:03 +00:00
Justin Starry d1bc753359
lending: Use checked math and add prop tests (#1075)
* Use checked math and add prop tests

* Feedback

* Feedback

* Fix exchange rate test

* remove borrow compute unit limit

* Bump compute limit
2021-01-17 15:10:04 +08:00
Justin Starry 846e20cc20
lending: Add owner to lending market (#1077) 2021-01-15 18:14:49 +08:00
Justin Starry 2859fbea79
lending: Fix obligation interest accrual (#1068) 2021-01-15 07:33:38 +08:00
Justin Starry 088f8f1fa8
lending: Store bump_seed in lending market to cut compute cost (#1065)
* lending: Store bump_seed in lending market to cut compute cost

* bump limits because CI uses more compute
2021-01-14 17:49:11 +08:00
Justin Starry 6a294f47f2
lending: add upper bound on cpu limits (#1049) 2021-01-11 09:46:57 +08:00
Justin Starry e360fc9e4f
lending: Add upgradable loader to genesis accounts creation (#1048)
* wip

* lending: Add upgradable loader to genesis accounts creation

* clippy

* fix warning
2021-01-10 08:37:27 +08:00
Jon Cinque 3bd36d49a4
lending: Add version and padding to state structs (#1043)
* Add version field to lending state structs

* Add padding to pack / unpack

* Run cargo fmt

* Fix js test

* Remove is_initialized
2021-01-08 11:39:06 +01:00
Justin Starry dd5598933c
lending: Optimize liquidate and clean up dex market handling (#986)
* Optimize liquidate and clean up dex market handling

* fix clippy

* Feedback

* Rebase

* Reduce scope

* Test LTV ratio
2021-01-07 17:10:55 +08:00
Justin Starry efed7c66f7
lending: Fix fee collection for borrows (#1039) 2021-01-07 14:56:55 +08:00
Justin Starry e2879c35df
Fixes for genesis account creation (#1038) 2021-01-07 06:01:14 +00:00
Jon Cinque ffe206357b
lending: Add owner and host fees (#965)
* lending: Add owner and host fees to layout and instructions

* Add fees math

* Run cargo fmt

* Assess fees only on borrow

* Fmt and clippy fix

* Fixup instruction comment numbering

* Add proptest and end-to-end tests for fees

* Address review feedback

* Add minimum tests

* Move host to the back of borrow

* Add error to borrow fee calculation
2021-01-06 22:35:43 +01:00
Jon Cinque b2712c6c2f
lending: Add user transfer authority for all instructions (#1034)
* Add user transfer authority to deposit

* Add user transfer authority to withdraw

* Add user transfer authority to borrow

* Add user transfer authority to repay

* Add user transfer authority to liquidate

* Add user transfer authority to init reserve

* Cargo fmt

* Fix client

* Cargo fmt again
2021-01-06 20:55:56 +01:00
dependabot[bot] 7b81c0d3c0
build(deps): bump solana-program from 1.5.0 to 1.5.1 (#1025)
Bumps [solana-program](https://github.com/solana-labs/solana) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.5.0...v1.5.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 13:51:29 +00:00
Jon Cinque d14e403599
lending: Add test to generate and optionally dump genesis accounts (#967)
* Automate primordial accounts

* Add genesis account dumping as test

* Add test-dump-genesis-accounts feature flag to create state

* Run cargo fmt

* Delete gitignore

* Add test-bpf feature to genesis test

Co-authored-by: Justin Starry <justin@solana.com>
2020-12-28 19:15:50 +01:00
Justin Starry 891b6794f3
Introduce SPL Token Lending (#696)
* Add spl-token-lending

* lending-client

* cargo clippy

* Limit bpf tests

* Enable lending bpf tests

* Remove obligation signer requirement

* Fix token lending js cli test

* Fix
2020-12-19 08:17:07 +08:00
Michael Vines 8ae34d2137 Update to Solana 1.5.0 2020-12-17 21:24:30 -08:00
Michael Vines 158fa1dea6 Upgrade to Solana v1.4.14 2020-12-03 05:39:55 +00:00
dependabot[bot] 6aa1d8cce1
Bump solana-program from 1.4.9 to 1.4.13 (#916)
Bumps [solana-program](https://github.com/solana-labs/solana) from 1.4.9 to 1.4.13.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.4.9...v1.4.13)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-02 12:54:42 +00:00
Michael Vines c6a4ac9a82 Bump solana version to v1.4.9 2020-11-17 20:02:17 -08:00
Michael Vines f4af9054a2 Update to Solana 1.4.8 2020-11-14 02:35:20 +00:00
Michael Vines 5030a87021 Upgrade to Solana 1.4.7 2020-11-12 11:05:20 -08:00
dependabot[bot] b71456a8f1
Bump solana-program from 1.4.5 to 1.4.6 (#826)
Bumps [solana-program](https://github.com/solana-labs/solana) from 1.4.5 to 1.4.6.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.4.5...v1.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-11 12:39:52 +00:00
Michael Vines 238eabc1d0 Bump solana version to v1.4.5 2020-11-06 21:29:04 -08:00
Michael Vines 341149d0e9 Back to no-entrypoint feature name 2020-11-03 10:34:43 -08:00
Michael Vines 9f4e6d8beb Update to solana v1.4.4 2020-11-01 20:48:15 -08:00