0g-chain/x/hard/keeper
Denali Marsh f7a73c9245
Hard: suppliers earn interest (#749)
* update to borrow interest factor

* add supply interest factor to accrue interest

* supply interest factor keeper methods

* fix potential bug with user borrow indexing

* sync supply interest on deposit/withdraw

* separate withdraw/deposit

* relocate interest sync methods

* update comment

* simplify supply interest statement

* check truncated int not zero

* add .sub(storedAmount) back

* add store key suppliedcoins

* increment/decrement supplied coins

* update withdraw with new accounting

* update withdraw test

* catch repay edge case

* unit tests

* TestSupplyInterest scaffolding

* test notes

* temp: interest test

* example test

* changes, test checks more state

* fix: calculate supply interest directly

* fix: catch divide by zero

* add state checks back into interest test

* add snapshot test cases

* test owed supplied interest paid at correct ratio

* test user supply syncs user's borrow interest

* remove print statements and clean up

* refactor indented logic

* test supply/borrow multiple coins

* update decoder test

Co-authored-by: karzak <kjydavis3@gmail.com>
2021-01-07 11:23:05 +01:00
..
borrow_test.go update 'harvest' -> 'hard' (#746) 2020-12-21 18:18:55 +01:00
borrow.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
claim_test.go update 'harvest' -> 'hard' (#746) 2020-12-21 18:18:55 +01:00
claim.go update 'harvest' -> 'hard' (#746) 2020-12-21 18:18:55 +01:00
deposit_test.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
deposit.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
interest_test.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
interest.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
keeper_test.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
keeper.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
liquidation_test.go Hard: withdraws limited by ltv (#747) 2020-12-21 18:28:41 +01:00
liquidation.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
params.go update 'harvest' -> 'hard' (#746) 2020-12-21 18:18:55 +01:00
querier.go Hard: update REST API (#748) 2020-12-22 17:08:27 +01:00
repay_test.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
repay.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
rewards_test.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
rewards.go update 'harvest' -> 'hard' (#746) 2020-12-21 18:18:55 +01:00
timelock_test.go update 'harvest' -> 'hard' (#746) 2020-12-21 18:18:55 +01:00
timelock.go update 'harvest' -> 'hard' (#746) 2020-12-21 18:18:55 +01:00
withdraw_test.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00
withdraw.go Hard: suppliers earn interest (#749) 2021-01-07 11:23:05 +01:00