Commit Graph

3 Commits

Author SHA1 Message Date
Derrick Lee
6ef9bab67d
Add liquid staking reward redistribution via incentive (#1308)
* wip Add claim

* Add distr keeper and claiming

* Add claim test

* Update claim test with failures

* wip Add staking rewards

* -S

Fix savings to earn incentive methods

* Use a single accural time for all earn incentives

* Add additional required liquid methods

* Update genesis to only include 1 accrual time for earn

* Revert "Update genesis to only include 1 accrual time for earn"

This reverts commit cc7e35347298681c0c8a4a0b9bf9b9b296c25531.

* Revert "Use a single accural time for all earn incentives"

This reverts commit aeb49c4622d4e3d99dc6421c8830932b1b546be9.

* Update tests with incentive distribution

* Add earn to incentive rewards query

* add earn cli tx

* Update claim example to use ukava large

* Use underlying ukava to determine proportional reward amount

* Rename liquid methods to reflect derivative value

* Add tests for derivative values

* Return error to panic in BeginBlocker

Co-authored-by: karzak <kjydavis3@gmail.com>
2022-09-28 13:20:01 -07:00
Derrick Lee
651de460ca
Add weighted bkava support for earn incentives (#1299)
* Add bkava handler for earn incentives

* Add bkava accum tests

* Add bkava denoms in index state

* Set storeTimeEquals to default value

* Add supply expected keepers

* Add tests for proportional adjustment

* Add liquid keeper to incentive keeper

* Use weighted reward periods for bkava

* Add liquid keeper to tests

* Add Accumulate override rewards period with deccoins

* Adjust test to handle sub unit coins

* Add liquid keeper to test

* Fix div by zero for proportional rewards

* Update test for actual expected values

* Update expected indexes to be same for different vaults

* Allow no stored time for vaults that have no indexes or state

* Add test for partial bkava deposit

* Add math check to test

* Deterministically iterate over bkava denoms

* Remove unused expected liquid method GetAllDerivativeDenoms
2022-09-23 09:38:22 -07:00
Derrick Lee
26a4b93588
Add base earn incentives (#1292)
* Add incentive types

* Add earn state methods

* Update earn incentives

* Update unit test NewKeeper to include earn keeper

* Fix sharesOwned typo

* Shares not used for AfterVaultDepositCreated

* Add earn to init genesis

* Pass earn keeper to incentive keeper

* Add sdk.Msg impl, disable legacy migrations

* Disable migrations

* Update incentive earn sync test

* Add earn to client and querier

* Add accum and init tests

* Add additional earn tests

* Fill in fakeEarnKeeper methods to fix tests

* Add earn reward periods to params, begin blocker earn reward

* Add earn to query

* Update genesis_test with missing DefaultMultiRewardPeriods parameter

* Remove disable of migration package

* Fix proto type comments

* Remove unused migration state

* Add legacytx.LegacyMsg compile time interface check

* add earn state validation to genesis validation

Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
2022-09-22 11:26:08 -07:00