Commit Graph

10 Commits

Author SHA1 Message Date
Kevin Davis
06fd215de1
[hard] Update deposit type to use sdk.Coins (#744)
* update deposits to use sdk.Coins

* update tests

* update liquidation tests
2020-12-18 09:05:21 -07:00
Denali Marsh
83a5f51c11
Hard: automatic liquidation by LTV index (#743)
* hotfix

* update params, keys

* liquidation by keeper

* refactor GetPendingBorrowBalance

* fix app build

* elegant handling of denom arrays

* auction deposit in lots

* add error msg

* update tests with new params

* happy path liquidation test

* update liquidator macc name

* refactor reward % to money market params

* refactor tests for updated params

* compile: harvest liquidator module account

* add liquidate msg

* liquidation approach

* update liquidations

* return remaining deposit coins to original borrowr

* check keeper reward before sending

* introduce ValuationMap

* convert Ints <> Decs

* implement double-loop

* ModuleAccountName

* sort keys for deterministic auctions

* test: correct auctions created

* test: preset keeper coins

* ensure deterministic iteration

* test cases

* update repay test

* auction fixes, tests

* LTV index

* user actions sync interest and update ltv index

* tests: all deposits must have money markets

* reorder borrow logic

* ltv index liquidation logic

* test specific items in ltv index

* index liquidation tests

* update repay to spendable coins

* revisions

* remove address sort method

* merge master test package
2020-12-18 02:12:48 +01:00
Denali Marsh
6c0890d5ff
Hard: introduce LTV index (#742)
* hotfix

* update params, keys

* liquidation by keeper

* refactor GetPendingBorrowBalance

* fix app build

* elegant handling of denom arrays

* auction deposit in lots

* add error msg

* update tests with new params

* happy path liquidation test

* update liquidator macc name

* refactor reward % to money market params

* refactor tests for updated params

* compile: harvest liquidator module account

* add liquidate msg

* liquidation approach

* update liquidations

* return remaining deposit coins to original borrowr

* check keeper reward before sending

* introduce ValuationMap

* convert Ints <> Decs

* implement double-loop

* ModuleAccountName

* sort keys for deterministic auctions

* test: correct auctions created

* test: preset keeper coins

* ensure deterministic iteration

* test cases

* update repay test

* auction fixes, tests

* LTV index

* user actions sync interest and update ltv index

* tests: all deposits must have money markets

* reorder borrow logic

* check mm before setting borrow index

* insert into LTV index even when LTV is 0
2020-12-16 22:08:29 +01:00
Denali Marsh
89f07e92b4
Hard: liquidation by keeper (#731)
* hotfix

* update params, keys

* liquidation by keeper

* refactor GetPendingBorrowBalance

* fix app build

* elegant handling of denom arrays

* auction deposit in lots

* add error msg

* update tests with new params

* happy path liquidation test

* update liquidator macc name

* refactor reward % to money market params

* refactor tests for updated params

* compile: harvest liquidator module account

* add liquidate msg

* liquidation approach

* update liquidations

* return remaining deposit coins to original borrowr

* check keeper reward before sending

* introduce ValuationMap

* convert Ints <> Decs

* implement double-loop

* ModuleAccountName

* sort keys for deterministic auctions

* test: correct auctions created

* test: preset keeper coins

* ensure deterministic iteration

* test cases

* update repay test

* auction fixes, tests
2020-12-15 18:38:14 +01:00
Kevin Davis
01311e77f6
Kd fix interest test (#728)
* fix: fix go 1.15 build

* fix: correct highest apy test
2020-12-03 16:05:56 -07:00
Denali Marsh
49d62dd076
Harvest: interest rate logic (#720)
* initial feature scaffolding

* implement interest keeper logic

* basic AccrueInterest

* accrue interest on borrow

* update borrow index formula

* update sample reserve factor

* move AccrueInterest to begin blocker

* refactor interest rate updates for accrue interest

* use interest rate model from store

* refactor begin blocker state machine

* add reserve factor to interest model params

* update comment

* store money market instead of interest rate models

* update test suite

* use BorrowedCoins store key

* update public functions and alias

* unit tests, keeper test scaffolding

* demo panic

* address revisions

* add 'normal no jump' test case

* spy = 1 + borrow rate

* update comment

* APYToSPY unit test

* per user borrow index list

* interest keeper test

* test: interest applied on successive borrows

* varied snapshot times

* test: multiple, varied snapshots

* address revisions

* add pending interest before validating new borrow

* update makefile

* address revisions

* fix test
2020-12-03 22:50:35 +01:00
Denali Marsh
e1ad9569a7
Harvest: interest rate model params (#719)
* add interest rate models to params

* move interest rate models to money market param

* add interest rate models to store

* update store interest rate models from params

* refactor money market init function, update tests

* use cmp package for optimized comparison

* implement equal function, remove gocmp dep

* delete unseen interest rate model param from store
2020-11-13 16:51:52 +01:00
Denali Marsh
df2c4271e4
Harvest: refactor deposit type to claim type (#716)
* status: refactor deposit type to claim type

* refactor all deposit types to claim types

* refactor msg withdraw

* update module errors

* refactor querier and rest

* update spec

* update tests

* update handler, alias

* refactor to IterateDepositsByDenom

* v0_12 legacy types

* fix build
2020-11-12 17:43:28 +01:00
Kevin Davis
69512d508b
harvest-fix: check for status other than bonded, add staking tests (#677)
* fix: check for any status other than bonded

* Add harvest staking tests (#680)

* refactor config initialization

* refactor delegator rewards test, add tests

* fix share to token calculation, add unbonding test

* remove dead link

Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
2020-10-05 17:44:17 -04:00
Denali Marsh
5ce045f46f
rename hvt (#661) 2020-09-25 11:07:20 -04:00