Documentation ¶
Index ¶
- Constants
- Variables
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- type BaseClaim
- type BaseMultiClaim
- type Claim
- type Claims
- type GenesisAccumulationTime
- type GenesisAccumulationTimes
- type GenesisRewardIndexes
- type GenesisRewardIndexesSlice
- type GenesisState
- type HardLiquidityProviderClaim
- func (c HardLiquidityProviderClaim) GetOwner() sdk.AccAddress
- func (c HardLiquidityProviderClaim) GetReward() sdk.Coins
- func (c HardLiquidityProviderClaim) GetType() string
- func (c HardLiquidityProviderClaim) HasBorrowRewardIndex(denom string) (int64, bool)
- func (c HardLiquidityProviderClaim) HasDelegatorRewardIndex(collateralType string) (int64, bool)
- func (c HardLiquidityProviderClaim) HasSupplyRewardIndex(denom string) (int64, bool)
- func (c HardLiquidityProviderClaim) String() string
- func (c HardLiquidityProviderClaim) Validate() error
- type HardLiquidityProviderClaims
- type MultiRewardIndex
- type MultiRewardIndexes
- func (mris MultiRewardIndexes) Get(denom string) (RewardIndexes, bool)
- func (mris MultiRewardIndexes) GetCollateralTypes() []string
- func (mris MultiRewardIndexes) GetRewardIndex(denom string) (MultiRewardIndex, bool)
- func (mris MultiRewardIndexes) GetRewardIndexIndex(denom string) (int, bool)
- func (mris MultiRewardIndexes) RemoveRewardIndex(denom string) MultiRewardIndexes
- func (mris MultiRewardIndexes) Validate() error
- func (mris MultiRewardIndexes) With(denom string, indexes RewardIndexes) MultiRewardIndexes
- type MultiRewardPeriod
- type MultiRewardPeriods
- type Multiplier
- type MultiplierName
- type Multipliers
- type Params
- type RewardIndex
- type RewardIndexes
- func (ris RewardIndexes) Get(denom string) (sdk.Dec, bool)
- func (ris RewardIndexes) GetFactorIndex(denom string) (int, bool)
- func (ris RewardIndexes) GetRewardIndex(denom string) (RewardIndex, bool)
- func (ris RewardIndexes) Validate() error
- func (ris RewardIndexes) With(denom string, factor sdk.Dec) RewardIndexes
- type RewardPeriod
- type RewardPeriods
- type USDXMintingClaim
- func (c USDXMintingClaim) GetOwner() sdk.AccAddress
- func (c USDXMintingClaim) GetReward() sdk.Coin
- func (c USDXMintingClaim) GetType() string
- func (c USDXMintingClaim) HasRewardIndex(collateralType string) (int64, bool)
- func (c USDXMintingClaim) String() string
- func (c USDXMintingClaim) Validate() error
- type USDXMintingClaims
Constants ¶
const ( Small MultiplierName = "small" Medium MultiplierName = "medium" Large MultiplierName = "large" USDXMintingClaimType = "usdx_minting" HardLiquidityProviderClaimType = "hard_liquidity_provider" BondDenom = "ukava" ModuleName = "incentive" )
Valid reward multipliers
Variables ¶
var ( KeyUSDXMintingRewardPeriods = []byte("USDXMintingRewardPeriods") KeyHardSupplyRewardPeriods = []byte("HardSupplyRewardPeriods") KeyHardBorrowRewardPeriods = []byte("HardBorrowRewardPeriods") KeyHardDelegatorRewardPeriods = []byte("HardDelegatorRewardPeriods") KeyClaimEnd = []byte("ClaimEnd") KeyMultipliers = []byte("ClaimMultipliers") DefaultActive = false DefaultRewardPeriods = RewardPeriods{} DefaultMultiRewardPeriods = MultiRewardPeriods{} DefaultMultipliers = Multipliers{} DefaultUSDXClaims = USDXMintingClaims{} DefaultHardClaims = HardLiquidityProviderClaims{} DefaultGenesisAccumulationTimes = GenesisAccumulationTimes{} DefaultGenesisRewardIndexes = GenesisRewardIndexesSlice{} DefaultClaimEnd = tmtime.Canonical(time.Unix(1, 0)) GovDenom = cdptypes.DefaultGovDenom PrincipalDenom = "usdx" IncentiveMacc = kavadistTypes.ModuleName USDXMintingRewardDenom = "ukava" HardLiquidityRewardDenom = "hard" )
Parameter keys and default values
Functions ¶
func ParamKeyTable ¶
ParamKeyTable Key declaration for parameters
func RegisterCodec ¶
RegisterCodec registers the necessary types for incentive module
Types ¶
type BaseClaim ¶
type BaseClaim struct { Owner sdk.AccAddress `json:"owner" yaml:"owner"` Reward sdk.Coin `json:"reward" yaml:"reward"` }
BaseClaim is a common type shared by all Claims
func (BaseClaim) GetOwner ¶
func (c BaseClaim) GetOwner() sdk.AccAddress
GetOwner is a getter for Claim Owner
type BaseMultiClaim ¶
type BaseMultiClaim struct { Owner sdk.AccAddress `json:"owner" yaml:"owner"` Reward sdk.Coins `json:"reward" yaml:"reward"` }
BaseMultiClaim is a common type shared by all Claims with multiple reward denoms
func (BaseMultiClaim) GetOwner ¶
func (c BaseMultiClaim) GetOwner() sdk.AccAddress
GetOwner is a getter for Claim Owner
func (BaseMultiClaim) GetReward ¶
func (c BaseMultiClaim) GetReward() sdk.Coins
GetReward is a getter for Claim Reward
func (BaseMultiClaim) GetType ¶
func (c BaseMultiClaim) GetType() string
GetType returns the claim type, used to identify auctions in event attributes
func (BaseMultiClaim) String ¶
func (c BaseMultiClaim) String() string
String implements fmt.Stringer
func (BaseMultiClaim) Validate ¶
func (c BaseMultiClaim) Validate() error
Validate performs a basic check of a BaseClaim fields
type Claim ¶
type Claim interface { GetOwner() sdk.AccAddress GetReward() sdk.Coin GetType() string }
Claim is an interface for handling common claim actions
type GenesisAccumulationTime ¶
type GenesisAccumulationTime struct { CollateralType string `json:"collateral_type" yaml:"collateral_type"` PreviousAccumulationTime time.Time `json:"previous_accumulation_time" yaml:"previous_accumulation_time"` }
GenesisAccumulationTime stores the previous reward distribution time and its corresponding collateral type
func NewGenesisAccumulationTime ¶
func NewGenesisAccumulationTime(ctype string, prevTime time.Time) GenesisAccumulationTime
NewGenesisAccumulationTime returns a new GenesisAccumulationTime
func (GenesisAccumulationTime) Validate ¶
func (gat GenesisAccumulationTime) Validate() error
Validate performs validation of GenesisAccumulationTime
type GenesisAccumulationTimes ¶
type GenesisAccumulationTimes []GenesisAccumulationTime
GenesisAccumulationTimes slice of GenesisAccumulationTime
func (GenesisAccumulationTimes) Validate ¶
func (gats GenesisAccumulationTimes) Validate() error
Validate performs validation of GenesisAccumulationTimes
type GenesisRewardIndexes ¶
type GenesisRewardIndexes struct { CollateralType string `json:"collateral_type" yaml:"collateral_type"` RewardIndexes RewardIndexes `json:"reward_indexes" yaml:"reward_indexes"` }
func NewGenesisRewardIndexes ¶
func NewGenesisRewardIndexes(ctype string, indexes RewardIndexes) GenesisRewardIndexes
NewGenesisRewardIndexes returns a new GenesisRewardIndexes
func (GenesisRewardIndexes) Validate ¶
func (gris GenesisRewardIndexes) Validate() error
type GenesisRewardIndexesSlice ¶
type GenesisRewardIndexesSlice []GenesisRewardIndexes
func (GenesisRewardIndexesSlice) Validate ¶
func (gris GenesisRewardIndexesSlice) Validate() error
Validate performs validation of GenesisAccumulationTimes
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` USDXAccumulationTimes GenesisAccumulationTimes `json:"usdx_accumulation_times" yaml:"usdx_accumulation_times"` USDXRewardIndexes GenesisRewardIndexesSlice `json:"usdx_reward_indexes" yaml:"usdx_reward_indexes"` HardSupplyAccumulationTimes GenesisAccumulationTimes `json:"hard_supply_accumulation_times" yaml:"hard_supply_accumulation_times"` HardSupplyRewardIndexes GenesisRewardIndexesSlice `json:"hard_supply_reward_indexes" yaml:"hard_supply_reward_indexes"` HardBorrowAccumulationTimes GenesisAccumulationTimes `json:"hard_borrow_accumulation_times" yaml:"hard_borrow_accumulation_times"` HardBorrowRewardIndexes GenesisRewardIndexesSlice `json:"hard_borrow_reward_indexes" yaml:"hard_borrow_reward_indexes"` HardDelegatorAccumulationTimes GenesisAccumulationTimes `json:"hard_delegator_accumulation_times" yaml:"hard_delegator_accumulation_times"` HardDelegatorRewardIndexes GenesisRewardIndexesSlice `json:"hard_delegator_reward_indexes" yaml:"hard_delegator_reward_indexes"` USDXMintingClaims USDXMintingClaims `json:"usdx_minting_claims" yaml:"usdx_minting_claims"` HardLiquidityProviderClaims HardLiquidityProviderClaims `json:"hard_liquidity_provider_claims" yaml:"hard_liquidity_provider_claims"` }
GenesisState is the state that must be provided at genesis.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns a default genesis state
func NewGenesisState ¶
func NewGenesisState( params Params, usdxAccumTimes, hardSupplyAccumTimes, hardBorrowAccumTimes, hardDelegatorAccumTimes GenesisAccumulationTimes, usdxIndexes, hardSupplyIndexes, hardBorrowIndexes, hardDelegatorIndexes GenesisRewardIndexesSlice, c USDXMintingClaims, hc HardLiquidityProviderClaims, ) GenesisState
NewGenesisState returns a new genesis state
func (GenesisState) Validate ¶
func (gs GenesisState) Validate() error
Validate performs basic validation of genesis data returning an error for any failed validation criteria.
type HardLiquidityProviderClaim ¶
type HardLiquidityProviderClaim struct { BaseMultiClaim `json:"base_claim" yaml:"base_claim"` SupplyRewardIndexes MultiRewardIndexes `json:"supply_reward_indexes" yaml:"supply_reward_indexes"` BorrowRewardIndexes MultiRewardIndexes `json:"borrow_reward_indexes" yaml:"borrow_reward_indexes"` DelegatorRewardIndexes RewardIndexes `json:"delegator_reward_indexes" yaml:"delegator_reward_indexes"` }
HardLiquidityProviderClaim stores the hard liquidity provider rewards that can be claimed by owner
func NewHardLiquidityProviderClaim ¶
func NewHardLiquidityProviderClaim(owner sdk.AccAddress, rewards sdk.Coins, supplyRewardIndexes, borrowRewardIndexes MultiRewardIndexes, delegatorRewardIndexes RewardIndexes) HardLiquidityProviderClaim
NewHardLiquidityProviderClaim returns a new HardLiquidityProviderClaim
func (HardLiquidityProviderClaim) GetOwner ¶
func (c HardLiquidityProviderClaim) GetOwner() sdk.AccAddress
GetOwner returns the claim's owner
func (HardLiquidityProviderClaim) GetReward ¶
func (c HardLiquidityProviderClaim) GetReward() sdk.Coins
GetReward returns the claim's reward coin
func (HardLiquidityProviderClaim) GetType ¶
func (c HardLiquidityProviderClaim) GetType() string
GetType returns the claim's type
func (HardLiquidityProviderClaim) HasBorrowRewardIndex ¶
func (c HardLiquidityProviderClaim) HasBorrowRewardIndex(denom string) (int64, bool)
HasBorrowRewardIndex check if a claim has a borrow reward index for the input collateral type
func (HardLiquidityProviderClaim) HasDelegatorRewardIndex ¶
func (c HardLiquidityProviderClaim) HasDelegatorRewardIndex(collateralType string) (int64, bool)
HasDelegatorRewardIndex check if a claim has a delegator reward index for the input collateral type
func (HardLiquidityProviderClaim) HasSupplyRewardIndex ¶
func (c HardLiquidityProviderClaim) HasSupplyRewardIndex(denom string) (int64, bool)
HasSupplyRewardIndex check if a claim has a supply reward index for the input collateral type
func (HardLiquidityProviderClaim) String ¶
func (c HardLiquidityProviderClaim) String() string
String implements fmt.Stringer
func (HardLiquidityProviderClaim) Validate ¶
func (c HardLiquidityProviderClaim) Validate() error
Validate performs a basic check of a HardLiquidityProviderClaim fields
type HardLiquidityProviderClaims ¶
type HardLiquidityProviderClaims []HardLiquidityProviderClaim
HardLiquidityProviderClaims slice of HardLiquidityProviderClaim
func (HardLiquidityProviderClaims) Validate ¶
func (cs HardLiquidityProviderClaims) Validate() error
Validate checks if all the claims are valid and there are no duplicated entries.
type MultiRewardIndex ¶
type MultiRewardIndex struct { CollateralType string `json:"collateral_type" yaml:"collateral_type"` RewardIndexes RewardIndexes `json:"reward_indexes" yaml:"reward_indexes"` }
MultiRewardIndex stores reward accumulation information on multiple reward types
func NewMultiRewardIndex ¶
func NewMultiRewardIndex(collateralType string, indexes RewardIndexes) MultiRewardIndex
NewMultiRewardIndex returns a new MultiRewardIndex
func (MultiRewardIndex) GetFactorIndex ¶
func (mri MultiRewardIndex) GetFactorIndex(denom string) (int, bool)
GetFactorIndex gets the index of a specific reward index inside the array by its index
func (MultiRewardIndex) String ¶
func (mri MultiRewardIndex) String() string
func (MultiRewardIndex) Validate ¶
func (mri MultiRewardIndex) Validate() error
Validate validates multi-reward index
type MultiRewardIndexes ¶
type MultiRewardIndexes []MultiRewardIndex
MultiRewardIndexes slice of MultiRewardIndex
func (MultiRewardIndexes) Get ¶
func (mris MultiRewardIndexes) Get(denom string) (RewardIndexes, bool)
Get fetches a RewardIndexes by it's denom
func (MultiRewardIndexes) GetCollateralTypes ¶
func (mris MultiRewardIndexes) GetCollateralTypes() []string
GetCollateralTypes returns a slice of containing all collateral types
func (MultiRewardIndexes) GetRewardIndex ¶
func (mris MultiRewardIndexes) GetRewardIndex(denom string) (MultiRewardIndex, bool)
GetRewardIndex fetches a RewardIndex from a MultiRewardIndex by its denom
func (MultiRewardIndexes) GetRewardIndexIndex ¶
func (mris MultiRewardIndexes) GetRewardIndexIndex(denom string) (int, bool)
GetRewardIndexIndex fetches a specific reward index inside the array by its denom
func (MultiRewardIndexes) RemoveRewardIndex ¶
func (mris MultiRewardIndexes) RemoveRewardIndex(denom string) MultiRewardIndexes
RemoveRewardIndex removes a denom's reward interest factor value
func (MultiRewardIndexes) Validate ¶
func (mris MultiRewardIndexes) Validate() error
Validate validation for reward indexes
func (MultiRewardIndexes) With ¶
func (mris MultiRewardIndexes) With(denom string, indexes RewardIndexes) MultiRewardIndexes
With returns a copy of the indexes with a new RewardIndexes added
type MultiRewardPeriod ¶
type MultiRewardPeriod struct { Active bool `json:"active" yaml:"active"` CollateralType string `json:"collateral_type" yaml:"collateral_type"` Start time.Time `json:"start" yaml:"start"` End time.Time `json:"end" yaml:"end"` RewardsPerSecond sdk.Coins `json:"rewards_per_second" yaml:"rewards_per_second"` // per second reward payouts }
MultiRewardPeriod supports multiple reward types
func NewMultiRewardPeriod ¶
func NewMultiRewardPeriod(active bool, collateralType string, start time.Time, end time.Time, reward sdk.Coins) MultiRewardPeriod
NewMultiRewardPeriod returns a new MultiRewardPeriod
func (MultiRewardPeriod) String ¶
func (mrp MultiRewardPeriod) String() string
String implements fmt.Stringer
func (MultiRewardPeriod) Validate ¶
func (mrp MultiRewardPeriod) Validate() error
Validate performs a basic check of a MultiRewardPeriod.
type MultiRewardPeriods ¶
type MultiRewardPeriods []MultiRewardPeriod
MultiRewardPeriods array of MultiRewardPeriod
func (MultiRewardPeriods) GetMultiRewardPeriod ¶
func (mrps MultiRewardPeriods) GetMultiRewardPeriod(denom string) (MultiRewardPeriod, bool)
GetMultiRewardPeriod fetches a MultiRewardPeriod from an array of MultiRewardPeriods by its denom
func (MultiRewardPeriods) GetMultiRewardPeriodIndex ¶
func (mrps MultiRewardPeriods) GetMultiRewardPeriodIndex(denom string) (int, bool)
GetMultiRewardPeriodIndex returns the index of a MultiRewardPeriod inside array MultiRewardPeriods
func (MultiRewardPeriods) Validate ¶
func (mrps MultiRewardPeriods) Validate() error
Validate checks if all the RewardPeriods are valid and there are no duplicated entries.
type Multiplier ¶
type Multiplier struct { Name MultiplierName `json:"name" yaml:"name"` MonthsLockup int64 `json:"months_lockup" yaml:"months_lockup"` Factor sdk.Dec `json:"factor" yaml:"factor"` }
Multiplier amount the claim rewards get increased by, along with how long the claim rewards are locked
func NewMultiplier ¶
func NewMultiplier(name MultiplierName, lockup int64, factor sdk.Dec) Multiplier
NewMultiplier returns a new Multiplier
type MultiplierName ¶
type MultiplierName string
MultiplierName name for valid multiplier
func (MultiplierName) IsValid ¶
func (mn MultiplierName) IsValid() error
IsValid checks if the input is one of the expected strings
type Multipliers ¶
type Multipliers []Multiplier
Multipliers slice of Multiplier
func (Multipliers) Validate ¶
func (ms Multipliers) Validate() error
Validate validates each multiplier
type Params ¶
type Params struct { USDXMintingRewardPeriods RewardPeriods `json:"usdx_minting_reward_periods" yaml:"usdx_minting_reward_periods"` HardSupplyRewardPeriods MultiRewardPeriods `json:"hard_supply_reward_periods" yaml:"hard_supply_reward_periods"` HardBorrowRewardPeriods MultiRewardPeriods `json:"hard_borrow_reward_periods" yaml:"hard_borrow_reward_periods"` HardDelegatorRewardPeriods RewardPeriods `json:"hard_delegator_reward_periods" yaml:"hard_delegator_reward_periods"` ClaimMultipliers Multipliers `json:"claim_multipliers" yaml:"claim_multipliers"` ClaimEnd time.Time `json:"claim_end" yaml:"claim_end"` }
Params governance parameters for the incentive module
func DefaultParams ¶
func DefaultParams() Params
DefaultParams returns default params for incentive module
func NewParams ¶
func NewParams(usdxMinting RewardPeriods, hardSupply, hardBorrow MultiRewardPeriods, hardDelegator RewardPeriods, multipliers Multipliers, claimEnd time.Time) Params
NewParams returns a new params object
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs implements the ParamSet interface and returns all the key/value pairs
type RewardIndex ¶
type RewardIndex struct { CollateralType string `json:"collateral_type" yaml:"collateral_type"` RewardFactor sdk.Dec `json:"reward_factor" yaml:"reward_factor"` }
RewardIndex stores reward accumulation information
func NewRewardIndex ¶
func NewRewardIndex(collateralType string, factor sdk.Dec) RewardIndex
NewRewardIndex returns a new RewardIndex
func (RewardIndex) String ¶
func (ri RewardIndex) String() string
func (RewardIndex) Validate ¶
func (ri RewardIndex) Validate() error
Validate validates reward index
type RewardIndexes ¶
type RewardIndexes []RewardIndex
RewardIndexes slice of RewardIndex
func (RewardIndexes) Get ¶
func (ris RewardIndexes) Get(denom string) (sdk.Dec, bool)
Get fetches a RewardFactor by it's denom
func (RewardIndexes) GetFactorIndex ¶
func (ris RewardIndexes) GetFactorIndex(denom string) (int, bool)
GetFactorIndex gets the index of a specific reward index inside the array by its index
func (RewardIndexes) GetRewardIndex ¶
func (ris RewardIndexes) GetRewardIndex(denom string) (RewardIndex, bool)
GetRewardIndex fetches a RewardIndex by its denom
func (RewardIndexes) Validate ¶
func (ris RewardIndexes) Validate() error
Validate validation for reward indexes
func (RewardIndexes) With ¶
func (ris RewardIndexes) With(denom string, factor sdk.Dec) RewardIndexes
With returns a copy of the indexes with a new reward factor added
type RewardPeriod ¶
type RewardPeriod struct { Active bool `json:"active" yaml:"active"` CollateralType string `json:"collateral_type" yaml:"collateral_type"` Start time.Time `json:"start" yaml:"start"` End time.Time `json:"end" yaml:"end"` RewardsPerSecond sdk.Coin `json:"rewards_per_second" yaml:"rewards_per_second"` // per second reward payouts }
RewardPeriod stores the state of an ongoing reward
func NewRewardPeriod ¶
func NewRewardPeriod(active bool, collateralType string, start time.Time, end time.Time, reward sdk.Coin) RewardPeriod
NewRewardPeriod returns a new RewardPeriod
func (RewardPeriod) Validate ¶
func (rp RewardPeriod) Validate() error
Validate performs a basic check of a RewardPeriod fields.
type RewardPeriods ¶
type RewardPeriods []RewardPeriod
RewardPeriods array of RewardPeriod
func (RewardPeriods) Validate ¶
func (rps RewardPeriods) Validate() error
Validate checks if all the RewardPeriods are valid and there are no duplicated entries.
type USDXMintingClaim ¶
type USDXMintingClaim struct { BaseClaim `json:"base_claim" yaml:"base_claim"` RewardIndexes RewardIndexes `json:"reward_indexes" yaml:"reward_indexes"` }
USDXMintingClaim is for USDX minting rewards
func NewUSDXMintingClaim ¶
func NewUSDXMintingClaim(owner sdk.AccAddress, reward sdk.Coin, rewardIndexes RewardIndexes) USDXMintingClaim
NewUSDXMintingClaim returns a new USDXMintingClaim
func (USDXMintingClaim) GetOwner ¶
func (c USDXMintingClaim) GetOwner() sdk.AccAddress
GetOwner returns the claim's owner
func (USDXMintingClaim) GetReward ¶
func (c USDXMintingClaim) GetReward() sdk.Coin
GetReward returns the claim's reward coin
func (USDXMintingClaim) GetType ¶
func (c USDXMintingClaim) GetType() string
GetType returns the claim's type
func (USDXMintingClaim) HasRewardIndex ¶
func (c USDXMintingClaim) HasRewardIndex(collateralType string) (int64, bool)
HasRewardIndex check if a claim has a reward index for the input collateral type
func (USDXMintingClaim) String ¶
func (c USDXMintingClaim) String() string
String implements fmt.Stringer
func (USDXMintingClaim) Validate ¶
func (c USDXMintingClaim) Validate() error
Validate performs a basic check of a Claim fields
type USDXMintingClaims ¶
type USDXMintingClaims []USDXMintingClaim
USDXMintingClaims slice of USDXMintingClaim
func (USDXMintingClaims) Validate ¶
func (cs USDXMintingClaims) Validate() error
Validate checks if all the claims are valid and there are no duplicated entries.