Commit Graph

11 Commits

Author SHA1 Message Date
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
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 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