Commit Graph

31 Commits

Author SHA1 Message Date
Michael Vines eb163ab0c7 Bump lending compute units more 2021-03-17 13:04:55 -07:00
Michael Vines 52e4ccee5b Relax some `set_bpf_compute_max_units` to unblock testing against the solana master 2021-03-17 09:31:37 +00:00
Michael Vines af5fdb3146 Bump Rust version to 1.50.0 2021-03-16 22:22:59 -07:00
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 27c94293ce
token lending: DepositObligationCollateral & WithdrawObligationCollateral instructions (#1229) 2021-03-06 11:02:41 -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
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 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 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 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
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