0g-chain/x/incentive/spec
Ruaridh 6f193c7f2a
Refactor incentive accumulators to be the same (#970)
* add test for validate multi reward periods

* tidy up: combine files

* don't accumulate global indexes containing zeros
Previously if the time since last block was 0,
indexes were added containing 0s.
Now leave them out. Missing is assumed to be 0.

* move state independent test to types folder

* clarify reward source concept to "source shares"
- rename variables and update doc comments
- extract method from swap accumulation

* tidy up and expand swap accumulation unit tests

* rename swap test file to match others

* update swap pool id format in tests

* refactor borrow accumulation, use new accumulator

* refactor supply accumulation, use new accumulator

* refactor delegator accumulation, use accumulator

* refactor usdx accumulation, use new accumulator

* fix types const

* remove unsed methods

* more usdx minting param validation.
Protect against the rewards per second denom changing.
It should always be "ukava".

* add safety check in InitGenesis
It prevents huge accumulations on the first block by limiting all
previous accumulation times to be within one year of genesis

* add todo for adding swp token distirbution info
2021-07-22 13:53:18 +01:00
..
01_concepts.md Refactor incentive accumulators to be the same (#970) 2021-07-22 13:53:18 +01:00
02_state.md Add hard and incentive spec updates (#817) 2021-02-19 17:14:48 +01:00
03_messages.md refactor to MsgClaimHardReward (#879) 2021-03-15 12:03:15 -06:00
04_events.md refactor to MsgClaimHardReward (#879) 2021-03-15 12:03:15 -06:00
05_params.md Add hard and incentive spec updates (#817) 2021-02-19 17:14:48 +01:00
06_hooks.md Add hard and incentive spec updates (#817) 2021-02-19 17:14:48 +01:00
07_begin_block.md Add hard and incentive spec updates (#817) 2021-02-19 17:14:48 +01:00
README.md Refactor incentive accumulators to be the same (#970) 2021-07-22 13:53:18 +01:00

incentive

  1. Concepts
  2. State
  3. Messages
  4. Events
  5. Params
  6. Hooks
  7. BeginBlock

Abstract

x/incentive is an implementation of a Cosmos SDK Module that allows for governance controlled user incentives for users who take certain actions, such as opening a collateralized debt position (CDP). Governance proposes an array of rewards, with each item representing a collateral type that will be eligible for rewards. Each collateral reward specifies the number of coins awarded per second, the length of rewards periods. Governance can alter the collateral rewards using parameter change proposals as well as adding or removing collateral types. All changes to parameters would take place in the next period. User rewards are opt in, ie. users must claim rewards in order to receive them. If users fail to claim rewards before the claim period expiry, they are no longer eligible for rewards.

Dependencies

This module uses hooks to update user rewards. Currently, incentive implements hooks from the cdp, hard, swap, and staking (comsos-sdk) modules. All rewards are paid out from the kavadist module account.