Commit Graph

378 Commits

Author SHA1 Message Date
Denali Marsh
33cbe34991
Harvest: deposit multiple assets supplying multiple assets (#712)
* introduce local cache

* apply LTV for borrowable amount calculation

* add multiple previous borrow tests

* remove unused functions

* address revisions
2020-11-09 22:52:08 +01:00
Denali Marsh
3ea3148129
Harvest: multiple deposits (#711)
* test suite: dynamic pricefeed genesis

* multiple deposits

* improve borrow validation

* improve test, add multiple deposits test case

* add over limit multiple deposit test case

* explicit function names

* rename outdated variable
2020-11-05 18:36:49 +01:00
Denali Marsh
e9d04cd7c6
Harvest: borrows limited by LTV (#710)
* basic borrow types

* borrow keeper scaffolding

* borrow limits param

* integrate pricefeed keeper

* msg handling and querier

* borrow user validation

* update migration scripts for compile

* borrows querier, fixes

* add money market param

* add spot market ID to params, refactor pricefeed

* working bnb -> ukava borrows

* refactor to getAssetPrice

* conversion_factor param, refactor validateBorrow()

* address misc revisions

* remove validation code

* add borrow test

* update test params

* single borrow with sdk.Coins per user

* fix harvest test

* add borrow validation

* simplify borrow validation

* add test case

* master compatibility

* fix build

* refactor to calculateUSDValue()

* add maxLoanToValue to test
2020-11-03 10:46:08 +01:00
Denali Marsh
1442deb3dc
Harvest basic borrow functionality (#702)
* basic borrow types

* borrow keeper scaffolding

* borrow limits param

* integrate pricefeed keeper

* msg handling and querier

* borrow user validation

* update migration scripts for compile

* borrows querier, fixes

* add money market param

* add spot market ID to params, refactor pricefeed

* working bnb -> ukava borrows

* refactor to getAssetPrice

* conversion_factor param, refactor validateBorrow()

* address misc revisions

* remove validation code

* add borrow test

* update test params

* single borrow with sdk.Coins per user

* fix harvest test

* removed legacy commented out code

* address minor revisions
2020-10-30 10:59:47 +01:00
Ruaridh
35a82acbd0
Module account permissions fix (#701)
* initial draft

* fix log msg formatting

* fix mod account type

* sync permissions at a block time

* update the update time
2020-10-27 21:06:44 -04:00
Nick DeLuca
c02ce618da
return after writing error response when owner address is invalid (#699) 2020-10-20 13:18:12 -04:00
Ruaridh
fabeee93cc
add arg to usage message (#697) 2020-10-19 10:58:14 -04:00
Nick DeLuca
13c8d4e3fd
cdp withdraw takes 3 args (#696) 2020-10-19 10:57:42 -04:00
Kevin Davis
9654f9d086
fix: set from address in cli context (#695) 2020-10-16 15:42:09 -04:00
Paul Downing
74bbb6a0d7
update msg spec to match code (#691) 2020-10-14 14:50:43 -04:00
Denali Marsh
6e6ed69383
add name param to query (#689) 2020-10-14 10:34:31 -04:00
Denali Marsh
5fdf23a2ba
fix claim query: owner && depositType (#687) 2020-10-13 10:37:46 -04:00
Kevin Davis
a9c253c09f
[R4R] address harvest preliminary audit exhibits (#686)
* resolve KAV-01

* resolve KAV-02

* resolve KAV-03

* resolve KAV-04
2020-10-12 09:26:18 -04:00
Jay Namsayin
5764c710a6
typo fixes (#685)
* Update 01_concepts.md

* Update 03_messages.md

* Update 01_concepts.md
2020-10-11 22:34:07 -04:00
Kevin Davis
8d142458dd
fix: remove duplicat query logic (#684) 2020-10-09 09:28:18 -04: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
Ruaridh
e0771cc9e8
Incentive query fixes (#681)
* fix claims endpoint

* fix cli query claims
2020-10-05 15:11:55 -04:00
Kevin Davis
1a8a4b86e7
feat: add query for previous savings rate distribution time (#679) 2020-10-03 19:14:42 -04:00
Kevin Davis
04946493ae
kava-3 to kava-4 migration (#676)
* feat: kava-3 to kava-4 migration function

* update migrate command
2020-10-03 13:48:57 -04:00
Kevin Davis
d15e3a43dd
[R4R] fix: don't panic on expired auctions in init genesis (#668)
* fix: close expired auctions in init genesis

* fix: initialize variable

* remove expired auction invarient
2020-10-02 12:50:56 -04:00
Kevin Davis
8f69dcf960
Committee migration (#665)
* draft: kava-3 to kava-4 committee migrations

* migration: add busd, xrpb, btcb bep3 and cdp params to stability committee

* add new pricefeed markets to safety committee

* add harvest to committee
2020-10-01 15:22:26 -04:00
Kevin Davis
495898170c
Auth migration (#667)
* draft auth migration from kava-3 to kava-4

* add harvest module accounts to auth state

* check account state equality

* add supply reconciliation to auth migration

* add gov migration

* add exact json test (#674)

Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>

* fix: check err variable

* correct import path

* feat: add hard accounts

Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
2020-09-30 19:14:07 -04:00
Kevin Davis
ed7ce81e30
Harvest Migration (#672)
* add harvest to kava-4 migration

* add mainnet harvest incentive schedules

* fix: check for 0 lockup instead of assuming small in always 0
2020-09-30 19:07:30 -04:00
Kevin Davis
056f9c0cf0
Cdp migration (#663)
* draft kava-3 to kava-4 cdp migration

* fix: use starting cdp id from the old genesis state

* update auction size for xrp
2020-09-30 18:58:50 -04:00
Kevin Davis
c416423412
[R4R] harvest fixes (#673)
* fix: don't allow denoms other than hard for harvest rewards

* fix: parse cli flags correctly

* fix: convert duration to seconds before calculating time elapsed

* fix: don't distribute rewards before they start or after they end

* fix: return correct message type
2020-09-30 14:44:56 -04:00
Kevin Davis
993d36d05a
Incentive migration (#666)
* draft kava-3 to kava-4 incentive migration

* fix: use collateral type instead of denom

* add additional claim multiplier to incentives

* remove testdata file creation
2020-09-30 14:41:46 -04:00
Kevin Davis
d577711056
kava-3 to kava-4 pricefeed migration (#664) 2020-09-30 14:33:48 -04:00
Kevin Davis
8e01b0b3f4
fix (harvest-cli): parse correct arg index (#669) 2020-09-27 11:47:49 -04:00
Denali Marsh
5ce045f46f
rename hvt (#661) 2020-09-25 11:07:20 -04:00
Kevin Davis
2e250cc750
fix: use correct querier endpoint (#659) 2020-09-22 10:42:30 -04:00
Kevin Davis
fe38c4aa43
harvest v1 (#658)
* wip: and types and keeper methods

* add keeper tests

* add client

* add spec and events

* respond to review comments

* apply suggestions from review

* feat: add test for validator vesting case

* use int64 for multiplier type

* remove incentive changes
2020-09-21 17:08:43 -04:00
Kevin Davis
7292b8843a
[R4R] feat: add variable length lockups for incentive rewards (#655)
* fix: update params in spec to match implementation

* feat: add variable length lockups for incentive rewards

* fix typos

* update spec

* address review comments

* feat: improve claim test
2020-09-21 16:20:11 -04:00
Denali Marsh
e2f515ba9e
Querier improvements: CDP and Auction priority 1 queries (#644)
* query auction by lot owner

* add SavingsRateDistributed to store

* v2cdps: filtered cdps query

* update v2cdps cli examples

* add savings rate dist counter to begin blocker

* implement savings rate dist cli query

* implement cdp REST queries

* minor auction CLI/REST updates

* fix auction querier bug

* update REST endpoint to 'cdps'

* update to savings-rate-dist

* update SavingsRateDistributed get/set

* update tests

* fix savings rate dist rounding errors

* 'collateralDenom' -> 'collateralType'

* refactor 'v2cdps' -> 'cdps', add ratio param

* fix augmented CDP type, msg string() method

* fix cdp querier test

* filter query results efficiently

* querier tests

* limit type iteration if owner defined

* improve savings rate dist genesis validation

* default sdk.Dec{} to sdk.ZeroDec in queries

* update condition logic for finding intersection

* fix cdp querier filtering

* Update kava-4 swagger (#653)

* add collateral_type, update cdp params

* savings rate, auctions, get cdps

* drop owner from AuctionResponse

* remove duplicate collateral denom

* update query paths with {collateral-type}
2020-09-16 20:45:10 -04:00
Kevin Davis
641d946ae7
[R4R] address potential panic in validator vesting (#645)
* emit event instead of panic on undelegation errors
2020-09-16 20:44:15 -04:00
Ruaridh
64aa61d285
Update to sdk v0.39.x (#625)
* fix cli tests
- add pruning config
- add the new build path

* bump sdk version, make changes to get kvd running

* add draft multi-tx test

* add multiple txs per block test

* remove unused file

* sync VV account json format with sdk account types

* add another jsons test

* refactor coin creation in tests

* add missed file

* update changelog
2020-09-16 15:16:14 -04:00
Kevin Davis
15a7dc610e
[R4R] feat: Fetch auctions from historical state (#649)
* feat: query old blocks for auctions

* fix: add next auction id to querier

* fix: set boolean when found

* fix: use correct query route and params

* apply suggestions from review comments
2020-09-16 14:58:11 -04:00
Kevin Davis
c249746bf3
[R4R] feat: payout liquid claims without creating vesting account (#651)
* feat: payout liquid claims without creating vesting account
2020-09-14 16:18:21 -04:00
Denali Marsh
8966329643
add example to cli cmd (#648) 2020-09-11 14:58:22 +02:00
Ruaridh
2ffb1edd1f
Simulation fixes (#527)
* fix go version in dockerfile

* mix frequently occuring errors

* add missed import

* fix minor validator vesting sim bug

* fix auction sim bug

* fix docker build

* add todo from sim failure

* tidy up dockerfile

* update docs, add dockerignore to speed up builds

* Update simulations/README.md

Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>

* add stack traces to logs for easier debugging

* replace root func with sdk version

Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
Co-authored-by: karzak <kjydavis3@gmail.com>
2020-09-01 11:33:12 -04:00
Kevin Davis
f22139fcee
[R4R] return all claims for incentive queries (#642)
* feat: return all claims for incentive queries

* cleanup test comments

* add struct tags

Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>

Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
2020-09-01 08:34:11 -04:00
Kevin Davis
dbb8f387f9
fix: use correct committee params (#640) 2020-08-30 10:47:07 -04:00
Kevin Davis
a53fbc354a
fix: enforce cdp denom matches collateral type (#638) 2020-08-27 07:21:35 -04:00
Kevin Davis
5fc85f10a6
Add rate limiting to bep3 assets (#623)
* feat: use only module account for bep3 txs

* wip: add time-based supply limits

* add tests and sims

* update genesis tests

* fix migration, committee tests

* update migrations

* fix: set previous block time in begin block

* update store decoder

* add additional bep3 params to committee

* revert incorrect rebase changes

* add migration test

* address review comments
2020-08-26 22:05:27 -04:00
Kevin Davis
c0006ca8eb
Update reward vesting length calculation (#624)
* use remaining length when sending coins to vesting account

* query claims that have corresponding claim periods

* cleanup comments

* remove debugging statements

* fix bug with inserting period in middle of vesting schedule

* apply review suggestion
2020-08-26 20:34:55 -04:00
Kevin Davis
fca16da84a
fix: return if supply limit hit in issuance sims (#635)
* fix: return if supply limit hit in issuance sims
2020-08-21 19:39:20 -04:00
Kevin Davis
b2eff063a8
fix: initialize issuance asset supplies at genesis (#634) 2020-08-21 19:24:31 -04:00
Kevin Davis
b356309d90
Add optional rate limits to issuance (#627)
* add rate-limiting and optional blocklists

* fix: check account is not nil

* add tests for rate-limiting

* update simulations

* fix typos

* remove unsued function arg
2020-08-21 18:56:20 -04:00
Kevin Davis
2a3192fa0e
fix: use collateral type in cdp simulations (#632) 2020-08-21 17:38:12 -04:00
Kevin Davis
daa1b2bb83
Add collateral type to cdp (#629)
* add collateral type field to cdp and collateral  param

* fix upstream tests

* fix simulations

* fix validation logic

* update incentive to use collateral type instead of denom

* use collateral type instead of denom in cdp

* remove unused code

* address review comments
2020-08-21 15:42:46 -04:00
Kevin Davis
e14466547d
Issuance module (#599)
* wip: issuance module

* add keeper and module methods

* add begin blocker

* add client

* update events

* add simulations

* ignore v0.8 migration tests for now

* ignore migration tests in ci

* add test suite

* update spec to match implementation details

* add unblock method

* address review comments

* fix typos
2020-08-17 13:09:02 -04:00