Commit Graph

494 Commits

Author SHA1 Message Date
Denali Marsh
fa97a7db0e
refactor to MsgClaimHardReward () 2021-03-15 12:03:15 -06:00
Denali Marsh
21cf7685df
don't sync borrow on deposit - it's redundant () 2021-03-15 09:29:13 -06:00
Denali Marsh
72bfee6523
Minor best practices edits in Hard module ()
* put err return inside conditional

* check error type instead of error msg string
2021-03-15 09:15:19 -06:00
Ruaridh
20b3fa53e3
Prevent panic-causing param values ()
* prevent cdp liquidation ratio being 0.0

* fix linter warning

* prevent hard conversin factor being < 1

* add liquidation tests for different keeper rewards
2021-03-15 08:44:23 -06:00
Kevin Davis
2611d48b77
fix: return nil instead of empty byte slice () 2021-03-15 08:41:36 -06:00
Denali Marsh
12f5a67d6d
CDP Querier: update AugmentedCDP's FeesUpdated and InterestFactor ()
* update CDP's FeesUpdated and InterestFactor

* remove newline
2021-03-10 21:40:43 -07:00
Ruaridh
7779c8ee4d
Fix hard/committee begin blocker order ()
* switch hard and committee begin blocker order

* udpate money market deprecation steps

* move committee begin blocker in front of cdp

Co-authored-by: karzak <kjydavis3@gmail.com>
2021-03-10 21:38:42 -07:00
Denali Marsh
8744d3210c
Genesis import/export fixes ()
* panic on export if prev accrual time not set

* on export if interest factor not set, set to 1.0

* fix prev accrual time in cdp export

* panic on export if prev accrual time not set

* export hard reward denom accumulation times

* init genesis starts usdx reward indexes at 0.0

* update incentive migration

* update incentive tests
2021-03-10 21:32:35 -07:00
Ruaridh
509d2edbca
fix bug that skipped minimum borrow check ()
add tests for non-borrower repayer address
2021-03-10 21:13:21 -07:00
Kevin Davis
e21a04ca57
fix: set previous block time correctly on block one ()
* fix: set previous block time correctly on block one

* fix failing tests
2021-03-10 10:56:23 -07:00
Kevin Davis
829aed5256
fix: decrement coins for supply/borrow properly ()
* fix: decrement coins for supply/borrow properly

* fix: decrement keeper liquidation reward coins from hard total supply ()

* fix: use proper safe subtraction for withdraw/repay methods

* fix: decrement keeper liquidation rewards from total supply

* address review comments
2021-03-10 10:56:08 -07:00
Ruaridh
162602f390
Test users cannot borrow from reserves ()
* add ValidateBorrow test

* remove accidentally duplicated test
2021-03-09 12:11:13 -07:00
Kevin Davis
203d7e0063
Fix delegator rewards initialization ()
* fix: sync delegator rewards if they exist before creating new delegation

* remove comments
2021-03-01 18:36:40 -07:00
Kevin Davis
5ff0e4eea4
fix: ensure time elapsed is not negative () 2021-02-28 10:33:56 -07:00
Kevin Davis
26e88c6177
fix: check correct time elpased condition () 2021-02-24 11:25:40 -07:00
Denali Marsh
0e718d3510
Update Swagger for kava-5 ()
* hard: posts, gets, object definitions

* formatting

* incentive params

* incentive claims and rewards

* incentive fromatting

* update CDP

* format CDP

* fix typo in cdp liquidate route registration
2021-02-23 14:02:08 -07:00
Kevin Davis
5352c2489d
fix: set indexes to zero () 2021-02-23 12:41:30 -07:00
Denali Marsh
8a878b0d66
add liquidate msg to cdp spec () 2021-02-23 12:41:17 -07:00
Kevin Davis
e4daffcaf8
fix: enforce max number of liquidations in cdp begin blocker ()
* fix: enforce max number of liquidations in cdp begin blocker

* address review comments
2021-02-23 12:39:39 -07:00
Kevin Davis
667ad87825
[R4R] kava 5 migration ()
* wip: kava-5 migration

* feat: kava 5 migration

* fix: don't repeat genesis time
2021-02-22 18:28:07 -07:00
Kevin Davis
0865e40553
[R4R] incentive, hard migrations ()
* update v0_11 harvest genesis state

* wip: hard migration

* wip: incentive migration

* wip: incentive migration

* update incentive migration for multi-rewards

* address review comments

* sort slices for deterministic ordering

* update interest rate model and reserves

* fix: use correct conversion factor

* fix: remove auction size param

* remove ununsed module accounts

* update incentive claim multiplier for one month rewards

* address hard migration review comments

* add hard test

* migrate harvest mod account ()

* migrate harvest mod account

* update hard account permissions

* update hard module account permissions

Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
2021-02-22 14:08:23 -07:00
Denali Marsh
99fb79a1ae
update spec, add money market deprecation steps () 2021-02-22 13:52:17 -07:00
Denali Marsh
1499a89ce5
Query Hard module reserves ()
* implement CLI reserves query

* implement REST reserves query
2021-02-22 13:48:52 -07:00
Denali Marsh
fe43c2bc41
Hard Audit: don't convert directly from sdk.Int to uint64 ()
* refactor away from sdk.Int's .Uint64() method

* refactor cdp module interest calc
2021-02-20 09:42:57 -07:00
Kevin Davis
5cd94047a4
fix: set interest accumulation time and exit when borrows are zero () 2021-02-19 16:33:55 -07:00
Kevin Davis
1ab2e9965f
Add committee migrations ()
* fix: collateral param permission

* wip: kava-5 committee updates

* feat: add committee migrations

* rename functions so git recognizes diffs better

* rename

* remove auction_size param

* address review comments

* add check ltv index count to collateral param perms

* fix: update legacy migration

* use function to define collateral param in test

* use go 1.15 in circle

* address review comments

* fix: no nil values for collateral params
2021-02-19 14:05:42 -07:00
Denali Marsh
421f774ec1
sort unique denom list () 2021-02-19 14:05:17 -07:00
Denali Marsh
0b6e47ff46
call hooks in export genesis () 2021-02-19 13:49:36 -07:00
Denali Marsh
0a51a737cb
fix time elapsed calculation + test () 2021-02-19 13:24:00 -07:00
Denali Marsh
6c88c01eb8
validate against money markets in store () 2021-02-19 13:23:19 -07:00
Denali Marsh
6045a94b39
Allocate Hard supply/borrow rewards to legacy suppliers/borrowers ()
* initialize hard supply reward for empty rewards

* add god committee to integration test

* organize claim types, add helper methods

* reorder integration test's god committee

* legacy suppliers earn rewards + tests

* update InitializeHardBorrowReward + test

* remove formatting comments from tests

* allocate rewards to legacy borrowers + test

* apply change to update index denom methods

* Update querier to show synced rewards for legacy deposits/borrows ()

* update simulated sync method to show rewards for legacy deposits/borrows

* more explicity debuging logs

* revisions

Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
2021-02-19 13:02:51 -07:00
Kevin Davis
c5fc1c6b4f
Add hard and incentive spec updates ()
* wip: update hard spec

* feat: updated hard spec

* feat: updated incentive spec
2021-02-19 17:14:48 +01:00
Nick DeLuca
bdbc9b9c58
remove unused total deposit value -- not needed by ltv range calculation () 2021-02-17 10:37:41 -07:00
Denali Marsh
53eab47c07
Hard Audit: don't let users borrow from reserves ()
* don't borrow from reserves

* use safesub and throw error
2021-02-16 07:45:57 -07:00
Kevin Davis
58573e7b26
fix: allow ltv of zero () 2021-02-16 07:43:46 -07:00
Kevin Davis
ad6ef76979
fix: set interest last updated to previous accrual time, not block time () 2021-02-16 07:43:21 -07:00
Denali Marsh
e8d3d877aa
check borrow err () 2021-02-15 08:30:41 -07:00
Denali Marsh
94999b6b02
Incentive module: accounts should only be able to claim their own rewards ()
* make rewards only claimable by sender

* remove 'owner' from cli for incentive claims
2021-02-15 08:29:00 -07:00
Denali Marsh
15da55b451
Hard Audit: refresh borrow/deposit after syncing ()
* refresh borrow/deposit after syncing

* revisions
2021-02-12 21:56:03 +01:00
Denali Marsh
a5b72363d0
Hard Audit: decrement total borrowed on liquidation ()
* decrement total borrow on liquidation

* copy kevin's decrement changes

* check error in liquidation

* extend decrement borrowed changes

* mimic negative check on the supplied coins side

* update liquidation test
2021-02-12 13:07:32 -07:00
Kevin Davis
7e39c1d0a8
fix: account for start time in calculating time elapsed () 2021-02-12 08:30:10 -07:00
Denali Marsh
fe2a131b31
Hard Audit: add minimum borrow USD value ()
* add module param MinimumBorrowUSDValue

* borrow/repay min limit restrictions

* add borrow/repay test cases

* update tests with new module params

* update timelock test with param

* update withdraw LTV test

* remove unused GetCurrentBorrowUSDValue method

* commit to prompt CircleCI run
2021-02-12 08:28:05 -07:00
Denali Marsh
cd7a227030
Query Hard module's supply/borrow APYs ()
* calculate estimated apy from internal spy

* implement interest rate query
2021-02-10 10:53:53 -07:00
Denali Marsh
802ed36846
remove auction size param () 2021-02-10 07:59:23 -07:00
Denali Marsh
7f43e6336e
permissioned incentive claims () 2021-02-10 07:58:05 -07:00
Kevin Davis
bc1fab7836
fix: renumber error messages () 2021-02-10 07:57:28 -07:00
Kevin Davis
e351e20727
fix: collateral param permission () 2021-02-10 07:57:02 -07:00
Kevin Davis
04b65e1d4e
fix: export synced deposits/borrows ()
* fix: export synced deposits/borrows

* fix: epxort synced cdps
2021-02-10 07:56:38 -07:00
Denali Marsh
b620275165
Hard Audit: remove liquidation account from Hard module ()
* remove liquidator macc

* remove legacy if statement
2021-02-09 13:33:58 -07:00
Denali Marsh
7465c643b8
decrement/increment coin counters on auctions () 2021-02-09 13:32:28 -07:00