incentive

package
v0.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Overview

nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/kava-labs/kava/x/incentive/types ALIASGEN: github.com/kava-labs/kava/x/incentive/keeper

Package incentive implements a Cosmos SDK module, per ADR 009, that provides governance-controlled, on-chain incentives for users who open cdps and mint stablecoins (USDX).

For the background and motivation of this module, see the governance proposal that was voted on by KAVA token holders: https://ipfs.io/ipfs/QmSYedssC3nyQacDJmNcREtgmTPyaMx2JX7RNkMdAVkdkr/user-growth-fund-proposal.pdf

The 'Reward' parameter is used to control how much incentives are given. For example, the following reward:

Reward{
	Active: true,
	Denom: "bnb",
	AvailableRewards: sdk.NewCoin("ukava", 1000000000),
	Duration: time.Hour*7*24,
	TimeLock: time.Hour*24*365,
	ClaimDuration: time.Hour*7*24,
}

will distribute 1000 KAVA each week (Duration) to users who mint USDX using collateral bnb. That KAVA can be claimed by the user for one week (ClaimDuration) after the reward period expires, and all KAVA rewards will be timelocked for 1 year (TimeLock). If a user does not claim them during the claim duration period, they are forgone.

Rewards are accumulated by users continuously and proportionally - ie. if a user holds a CDP that has minted 10% of all USDX backed by bnb for the entire reward period, they will be eligible to claim 10% of rewards for that period.

Once a reward period ends, but not before, users can claim the rewards they have accumulated. Users claim rewards using a MsgClaimReward transaction. The following msg:

MsgClaimReward {
	"kava1..."
	"bnb"
}

will claim all outstanding rewards for minting USDX backed by bnb for the input user.

Index

Constants

View Source
const (
	USDXMintingClaimType               = types.USDXMintingClaimType
	HardLiquidityProviderClaimType     = types.HardLiquidityProviderClaimType
	BondDenom                          = types.BondDenom
	EventTypeClaim                     = types.EventTypeClaim
	EventTypeRewardPeriod              = types.EventTypeRewardPeriod
	EventTypeClaimPeriod               = types.EventTypeClaimPeriod
	EventTypeClaimPeriodExpiry         = types.EventTypeClaimPeriodExpiry
	AttributeValueCategory             = types.AttributeValueCategory
	AttributeKeyClaimedBy              = types.AttributeKeyClaimedBy
	AttributeKeyClaimAmount            = types.AttributeKeyClaimAmount
	AttributeKeyClaimType              = types.AttributeKeyClaimType
	AttributeKeyRewardPeriod           = types.AttributeKeyRewardPeriod
	AttributeKeyClaimPeriod            = types.AttributeKeyClaimPeriod
	ModuleName                         = types.ModuleName
	StoreKey                           = types.StoreKey
	RouterKey                          = types.RouterKey
	DefaultParamspace                  = types.DefaultParamspace
	QuerierRoute                       = types.QuerierRoute
	Small                              = types.Small
	Medium                             = types.Medium
	Large                              = types.Large
	QueryGetRewards                    = types.QueryGetRewards
	QueryGetHardRewards                = types.QueryGetHardRewards
	QueryGetHardRewardsUnsynced        = types.QueryGetHardRewardsUnsynced
	QueryGetUSDXMintingRewards         = types.QueryGetUSDXMintingRewards
	QueryGetUSDXMintingRewardsUnsynced = types.QueryGetUSDXMintingRewardsUnsynced
	QueryGetRewardFactors              = types.QueryGetRewardFactors
	QueryGetParams                     = types.QueryGetParams
	QueryGetRewardPeriods              = types.QueryGetRewardPeriods
	QueryGetClaimPeriods               = types.QueryGetClaimPeriods
	RestClaimCollateralType            = types.RestClaimCollateralType
	RestClaimOwner                     = types.RestClaimOwner
	RestClaimType                      = types.RestClaimType
	RestUnsynced                       = types.RestUnsynced
	BeginningOfMonth                   = keeper.BeginningOfMonth
	MidMonth                           = keeper.MidMonth
	PaymentHour                        = keeper.PaymentHour
)

Variables

View Source
var (
	// functions aliases
	GetTotalVestingPeriodLength              = types.GetTotalVestingPeriodLength
	NewUSDXMintingClaim                      = types.NewUSDXMintingClaim
	NewHardLiquidityProviderClaim            = types.NewHardLiquidityProviderClaim
	NewMultiRewardPeriod                     = types.NewMultiRewardPeriod
	NewRewardIndex                           = types.NewRewardIndex
	NewMultiRewardIndex                      = types.NewMultiRewardIndex
	RegisterCodec                            = types.RegisterCodec
	NewGenesisState                          = types.NewGenesisState
	DefaultGenesisState                      = types.DefaultGenesisState
	NewGenesisAccumulationTime               = types.NewGenesisAccumulationTime
	NewMsgClaimUSDXMintingReward             = types.NewMsgClaimUSDXMintingReward
	NewMsgClaimUSDXMintingRewardVVesting     = types.NewMsgClaimUSDXMintingRewardVVesting
	NewMsgClaimHardReward                    = types.NewMsgClaimHardReward
	NewMsgClaimHardRewardVVesting            = types.NewMsgClaimHardRewardVVesting
	NewParams                                = types.NewParams
	DefaultParams                            = types.DefaultParams
	ParamKeyTable                            = types.ParamKeyTable
	NewRewardPeriod                          = types.NewRewardPeriod
	NewMultiplier                            = types.NewMultiplier
	NewPeriod                                = types.NewPeriod
	NewQueryRewardsParams                    = types.NewQueryRewardsParams
	NewQueryUSDXMintingRewardsParams         = types.NewQueryUSDXMintingRewardsParams
	NewQueryUSDXMintingRewardsUnsyncedParams = types.NewQueryUSDXMintingRewardsUnsyncedParams
	NewQueryHardRewardsParams                = types.NewQueryHardRewardsParams
	NewQueryHardRewardsUnsyncedParams        = types.NewQueryHardRewardsUnsyncedParams
	NewQueryRewardFactorsParams              = types.NewQueryRewardFactorsParams
	NewRewardFactor                          = types.NewRewardFactor
	NewKeeper                                = keeper.NewKeeper
	NewQuerier                               = keeper.NewQuerier
	CalculateTimeElapsed                     = keeper.CalculateTimeElapsed

	// variable aliases
	ModuleCdc                                       = types.ModuleCdc
	ErrClaimNotFound                                = types.ErrClaimNotFound
	ErrRewardPeriodNotFound                         = types.ErrRewardPeriodNotFound
	ErrInvalidAccountType                           = types.ErrInvalidAccountType
	ErrNoClaimsFound                                = types.ErrNoClaimsFound
	ErrInsufficientModAccountBalance                = types.ErrInsufficientModAccountBalance
	ErrAccountNotFound                              = types.ErrAccountNotFound
	ErrInvalidMultiplier                            = types.ErrInvalidMultiplier
	ErrZeroClaim                                    = types.ErrZeroClaim
	ErrClaimExpired                                 = types.ErrClaimExpired
	ErrInvalidClaimType                             = types.ErrInvalidClaimType
	ErrInvalidClaimOwner                            = types.ErrInvalidClaimOwner
	USDXMintingClaimKeyPrefix                       = types.USDXMintingClaimKeyPrefix
	USDXMintingRewardFactorKeyPrefix                = types.USDXMintingRewardFactorKeyPrefix
	PreviousUSDXMintingRewardAccrualTimeKeyPrefix   = types.PreviousUSDXMintingRewardAccrualTimeKeyPrefix
	HardLiquidityClaimKeyPrefix                     = types.HardLiquidityClaimKeyPrefix
	HardSupplyRewardIndexesKeyPrefix                = types.HardSupplyRewardIndexesKeyPrefix
	PreviousHardSupplyRewardAccrualTimeKeyPrefix    = types.PreviousHardSupplyRewardAccrualTimeKeyPrefix
	HardBorrowRewardIndexesKeyPrefix                = types.HardBorrowRewardIndexesKeyPrefix
	PreviousHardBorrowRewardAccrualTimeKeyPrefix    = types.PreviousHardBorrowRewardAccrualTimeKeyPrefix
	HardDelegatorRewardFactorKeyPrefix              = types.HardDelegatorRewardFactorKeyPrefix
	PreviousHardDelegatorRewardAccrualTimeKeyPrefix = types.PreviousHardDelegatorRewardAccrualTimeKeyPrefix
	USDXMintingRewardDenom                          = types.USDXMintingRewardDenom
	HardLiquidityRewardDenom                        = types.HardLiquidityRewardDenom
	KeyUSDXMintingRewardPeriods                     = types.KeyUSDXMintingRewardPeriods
	KeyHardSupplyRewardPeriods                      = types.KeyHardSupplyRewardPeriods
	KeyHardBorrowRewardPeriods                      = types.KeyHardBorrowRewardPeriods
	KeyHardDelegatorRewardPeriods                   = types.KeyHardDelegatorRewardPeriods
	KeyClaimEnd                                     = types.KeyClaimEnd
	KeyMultipliers                                  = types.KeyMultipliers
	DefaultActive                                   = types.DefaultActive
	DefaultRewardPeriods                            = types.DefaultRewardPeriods
	DefaultMultiRewardPeriods                       = types.DefaultMultiRewardPeriods
	DefaultMultipliers                              = types.DefaultMultipliers
	DefaultUSDXClaims                               = types.DefaultUSDXClaims
	DefaultHardClaims                               = types.DefaultHardClaims
	DefaultGenesisAccumulationTimes                 = types.DefaultGenesisAccumulationTimes
	DefaultClaimEnd                                 = types.DefaultClaimEnd
	GovDenom                                        = types.GovDenom
	PrincipalDenom                                  = types.PrincipalDenom
	IncentiveMacc                                   = types.IncentiveMacc
)

Functions

func BeginBlocker

func BeginBlocker(ctx sdk.Context, k keeper.Keeper)

BeginBlocker runs at the start of every block

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k keeper.Keeper) types.GenesisState

ExportGenesis export genesis state for incentive module

func InitGenesis

func InitGenesis(ctx sdk.Context, k keeper.Keeper, supplyKeeper types.SupplyKeeper, cdpKeeper types.CdpKeeper, gs types.GenesisState)

InitGenesis initializes the store state from a genesis state.

func NewHandler

func NewHandler(k keeper.Keeper) sdk.Handler

NewHandler creates an sdk.Handler for incentive module messages

Types

type AccountKeeper

type AccountKeeper = types.AccountKeeper

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

AppModule implements the sdk.AppModule interface.

func NewAppModule

func NewAppModule(keeper Keeper, accountKeeper auth.AccountKeeper, supplyKeeper SupplyKeeper, cdpKeeper CdpKeeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)

BeginBlock returns the begin blocker for the incentive module.

func (AppModule) EndBlock

EndBlock returns the end blocker for the incentive module. It returns no validator updates.

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

ExportGenesis returns the exported genesis state as raw bytes for the incentive module

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

InitGenesis performs genesis initialization for the incentive module. It returns no validator updates.

func (AppModule) Name

func (AppModule) Name() string

Name returns the incentive module's name.

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

NewHandler returns an sdk.Handler for the incentive module.

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

NewQuerierHandler returns the incentive module sdk.Querier.

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

QuerierRoute returns the incentive module's querier route name.

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

RegisterInvariants registers the incentive module invariants.

func (AppModule) Route

func (AppModule) Route() string

Route returns the message routing key for the incentive module.

func (AppModule) WeightedOperations

func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation

WeightedOperations returns the all the incentive module operations with their respective weights.

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic defines the basic application module used by the incentive module.

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

DefaultGenesis returns default genesis state as raw bytes for the incentive module.

func (AppModuleBasic) GenerateGenesisState

func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState)

GenerateGenesisState creates a randomized GenState of the incentive module

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

GetQueryCmd returns no root query command for the incentive module.

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

GetTxCmd returns the root tx command for the incentive module.

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the incentive module's name.

func (AppModuleBasic) ProposalContents

ProposalContents doesn't return any content functions for governance proposals.

func (AppModuleBasic) RandomizedParams

func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange

RandomizedParams creates randomized incentive param changes for the simulator.

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the incentive module's types for the given codec.

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)

RegisterRESTRoutes registers the REST routes for the incentive module.

func (AppModuleBasic) RegisterStoreDecoder

func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)

RegisterStoreDecoder registers a decoder for incentive module's types

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

ValidateGenesis performs genesis state validation for the incentive module.

type BaseClaim added in v0.13.0

type BaseClaim = types.BaseClaim

type BaseMultiClaim added in v0.13.0

type BaseMultiClaim = types.BaseMultiClaim

type CDPHooks added in v0.13.0

type CDPHooks = types.CDPHooks

type CdpKeeper

type CdpKeeper = types.CdpKeeper

type Claim

type Claim = types.Claim

type Claims

type Claims = types.Claims

type GenesisAccumulationTime added in v0.13.0

type GenesisAccumulationTime = types.GenesisAccumulationTime

type GenesisAccumulationTimes added in v0.13.0

type GenesisAccumulationTimes = types.GenesisAccumulationTimes

type GenesisState

type GenesisState = types.GenesisState

type HARDHooks added in v0.13.0

type HARDHooks = types.HARDHooks

type HardKeeper added in v0.13.0

type HardKeeper = types.HardKeeper

type HardLiquidityProviderClaim added in v0.13.0

type HardLiquidityProviderClaim = types.HardLiquidityProviderClaim

type HardLiquidityProviderClaims added in v0.13.0

type HardLiquidityProviderClaims = types.HardLiquidityProviderClaims

type Hooks added in v0.13.0

type Hooks = keeper.Hooks

type Keeper

type Keeper = keeper.Keeper

type MsgClaimHardReward added in v0.14.0

type MsgClaimHardReward = types.MsgClaimHardReward

type MsgClaimHardRewardVVesting added in v0.14.2

type MsgClaimHardRewardVVesting = types.MsgClaimHardRewardVVesting

type MsgClaimUSDXMintingReward added in v0.13.0

type MsgClaimUSDXMintingReward = types.MsgClaimUSDXMintingReward

type MsgClaimUSDXMintingRewardVVesting added in v0.14.2

type MsgClaimUSDXMintingRewardVVesting = types.MsgClaimUSDXMintingRewardVVesting

type MultiRewardIndex added in v0.13.0

type MultiRewardIndex = types.MultiRewardIndex

type MultiRewardIndexes added in v0.13.0

type MultiRewardIndexes = types.MultiRewardIndexes

type MultiRewardPeriod added in v0.13.0

type MultiRewardPeriod = types.MultiRewardPeriod

type MultiRewardPeriods added in v0.13.0

type MultiRewardPeriods = types.MultiRewardPeriods

type Multiplier added in v0.11.0

type Multiplier = types.Multiplier

type MultiplierName added in v0.11.0

type MultiplierName = types.MultiplierName

type Multipliers added in v0.11.0

type Multipliers = types.Multipliers

type Params

type Params = types.Params

type QueryHardRewardsParams added in v0.13.0

type QueryHardRewardsParams = types.QueryHardRewardsParams

type QueryHardRewardsUnsyncedParams added in v0.14.2

type QueryHardRewardsUnsyncedParams = types.QueryHardRewardsUnsyncedParams

type QueryRewardFactorsParams added in v0.14.2

type QueryRewardFactorsParams = types.QueryRewardFactorsParams

type QueryRewardsParams added in v0.13.0

type QueryRewardsParams = types.QueryRewardsParams

type QueryUSDXMintingRewardsParams added in v0.13.0

type QueryUSDXMintingRewardsParams = types.QueryUSDXMintingRewardsParams

type QueryUSDXMintingRewardsUnsyncedParams added in v0.14.2

type QueryUSDXMintingRewardsUnsyncedParams = types.QueryUSDXMintingRewardsUnsyncedParams

type RewardFactor added in v0.14.2

type RewardFactor = types.RewardFactor

type RewardFactors added in v0.14.2

type RewardFactors = types.RewardFactors

type RewardIndex added in v0.13.0

type RewardIndex = types.RewardIndex

type RewardIndexes added in v0.13.0

type RewardIndexes = types.RewardIndexes

type RewardPeriod

type RewardPeriod = types.RewardPeriod

type RewardPeriods

type RewardPeriods = types.RewardPeriods

type StakingKeeper added in v0.13.0

type StakingKeeper = types.StakingKeeper

type SupplyKeeper

type SupplyKeeper = types.SupplyKeeper

type USDXMintingClaim added in v0.13.0

type USDXMintingClaim = types.USDXMintingClaim

type USDXMintingClaims added in v0.13.0

type USDXMintingClaims = types.USDXMintingClaims

Directories

Path Synopsis
client
cli
legacy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL