types

package
v0.15.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 18 Imported by: 3

Documentation ¶

Index ¶

Constants ¶

View Source
const (
	USDXMintingClaimType           = "usdx_minting"
	HardLiquidityProviderClaimType = "hard_liquidity_provider"
	DelegatorClaimType             = "delegator_claim"
	SwapClaimType                  = "swap"
)
View Source
const (
	EventTypeClaim             = "claim_reward"
	EventTypeRewardPeriod      = "new_reward_period"
	EventTypeClaimPeriod       = "new_claim_period"
	EventTypeClaimPeriodExpiry = "claim_period_expiry"

	AttributeValueCategory   = ModuleName
	AttributeKeyClaimedBy    = "claimed_by"
	AttributeKeyClaimAmount  = "claim_amount"
	AttributeKeyClaimType    = "claim_type"
	AttributeKeyRewardPeriod = "reward_period"
	AttributeKeyClaimPeriod  = "claim_period"
)

Events emitted by the incentive module

View Source
const (
	// ModuleName The name that will be used throughout the module
	ModuleName = "incentive"

	// StoreKey Top level store key where all module items will be stored
	StoreKey = ModuleName

	// RouterKey Top level router key
	RouterKey = ModuleName

	// DefaultParamspace default name for parameter store
	DefaultParamspace = ModuleName

	// QuerierRoute route used for abci queries
	QuerierRoute = ModuleName
)
View Source
const (
	QueryGetHardRewards        = "hard-rewards"
	QueryGetUSDXMintingRewards = "usdx-minting-rewards"
	QueryGetDelegatorRewards   = "delegator-rewards"
	QueryGetSwapRewards        = "swap-rewards"
	QueryGetRewardFactors      = "reward-factors"
	QueryGetParams             = "parameters"

	RestClaimCollateralType = "collateral_type"
	RestClaimOwner          = "owner"
	RestClaimType           = "type"
	RestUnsynced            = "unsynced"
)

Querier routes for the incentive module

View Source
const MaxDenomsToClaim = 1000

Variables ¶

View Source
var (
	ErrClaimNotFound                 = sdkerrors.Register(ModuleName, 2, "no claimable rewards found for user")
	ErrRewardPeriodNotFound          = sdkerrors.Register(ModuleName, 3, "no reward period found for collateral type")
	ErrInvalidAccountType            = sdkerrors.Register(ModuleName, 4, "account type not supported")
	ErrNoClaimsFound                 = sdkerrors.Register(ModuleName, 5, "no claimable rewards found")
	ErrInsufficientModAccountBalance = sdkerrors.Register(ModuleName, 6, "module account has insufficient balance to pay claim")
	ErrAccountNotFound               = sdkerrors.Register(ModuleName, 7, "account not found")
	ErrInvalidMultiplier             = sdkerrors.Register(ModuleName, 8, "invalid rewards multiplier")
	ErrZeroClaim                     = sdkerrors.Register(ModuleName, 9, "cannot claim - claim amount rounds to zero")
	ErrClaimExpired                  = sdkerrors.Register(ModuleName, 10, "claim has expired")
	ErrInvalidClaimType              = sdkerrors.Register(ModuleName, 11, "invalid claim type")
	ErrInvalidClaimOwner             = sdkerrors.Register(ModuleName, 12, "invalid claim owner")
	ErrDecreasingRewardFactor        = sdkerrors.Register(ModuleName, 13, "found new reward factor less than an old reward factor")
	ErrInvalidClaimDenoms            = sdkerrors.Register(ModuleName, 14, "invalid claim denoms")
)

Incentive module errors

View Source
var (
	DefaultUSDXClaims         = USDXMintingClaims{}
	DefaultHardClaims         = HardLiquidityProviderClaims{}
	DefaultDelegatorClaims    = DelegatorClaims{}
	DefaultSwapClaims         = SwapClaims{}
	DefaultGenesisRewardState = NewGenesisRewardState(
		AccumulationTimes{},
		MultiRewardIndexes{},
	)
)
View Source
var (
	USDXMintingClaimKeyPrefix                     = []byte{0x01} // prefix for keys that store USDX minting claims
	USDXMintingRewardFactorKeyPrefix              = []byte{0x02} // prefix for key that stores USDX minting reward factors
	PreviousUSDXMintingRewardAccrualTimeKeyPrefix = []byte{0x03} // prefix for key that stores the blocktime
	HardLiquidityClaimKeyPrefix                   = []byte{0x04} // prefix for keys that store Hard liquidity claims
	HardSupplyRewardIndexesKeyPrefix              = []byte{0x05} // prefix for key that stores Hard supply reward indexes
	PreviousHardSupplyRewardAccrualTimeKeyPrefix  = []byte{0x06} // prefix for key that stores the previous time Hard supply rewards accrued
	HardBorrowRewardIndexesKeyPrefix              = []byte{0x07} // prefix for key that stores Hard borrow reward indexes
	PreviousHardBorrowRewardAccrualTimeKeyPrefix  = []byte{0x08} // prefix for key that stores the previous time Hard borrow rewards accrued
	DelegatorClaimKeyPrefix                       = []byte{0x09} // prefix for keys that store delegator claims
	DelegatorRewardIndexesKeyPrefix               = []byte{0x10} // prefix for key that stores delegator reward indexes
	PreviousDelegatorRewardAccrualTimeKeyPrefix   = []byte{0x11} // prefix for key that stores the previous time delegator rewards accrued
	SwapClaimKeyPrefix                            = []byte{0x12} // prefix for keys that store swap claims
	SwapRewardIndexesKeyPrefix                    = []byte{0x13} // prefix for key that stores swap reward indexes
	PreviousSwapRewardAccrualTimeKeyPrefix        = []byte{0x14} // prefix for key that stores the previous time swap rewards accrued
)

Key Prefixes

View Source
var (
	KeyUSDXMintingRewardPeriods = []byte("USDXMintingRewardPeriods")
	KeyHardSupplyRewardPeriods  = []byte("HardSupplyRewardPeriods")
	KeyHardBorrowRewardPeriods  = []byte("HardBorrowRewardPeriods")
	KeyDelegatorRewardPeriods   = []byte("DelegatorRewardPeriods")
	KeySwapRewardPeriods        = []byte("SwapRewardPeriods")
	KeyClaimEnd                 = []byte("ClaimEnd")
	KeyMultipliers              = []byte("ClaimMultipliers")

	DefaultActive             = false
	DefaultRewardPeriods      = RewardPeriods{}
	DefaultMultiRewardPeriods = MultiRewardPeriods{}
	DefaultMultipliers        = Multipliers{}
	DefaultClaimEnd           = tmtime.Canonical(time.Unix(1, 0))

	BondDenom              = "ukava"
	USDXMintingRewardDenom = "ukava"

	IncentiveMacc = kavadistTypes.ModuleName
)

Parameter keys and default values

View Source
var ModuleCdc *codec.Codec

ModuleCdc generic sealed codec to be used throughout module

Functions ¶

func FilterCoins ¶

func FilterCoins(coins sdk.Coins, denoms []string) sdk.Coins

FilterCoins returns a subset of the coins by denom. Specifying no denoms will return the original coins.

func GetTotalVestingPeriodLength ¶

func GetTotalVestingPeriodLength(periods vesting.Periods) int64

GetTotalVestingPeriodLength returns the summed length of all vesting periods

func MultiplyCoins ¶

func MultiplyCoins(coins sdk.Coins, multiple sdk.Dec) sdk.Coins

MultiplyCoins multiplies each value in a set of coins by a single decimal value, rounding the result.

func NewPeriod ¶

func NewPeriod(amount sdk.Coins, length int64) vesting.Period

NewPeriod returns a new vesting period

func ParamKeyTable ¶

func ParamKeyTable() params.KeyTable

ParamKeyTable Key declaration for parameters

func RegisterCodec ¶

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the necessary types for incentive module

Types ¶

type AccountKeeper ¶

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account
	SetAccount(ctx sdk.Context, acc authexported.Account)
}

AccountKeeper defines the expected keeper interface for interacting with account

type AccumulationTime ¶ added in v0.15.0

type AccumulationTime struct {
	CollateralType           string    `json:"collateral_type" yaml:"collateral_type"`
	PreviousAccumulationTime time.Time `json:"previous_accumulation_time" yaml:"previous_accumulation_time"`
}

AccumulationTime stores the previous reward distribution time and its corresponding collateral type

func NewAccumulationTime ¶ added in v0.15.0

func NewAccumulationTime(ctype string, prevTime time.Time) AccumulationTime

NewAccumulationTime returns a new GenesisAccumulationTime

func (AccumulationTime) Validate ¶ added in v0.15.0

func (gat AccumulationTime) Validate() error

Validate performs validation of GenesisAccumulationTime

type AccumulationTimes ¶ added in v0.15.0

type AccumulationTimes []AccumulationTime

AccumulationTimes slice of GenesisAccumulationTime

func (AccumulationTimes) Validate ¶ added in v0.15.0

func (gats AccumulationTimes) Validate() error

Validate performs validation of GenesisAccumulationTimes

type Accumulator ¶ added in v0.15.0

type Accumulator struct {
	PreviousAccumulationTime time.Time
	Indexes                  RewardIndexes
}

An Accumulator handles calculating and tracking global reward distributions.

func NewAccumulator ¶ added in v0.15.0

func NewAccumulator(previousAccrual time.Time, indexes RewardIndexes) *Accumulator

func (*Accumulator) Accumulate ¶ added in v0.15.0

func (acc *Accumulator) Accumulate(period MultiRewardPeriod, totalSourceShares sdk.Dec, currentTime time.Time)

Accumulate accrues rewards up to the current time.

It calculates new rewards and adds them to the reward indexes for the period from PreviousAccumulationTime to currentTime. It stores the currentTime in PreviousAccumulationTime to be used for later accumulations.

Rewards are not accrued for times outside of the start and end times of a reward period. If a period ends before currentTime, the PreviousAccrualTime is shortened to the end time. This allows accumulate to be called sequentially on consecutive reward periods.

totalSourceShares is the sum of all users' source shares. For example:total btcb supplied to hard, total usdx borrowed from all bnb CDPs, or total shares in a swap pool.

type BaseClaim ¶ added in v0.13.0

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 ¶ added in v0.13.0

func (c BaseClaim) GetOwner() sdk.AccAddress

GetOwner is a getter for Claim Owner

func (BaseClaim) GetReward ¶ added in v0.13.0

func (c BaseClaim) GetReward() sdk.Coin

GetReward is a getter for Claim Reward

func (BaseClaim) GetType ¶ added in v0.13.0

func (c BaseClaim) GetType() string

GetType returns the claim type, used to identify auctions in event attributes

func (BaseClaim) String ¶ added in v0.13.0

func (c BaseClaim) String() string

String implements fmt.Stringer

func (BaseClaim) Validate ¶ added in v0.13.0

func (c BaseClaim) Validate() error

Validate performs a basic check of a BaseClaim fields

type BaseMultiClaim ¶ added in v0.13.0

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 ¶ added in v0.13.0

func (c BaseMultiClaim) GetOwner() sdk.AccAddress

GetOwner is a getter for Claim Owner

func (BaseMultiClaim) GetReward ¶ added in v0.13.0

func (c BaseMultiClaim) GetReward() sdk.Coins

GetReward is a getter for Claim Reward

func (BaseMultiClaim) GetType ¶ added in v0.13.0

func (c BaseMultiClaim) GetType() string

GetType returns the claim type, used to identify auctions in event attributes

func (BaseMultiClaim) String ¶ added in v0.13.0

func (c BaseMultiClaim) String() string

String implements fmt.Stringer

func (BaseMultiClaim) Validate ¶ added in v0.13.0

func (c BaseMultiClaim) Validate() error

Validate performs a basic check of a BaseClaim fields

type CDPHooks ¶ added in v0.13.0

type CDPHooks interface {
	AfterCDPCreated(ctx sdk.Context, cdp cdptypes.CDP)
	BeforeCDPModified(ctx sdk.Context, cdp cdptypes.CDP)
}

CDPHooks event hooks for other keepers to run code in response to CDP modifications

type CdpKeeper ¶

type CdpKeeper interface {
	GetInterestFactor(ctx sdk.Context, collateralType string) (sdk.Dec, bool)
	GetTotalPrincipal(ctx sdk.Context, collateralType string, principalDenom string) (total sdk.Int)
	GetCdpByOwnerAndCollateralType(ctx sdk.Context, owner sdk.AccAddress, collateralType string) (cdptypes.CDP, bool)
	GetCollateral(ctx sdk.Context, collateralType string) (cdptypes.CollateralParam, bool)
}

CdpKeeper defines the expected cdp keeper for interacting with cdps

type Claim ¶

type Claim interface {
	GetOwner() sdk.AccAddress
	GetReward() sdk.Coin
	GetType() string
}

Claim is an interface for handling common claim actions

type Claims ¶

type Claims []Claim

Claims is a slice of Claim

type DelegatorClaim ¶ added in v0.15.0

type DelegatorClaim struct {
	BaseMultiClaim `json:"base_claim" yaml:"base_claim"`
	RewardIndexes  MultiRewardIndexes `json:"reward_indexes" yaml:"reward_indexes"`
}

DelegatorClaim stores delegation rewards that can be claimed by owner

func NewDelegatorClaim ¶ added in v0.15.0

func NewDelegatorClaim(owner sdk.AccAddress, rewards sdk.Coins, rewardIndexes MultiRewardIndexes) DelegatorClaim

NewDelegatorClaim returns a new DelegatorClaim

func (DelegatorClaim) GetOwner ¶ added in v0.15.0

func (c DelegatorClaim) GetOwner() sdk.AccAddress

GetOwner returns the claim's owner

func (DelegatorClaim) GetReward ¶ added in v0.15.0

func (c DelegatorClaim) GetReward() sdk.Coins

GetReward returns the claim's reward coin

func (DelegatorClaim) GetType ¶ added in v0.15.0

func (c DelegatorClaim) GetType() string

GetType returns the claim's type

func (DelegatorClaim) HasRewardIndex ¶ added in v0.15.0

func (c DelegatorClaim) HasRewardIndex(collateralType string) (int64, bool)

HasRewardIndex checks if a DelegatorClaim has a reward index for the input collateral type

func (DelegatorClaim) String ¶ added in v0.15.0

func (c DelegatorClaim) String() string

String implements fmt.Stringer

func (DelegatorClaim) Validate ¶ added in v0.15.0

func (c DelegatorClaim) Validate() error

Validate performs a basic check of a DelegatorClaim fields

type DelegatorClaims ¶ added in v0.15.0

type DelegatorClaims []DelegatorClaim

DelegatorClaim slice of DelegatorClaim

func (DelegatorClaims) Validate ¶ added in v0.15.0

func (cs DelegatorClaims) Validate() error

Validate checks if all the claims are valid and there are no duplicated entries.

type GenesisRewardState ¶ added in v0.15.0

type GenesisRewardState struct {
	AccumulationTimes  AccumulationTimes  `json:"accumulation_times" yaml:"accumulation_times"`
	MultiRewardIndexes MultiRewardIndexes `json:"multi_reward_indexes" yaml:"multi_reward_indexes"`
}

GenesisRewardState groups together the global state for a particular reward so it can be exported in genesis.

func NewGenesisRewardState ¶ added in v0.15.0

func NewGenesisRewardState(accumTimes AccumulationTimes, indexes MultiRewardIndexes) GenesisRewardState

NewGenesisRewardState returns a new GenesisRewardState

func (GenesisRewardState) Validate ¶ added in v0.15.0

func (grs GenesisRewardState) Validate() error

Validate performs validation of a GenesisRewardState

type GenesisState ¶

type GenesisState struct {
	Params Params `json:"params" yaml:"params"`

	USDXRewardState       GenesisRewardState `json:"usdx_reward_state" yaml:"usdx_reward_state"`
	HardSupplyRewardState GenesisRewardState `json:"hard_supply_reward_state" yaml:"hard_supply_reward_state"`
	HardBorrowRewardState GenesisRewardState `json:"hard_borrow_reward_state" yaml:"hard_borrow_reward_state"`
	DelegatorRewardState  GenesisRewardState `json:"delegator_reward_state" yaml:"delegator_reward_state"`
	SwapRewardState       GenesisRewardState `json:"swap_reward_state" yaml:"swap_reward_state"`

	USDXMintingClaims           USDXMintingClaims           `json:"usdx_minting_claims" yaml:"usdx_minting_claims"`
	HardLiquidityProviderClaims HardLiquidityProviderClaims `json:"hard_liquidity_provider_claims" yaml:"hard_liquidity_provider_claims"`
	DelegatorClaims             DelegatorClaims             `json:"delegator_claims" yaml:"delegator_claims"`
	SwapClaims                  SwapClaims                  `json:"swap_claims" yaml:"swap_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,
	usdxState, hardSupplyState, hardBorrowState, delegatorState, swapState GenesisRewardState,
	c USDXMintingClaims, hc HardLiquidityProviderClaims, dc DelegatorClaims, sc SwapClaims,
) GenesisState

NewGenesisState returns a new genesis state

func (GenesisState) Equal ¶

func (gs GenesisState) Equal(gs2 GenesisState) bool

Equal checks whether two gov GenesisState structs are equivalent

func (GenesisState) IsEmpty ¶

func (gs GenesisState) IsEmpty() bool

IsEmpty returns true if a GenesisState is empty

func (GenesisState) Validate ¶

func (gs GenesisState) Validate() error

Validate performs basic validation of genesis data returning an error for any failed validation criteria.

type HARDHooks ¶ added in v0.13.0

type HARDHooks interface {
	AfterDepositCreated(ctx sdk.Context, deposit hardtypes.Deposit)
	BeforeDepositModified(ctx sdk.Context, deposit hardtypes.Deposit)
	AfterDepositModified(ctx sdk.Context, deposit hardtypes.Deposit)
	AfterBorrowCreated(ctx sdk.Context, borrow hardtypes.Borrow)
	BeforeBorrowModified(ctx sdk.Context, borrow hardtypes.Borrow)
	AfterBorrowModified(ctx sdk.Context, deposit hardtypes.Deposit)
}

HARDHooks event hooks for other keepers to run code in response to HARD modifications

type HardKeeper ¶ added in v0.13.0

type HardKeeper interface {
	GetDeposit(ctx sdk.Context, depositor sdk.AccAddress) (hardtypes.Deposit, bool)
	GetBorrow(ctx sdk.Context, borrower sdk.AccAddress) (hardtypes.Borrow, bool)
	GetSupplyInterestFactor(ctx sdk.Context, denom string) (sdk.Dec, bool)
	GetBorrowInterestFactor(ctx sdk.Context, denom string) (sdk.Dec, bool)
	GetBorrowedCoins(ctx sdk.Context) (coins sdk.Coins, found bool)
	GetSuppliedCoins(ctx sdk.Context) (coins sdk.Coins, found bool)
}

HardKeeper defines the expected hard keeper for interacting with Hard protocol

type HardLiquidityProviderClaim ¶ added in v0.13.0

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"`
}

HardLiquidityProviderClaim stores the hard liquidity provider rewards that can be claimed by owner

func NewHardLiquidityProviderClaim ¶ added in v0.13.0

func NewHardLiquidityProviderClaim(owner sdk.AccAddress, rewards sdk.Coins,
	supplyRewardIndexes, borrowRewardIndexes MultiRewardIndexes) HardLiquidityProviderClaim

NewHardLiquidityProviderClaim returns a new HardLiquidityProviderClaim

func (HardLiquidityProviderClaim) GetOwner ¶ added in v0.13.0

GetOwner returns the claim's owner

func (HardLiquidityProviderClaim) GetReward ¶ added in v0.13.0

func (c HardLiquidityProviderClaim) GetReward() sdk.Coins

GetReward returns the claim's reward coin

func (HardLiquidityProviderClaim) GetType ¶ added in v0.13.0

func (c HardLiquidityProviderClaim) GetType() string

GetType returns the claim's type

func (HardLiquidityProviderClaim) HasBorrowRewardIndex ¶ added in v0.13.0

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) HasSupplyRewardIndex ¶ added in v0.13.0

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 ¶ added in v0.13.0

String implements fmt.Stringer

func (HardLiquidityProviderClaim) Validate ¶ added in v0.13.0

func (c HardLiquidityProviderClaim) Validate() error

Validate performs a basic check of a HardLiquidityProviderClaim fields

type HardLiquidityProviderClaims ¶ added in v0.13.0

type HardLiquidityProviderClaims []HardLiquidityProviderClaim

HardLiquidityProviderClaims slice of HardLiquidityProviderClaim

func (HardLiquidityProviderClaims) Validate ¶ added in v0.13.0

func (cs HardLiquidityProviderClaims) Validate() error

Validate checks if all the claims are valid and there are no duplicated entries.

type MsgClaimDelegatorReward ¶ added in v0.15.0

type MsgClaimDelegatorReward struct {
	Sender         sdk.AccAddress `json:"sender" yaml:"sender"`
	MultiplierName string         `json:"multiplier_name" yaml:"multiplier_name"`
	DenomsToClaim  []string       `json:"denoms_to_claim" yaml:"denoms_to_claim"`
}

MsgClaimDelegatorReward message type used to claim delegator rewards

func NewMsgClaimDelegatorReward ¶ added in v0.15.0

func NewMsgClaimDelegatorReward(sender sdk.AccAddress, multiplierName string, denomsToClaim []string) MsgClaimDelegatorReward

NewMsgClaimDelegatorReward returns a new MsgClaimDelegatorReward.

func (MsgClaimDelegatorReward) GetSignBytes ¶ added in v0.15.0

func (msg MsgClaimDelegatorReward) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgClaimDelegatorReward) GetSigners ¶ added in v0.15.0

func (msg MsgClaimDelegatorReward) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (MsgClaimDelegatorReward) Route ¶ added in v0.15.0

func (msg MsgClaimDelegatorReward) Route() string

Route return the message type used for routing the message.

func (MsgClaimDelegatorReward) Type ¶ added in v0.15.0

func (msg MsgClaimDelegatorReward) Type() string

Type returns a human-readable string for the message, intended for utilization within tags.

func (MsgClaimDelegatorReward) ValidateBasic ¶ added in v0.15.0

func (msg MsgClaimDelegatorReward) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to state.

type MsgClaimDelegatorRewardVVesting ¶ added in v0.15.0

type MsgClaimDelegatorRewardVVesting struct {
	Sender         sdk.AccAddress `json:"sender" yaml:"sender"`
	Receiver       sdk.AccAddress `json:"receiver" yaml:"receiver"`
	MultiplierName string         `json:"multiplier_name" yaml:"multiplier_name"`
	DenomsToClaim  []string       `json:"denoms_to_claim" yaml:"denoms_to_claim"`
}

MsgClaimDelegatorRewardVVesting message type used to claim delegator rewards for validator vesting accounts

func NewMsgClaimDelegatorRewardVVesting ¶ added in v0.15.0

func NewMsgClaimDelegatorRewardVVesting(sender, receiver sdk.AccAddress, multiplierName string, denomsToClaim []string) MsgClaimDelegatorRewardVVesting

MsgClaimDelegatorRewardVVesting returns a new MsgClaimDelegatorRewardVVesting.

func (MsgClaimDelegatorRewardVVesting) GetSignBytes ¶ added in v0.15.0

func (msg MsgClaimDelegatorRewardVVesting) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgClaimDelegatorRewardVVesting) GetSigners ¶ added in v0.15.0

func (msg MsgClaimDelegatorRewardVVesting) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (MsgClaimDelegatorRewardVVesting) Route ¶ added in v0.15.0

Route return the message type used for routing the message.

func (MsgClaimDelegatorRewardVVesting) Type ¶ added in v0.15.0

Type returns a human-readable string for the message, intended for utilization within tags.

func (MsgClaimDelegatorRewardVVesting) ValidateBasic ¶ added in v0.15.0

func (msg MsgClaimDelegatorRewardVVesting) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to state.

type MsgClaimHardReward ¶ added in v0.14.0

type MsgClaimHardReward struct {
	Sender         sdk.AccAddress `json:"sender" yaml:"sender"`
	MultiplierName string         `json:"multiplier_name" yaml:"multiplier_name"`
	DenomsToClaim  []string       `json:"denoms_to_claim" yaml:"denoms_to_claim"`
}

MsgClaimHardReward message type used to claim Hard liquidity provider rewards

func NewMsgClaimHardReward ¶ added in v0.14.0

func NewMsgClaimHardReward(sender sdk.AccAddress, multiplierName string, denomsToClaim []string) MsgClaimHardReward

NewMsgClaimHardReward returns a new MsgClaimHardReward.

func (MsgClaimHardReward) GetSignBytes ¶ added in v0.14.0

func (msg MsgClaimHardReward) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgClaimHardReward) GetSigners ¶ added in v0.14.0

func (msg MsgClaimHardReward) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (MsgClaimHardReward) Route ¶ added in v0.14.0

func (msg MsgClaimHardReward) Route() string

Route return the message type used for routing the message.

func (MsgClaimHardReward) Type ¶ added in v0.14.0

func (msg MsgClaimHardReward) Type() string

Type returns a human-readable string for the message, intended for utilization within tags.

func (MsgClaimHardReward) ValidateBasic ¶ added in v0.14.0

func (msg MsgClaimHardReward) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to state.

type MsgClaimHardRewardVVesting ¶ added in v0.14.2

type MsgClaimHardRewardVVesting struct {
	Sender         sdk.AccAddress `json:"sender" yaml:"sender"`
	Receiver       sdk.AccAddress `json:"receiver" yaml:"receiver"`
	MultiplierName string         `json:"multiplier_name" yaml:"multiplier_name"`
	DenomsToClaim  []string       `json:"denoms_to_claim" yaml:"denoms_to_claim"`
}

MsgClaimHardRewardVVesting message type used to claim Hard liquidity provider rewards for validator vesting accounts

func NewMsgClaimHardRewardVVesting ¶ added in v0.14.2

func NewMsgClaimHardRewardVVesting(sender, receiver sdk.AccAddress, multiplierName string, denomsToClaim []string) MsgClaimHardRewardVVesting

NewMsgClaimHardRewardVVesting returns a new MsgClaimHardRewardVVesting.

func (MsgClaimHardRewardVVesting) GetSignBytes ¶ added in v0.14.2

func (msg MsgClaimHardRewardVVesting) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgClaimHardRewardVVesting) GetSigners ¶ added in v0.14.2

func (msg MsgClaimHardRewardVVesting) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (MsgClaimHardRewardVVesting) Route ¶ added in v0.14.2

func (msg MsgClaimHardRewardVVesting) Route() string

Route return the message type used for routing the message.

func (MsgClaimHardRewardVVesting) Type ¶ added in v0.14.2

Type returns a human-readable string for the message, intended for utilization within tags.

func (MsgClaimHardRewardVVesting) ValidateBasic ¶ added in v0.14.2

func (msg MsgClaimHardRewardVVesting) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to state.

type MsgClaimSwapReward ¶ added in v0.15.0

type MsgClaimSwapReward struct {
	Sender         sdk.AccAddress `json:"sender" yaml:"sender"`
	MultiplierName string         `json:"multiplier_name" yaml:"multiplier_name"`
	DenomsToClaim  []string       `json:"denoms_to_claim" yaml:"denoms_to_claim"`
}

MsgClaimSwapReward message type used to claim delegator rewards

func NewMsgClaimSwapReward ¶ added in v0.15.0

func NewMsgClaimSwapReward(sender sdk.AccAddress, multiplierName string, denomsToClaim []string) MsgClaimSwapReward

NewMsgClaimSwapReward returns a new MsgClaimSwapReward.

func (MsgClaimSwapReward) GetSignBytes ¶ added in v0.15.0

func (msg MsgClaimSwapReward) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgClaimSwapReward) GetSigners ¶ added in v0.15.0

func (msg MsgClaimSwapReward) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (MsgClaimSwapReward) Route ¶ added in v0.15.0

func (msg MsgClaimSwapReward) Route() string

Route return the message type used for routing the message.

func (MsgClaimSwapReward) Type ¶ added in v0.15.0

func (msg MsgClaimSwapReward) Type() string

Type returns a human-readable string for the message, intended for utilization within tags.

func (MsgClaimSwapReward) ValidateBasic ¶ added in v0.15.0

func (msg MsgClaimSwapReward) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to state.

type MsgClaimSwapRewardVVesting ¶ added in v0.15.0

type MsgClaimSwapRewardVVesting struct {
	Sender         sdk.AccAddress `json:"sender" yaml:"sender"`
	Receiver       sdk.AccAddress `json:"receiver" yaml:"receiver"`
	MultiplierName string         `json:"multiplier_name" yaml:"multiplier_name"`
	DenomsToClaim  []string       `json:"denoms_to_claim" yaml:"denoms_to_claim"`
}

MsgClaimSwapRewardVVesting message type used to claim delegator rewards for validator vesting accounts

func NewMsgClaimSwapRewardVVesting ¶ added in v0.15.0

func NewMsgClaimSwapRewardVVesting(sender, receiver sdk.AccAddress, multiplierName string, denomsToClaim []string) MsgClaimSwapRewardVVesting

MsgClaimSwapRewardVVesting returns a new MsgClaimSwapRewardVVesting.

func (MsgClaimSwapRewardVVesting) GetSignBytes ¶ added in v0.15.0

func (msg MsgClaimSwapRewardVVesting) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgClaimSwapRewardVVesting) GetSigners ¶ added in v0.15.0

func (msg MsgClaimSwapRewardVVesting) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (MsgClaimSwapRewardVVesting) Route ¶ added in v0.15.0

func (msg MsgClaimSwapRewardVVesting) Route() string

Route return the message type used for routing the message.

func (MsgClaimSwapRewardVVesting) Type ¶ added in v0.15.0

Type returns a human-readable string for the message, intended for utilization within tags.

func (MsgClaimSwapRewardVVesting) ValidateBasic ¶ added in v0.15.0

func (msg MsgClaimSwapRewardVVesting) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to state.

type MsgClaimUSDXMintingReward ¶ added in v0.13.0

type MsgClaimUSDXMintingReward struct {
	Sender         sdk.AccAddress `json:"sender" yaml:"sender"`
	MultiplierName string         `json:"multiplier_name" yaml:"multiplier_name"`
}

MsgClaimUSDXMintingReward message type used to claim USDX minting rewards

func NewMsgClaimUSDXMintingReward ¶ added in v0.13.0

func NewMsgClaimUSDXMintingReward(sender sdk.AccAddress, multiplierName string) MsgClaimUSDXMintingReward

NewMsgClaimUSDXMintingReward returns a new MsgClaimUSDXMintingReward.

func (MsgClaimUSDXMintingReward) GetSignBytes ¶ added in v0.13.0

func (msg MsgClaimUSDXMintingReward) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgClaimUSDXMintingReward) GetSigners ¶ added in v0.13.0

func (msg MsgClaimUSDXMintingReward) GetSigners() []sdk.AccAddress

GetSigners returns the addresses of signers that must sign.

func (MsgClaimUSDXMintingReward) Route ¶ added in v0.13.0

func (msg MsgClaimUSDXMintingReward) Route() string

Route return the message type used for routing the message.

func (MsgClaimUSDXMintingReward) Type ¶ added in v0.13.0

func (msg MsgClaimUSDXMintingReward) Type() string

Type returns a human-readable string for the message, intended for utilization within tags.

func (MsgClaimUSDXMintingReward) ValidateBasic ¶ added in v0.13.0

func (msg MsgClaimUSDXMintingReward) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to state.

type MsgClaimUSDXMintingRewardVVesting ¶ added in v0.14.2

type MsgClaimUSDXMintingRewardVVesting struct {
	Sender         sdk.AccAddress `json:"sender" yaml:"sender"`
	Receiver       sdk.AccAddress `json:"receiver" yaml:"receiver"`
	MultiplierName string         `json:"multiplier_name" yaml:"multiplier_name"`
}

MsgClaimUSDXMintingRewardVVesting message type used to claim USDX minting rewards for validator vesting accounts

func NewMsgClaimUSDXMintingRewardVVesting ¶ added in v0.14.2

func NewMsgClaimUSDXMintingRewardVVesting(sender, receiver sdk.AccAddress, multiplierName string) MsgClaimUSDXMintingRewardVVesting

NewMsgClaimUSDXMintingRewardVVesting returns a new MsgClaimUSDXMintingReward.

func (MsgClaimUSDXMintingRewardVVesting) GetSignBytes ¶ added in v0.14.2

func (msg MsgClaimUSDXMintingRewardVVesting) GetSignBytes() []byte

GetSignBytes gets the canonical byte representation of the Msg.

func (MsgClaimUSDXMintingRewardVVesting) GetSigners ¶ added in v0.14.2

GetSigners returns the addresses of signers that must sign.

func (MsgClaimUSDXMintingRewardVVesting) Route ¶ added in v0.14.2

Route return the message type used for routing the message.

func (MsgClaimUSDXMintingRewardVVesting) Type ¶ added in v0.14.2

Type returns a human-readable string for the message, intended for utilization within tags.

func (MsgClaimUSDXMintingRewardVVesting) ValidateBasic ¶ added in v0.14.2

func (msg MsgClaimUSDXMintingRewardVVesting) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to state.

type MultiRewardIndex ¶ added in v0.13.0

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 ¶ added in v0.13.0

func NewMultiRewardIndex(collateralType string, indexes RewardIndexes) MultiRewardIndex

NewMultiRewardIndex returns a new MultiRewardIndex

func (MultiRewardIndex) GetFactorIndex ¶ added in v0.13.0

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 ¶ added in v0.13.0

func (mri MultiRewardIndex) String() string

func (MultiRewardIndex) Validate ¶ added in v0.13.0

func (mri MultiRewardIndex) Validate() error

Validate validates multi-reward index

type MultiRewardIndexes ¶ added in v0.13.0

type MultiRewardIndexes []MultiRewardIndex

MultiRewardIndexes slice of MultiRewardIndex

func (MultiRewardIndexes) Get ¶ added in v0.15.0

func (mris MultiRewardIndexes) Get(denom string) (RewardIndexes, bool)

Get fetches a RewardIndexes by it's denom

func (MultiRewardIndexes) GetCollateralTypes ¶ added in v0.14.0

func (mris MultiRewardIndexes) GetCollateralTypes() []string

GetCollateralTypes returns a slice of containing all collateral types

func (MultiRewardIndexes) GetRewardIndex ¶ added in v0.13.0

func (mris MultiRewardIndexes) GetRewardIndex(denom string) (MultiRewardIndex, bool)

GetRewardIndex fetches a RewardIndex from a MultiRewardIndex by its denom

func (MultiRewardIndexes) GetRewardIndexIndex ¶ added in v0.13.0

func (mris MultiRewardIndexes) GetRewardIndexIndex(denom string) (int, bool)

GetRewardIndexIndex fetches a specific reward index inside the array by its denom

func (MultiRewardIndexes) RemoveRewardIndex ¶ added in v0.14.0

func (mris MultiRewardIndexes) RemoveRewardIndex(denom string) MultiRewardIndexes

RemoveRewardIndex removes a denom's reward interest factor value

func (MultiRewardIndexes) Validate ¶ added in v0.13.0

func (mris MultiRewardIndexes) Validate() error

Validate validation for reward indexes

func (MultiRewardIndexes) With ¶ added in v0.15.0

func (mris MultiRewardIndexes) With(denom string, indexes RewardIndexes) MultiRewardIndexes

With returns a copy of the indexes with a new RewardIndexes added

type MultiRewardPeriod ¶ added in v0.13.0

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 ¶ added in v0.13.0

func NewMultiRewardPeriod(active bool, collateralType string, start time.Time, end time.Time, reward sdk.Coins) MultiRewardPeriod

NewMultiRewardPeriod returns a new MultiRewardPeriod

func NewMultiRewardPeriodFromRewardPeriod ¶ added in v0.15.0

func NewMultiRewardPeriodFromRewardPeriod(period RewardPeriod) MultiRewardPeriod

NewMultiRewardPeriodFromRewardPeriod converts a RewardPeriod into a MultiRewardPeriod. It's useful for compatibility between single and multi denom rewards.

func (MultiRewardPeriod) String ¶ added in v0.13.0

func (mrp MultiRewardPeriod) String() string

String implements fmt.Stringer

func (MultiRewardPeriod) Validate ¶ added in v0.13.0

func (mrp MultiRewardPeriod) Validate() error

Validate performs a basic check of a MultiRewardPeriod.

type MultiRewardPeriods ¶ added in v0.13.0

type MultiRewardPeriods []MultiRewardPeriod

MultiRewardPeriods array of MultiRewardPeriod

func (MultiRewardPeriods) GetMultiRewardPeriod ¶ added in v0.13.0

func (mrps MultiRewardPeriods) GetMultiRewardPeriod(denom string) (MultiRewardPeriod, bool)

GetMultiRewardPeriod fetches a MultiRewardPeriod from an array of MultiRewardPeriods by its denom

func (MultiRewardPeriods) GetMultiRewardPeriodIndex ¶ added in v0.13.0

func (mrps MultiRewardPeriods) GetMultiRewardPeriodIndex(denom string) (int, bool)

GetMultiRewardPeriodIndex returns the index of a MultiRewardPeriod inside array MultiRewardPeriods

func (MultiRewardPeriods) Validate ¶ added in v0.13.0

func (mrps MultiRewardPeriods) Validate() error

Validate checks if all the RewardPeriods are valid and there are no duplicated entries.

type Multiplier ¶ added in v0.11.0

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 ¶ added in v0.11.0

func NewMultiplier(name MultiplierName, lockup int64, factor sdk.Dec) Multiplier

NewMultiplier returns a new Multiplier

func (Multiplier) String ¶ added in v0.11.0

func (m Multiplier) String() string

String implements fmt.Stringer

func (Multiplier) Validate ¶ added in v0.11.0

func (m Multiplier) Validate() error

Validate multiplier param

type MultiplierName ¶ added in v0.11.0

type MultiplierName string

MultiplierName name for valid multiplier

const (
	Small  MultiplierName = "small"
	Medium MultiplierName = "medium"
	Large  MultiplierName = "large"
)

Valid reward multipliers

func (MultiplierName) IsValid ¶ added in v0.11.0

func (mn MultiplierName) IsValid() error

IsValid checks if the input is one of the expected strings

type Multipliers ¶ added in v0.11.0

type Multipliers []Multiplier

Multipliers slice of Multiplier

func (Multipliers) String ¶ added in v0.11.0

func (ms Multipliers) String() string

String implements fmt.Stringer

func (Multipliers) Validate ¶ added in v0.11.0

func (ms Multipliers) Validate() error

Validate validates each multiplier

type ParamSubspace ¶ added in v0.15.0

type ParamSubspace interface {
	GetParamSet(sdk.Context, params.ParamSet)
	SetParamSet(sdk.Context, params.ParamSet)
	WithKeyTable(params.KeyTable) params.Subspace
	HasKeyTable() bool
}

ParamSubspace defines the expected Subspace interfacace

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"`
	DelegatorRewardPeriods   MultiRewardPeriods `json:"delegator_reward_periods" yaml:"delegator_reward_periods"`
	SwapRewardPeriods        MultiRewardPeriods `json:"swap_reward_periods" yaml:"swap_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, delegator, swap MultiRewardPeriods,
	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

func (Params) String ¶

func (p Params) String() string

String implements fmt.Stringer

func (Params) Validate ¶

func (p Params) Validate() error

Validate checks that the parameters have valid values.

type QueryGetRewardFactorsResponse ¶ added in v0.15.0

type QueryGetRewardFactorsResponse struct {
	USDXMintingRewardFactors RewardIndexes      `json:"usdx_minting_reward_factors" yaml:"usdx_minting_reward_factors"`
	HardSupplyRewardFactors  MultiRewardIndexes `json:"hard_supply_reward_factors" yaml:"hard_supply_reward_factors"`
	HardBorrowRewardFactors  MultiRewardIndexes `json:"hard_borrow_reward_factors" yaml:"hard_borrow_reward_factors"`
	DelegatorRewardFactors   MultiRewardIndexes `json:"delegator_reward_factors" yaml:"delegator_reward_factors"`
	SwapRewardFactors        MultiRewardIndexes `json:"swap_reward_factors" yaml:"swap_reward_factors"`
}

QueryGetRewardFactorsResponse holds the response to a reward factor query

func NewQueryGetRewardFactorsResponse ¶ added in v0.15.0

func NewQueryGetRewardFactorsResponse(usdxMintingFactors RewardIndexes, supplyFactors,
	hardBorrowFactors, delegatorFactors, swapFactors MultiRewardIndexes) QueryGetRewardFactorsResponse

NewQueryGetRewardFactorsResponse returns a new instance of QueryAllRewardFactorsResponse

type QueryRewardsParams ¶ added in v0.13.0

type QueryRewardsParams struct {
	Page           int            `json:"page" yaml:"page"`
	Limit          int            `json:"limit" yaml:"limit"`
	Owner          sdk.AccAddress `json:"owner" yaml:"owner"`
	Unsynchronized bool           `json:"unsynchronized" yaml:"unsynchronized"`
}

QueryRewardsParams params for query /incentive/rewards/<claim type>

func NewQueryRewardsParams ¶ added in v0.13.0

func NewQueryRewardsParams(page, limit int, owner sdk.AccAddress, unsynchronized bool) QueryRewardsParams

NewQueryRewardsParams returns QueryRewardsParams

type RewardIndex ¶ added in v0.13.0

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 ¶ added in v0.13.0

func NewRewardIndex(collateralType string, factor sdk.Dec) RewardIndex

NewRewardIndex returns a new RewardIndex

func (RewardIndex) String ¶ added in v0.13.0

func (ri RewardIndex) String() string

func (RewardIndex) Validate ¶ added in v0.13.0

func (ri RewardIndex) Validate() error

Validate validates reward index

type RewardIndexes ¶ added in v0.13.0

type RewardIndexes []RewardIndex

RewardIndexes slice of RewardIndex

func (RewardIndexes) Add ¶ added in v0.15.0

func (ris RewardIndexes) Add(addend RewardIndexes) RewardIndexes

Add combines two reward indexes by adding together factors with the same CollateralType. Any CollateralTypes unique to either reward indexes are included in the output as is.

func (RewardIndexes) Get ¶ added in v0.15.0

func (ris RewardIndexes) Get(denom string) (sdk.Dec, bool)

Get fetches a RewardFactor by it's denom

func (RewardIndexes) GetFactorIndex ¶ added in v0.13.0

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 ¶ added in v0.13.0

func (ris RewardIndexes) GetRewardIndex(denom string) (RewardIndex, bool)

GetRewardIndex fetches a RewardIndex by its denom

func (RewardIndexes) Mul ¶ added in v0.15.0

func (ris RewardIndexes) Mul(multiplier sdk.Dec) RewardIndexes

Mul returns a copy of RewardIndexes with all factors multiplied by a single value.

func (RewardIndexes) Quo ¶ added in v0.15.0

func (ris RewardIndexes) Quo(divisor sdk.Dec) RewardIndexes

Quo returns a copy of RewardIndexes with all factors divided by a single value. It uses sdk.Dec.Quo for the division.

func (RewardIndexes) Validate ¶ added in v0.13.0

func (ris RewardIndexes) Validate() error

Validate validation for reward indexes

func (RewardIndexes) With ¶ added in v0.15.0

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) String ¶

func (rp RewardPeriod) String() string

String implements fmt.Stringer

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 StakingKeeper ¶ added in v0.13.0

type StakingKeeper interface {
	GetDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress, maxRetrieve uint16) (delegations []stakingtypes.Delegation)
	GetValidatorDelegations(ctx sdk.Context, valAddr sdk.ValAddress) (delegations []stakingtypes.Delegation)
	GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
	TotalBondedTokens(ctx sdk.Context) sdk.Int
}

StakingKeeper defines the expected staking keeper for module accounts

type SupplyKeeper ¶

type SupplyKeeper interface {
	GetModuleAccount(ctx sdk.Context, name string) supplyexported.ModuleAccountI
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
}

SupplyKeeper defines the expected supply keeper for module accounts

type SwapClaim ¶ added in v0.15.0

type SwapClaim struct {
	BaseMultiClaim `json:"base_claim" yaml:"base_claim"`
	RewardIndexes  MultiRewardIndexes `json:"reward_indexes" yaml:"reward_indexes"`
}

SwapClaim stores the swap rewards that can be claimed by owner

func NewSwapClaim ¶ added in v0.15.0

func NewSwapClaim(owner sdk.AccAddress, rewards sdk.Coins, rewardIndexes MultiRewardIndexes) SwapClaim

NewSwapClaim returns a new SwapClaim

func (SwapClaim) GetOwner ¶ added in v0.15.0

func (c SwapClaim) GetOwner() sdk.AccAddress

GetOwner returns the claim's owner

func (SwapClaim) GetReward ¶ added in v0.15.0

func (c SwapClaim) GetReward() sdk.Coins

GetReward returns the claim's reward coin

func (SwapClaim) GetType ¶ added in v0.15.0

func (c SwapClaim) GetType() string

GetType returns the claim's type

func (SwapClaim) HasRewardIndex ¶ added in v0.15.0

func (c SwapClaim) HasRewardIndex(poolID string) (int64, bool)

HasRewardIndex check if a claim has a reward index for the input pool ID.

func (SwapClaim) String ¶ added in v0.15.0

func (c SwapClaim) String() string

String implements fmt.Stringer

func (SwapClaim) Validate ¶ added in v0.15.0

func (c SwapClaim) Validate() error

Validate performs a basic check of a SwapClaim fields

type SwapClaims ¶ added in v0.15.0

type SwapClaims []SwapClaim

SwapClaims slice of SwapClaim

func (SwapClaims) Validate ¶ added in v0.15.0

func (cs SwapClaims) Validate() error

Validate checks if all the claims are valid.

type SwapKeeper ¶ added in v0.15.0

type SwapKeeper interface {
	GetPoolShares(ctx sdk.Context, poolID string) (shares sdk.Int, found bool)
	GetDepositorSharesAmount(ctx sdk.Context, depositor sdk.AccAddress, poolID string) (shares sdk.Int, found bool)
}

SwapKeeper defines the required methods needed by this modules keeper

type USDXMintingClaim ¶ added in v0.13.0

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 ¶ added in v0.13.0

func NewUSDXMintingClaim(owner sdk.AccAddress, reward sdk.Coin, rewardIndexes RewardIndexes) USDXMintingClaim

NewUSDXMintingClaim returns a new USDXMintingClaim

func (USDXMintingClaim) GetOwner ¶ added in v0.13.0

func (c USDXMintingClaim) GetOwner() sdk.AccAddress

GetOwner returns the claim's owner

func (USDXMintingClaim) GetReward ¶ added in v0.13.0

func (c USDXMintingClaim) GetReward() sdk.Coin

GetReward returns the claim's reward coin

func (USDXMintingClaim) GetType ¶ added in v0.13.0

func (c USDXMintingClaim) GetType() string

GetType returns the claim's type

func (USDXMintingClaim) HasRewardIndex ¶ added in v0.13.0

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 ¶ added in v0.13.0

func (c USDXMintingClaim) String() string

String implements fmt.Stringer

func (USDXMintingClaim) Validate ¶ added in v0.13.0

func (c USDXMintingClaim) Validate() error

Validate performs a basic check of a Claim fields

type USDXMintingClaims ¶ added in v0.13.0

type USDXMintingClaims []USDXMintingClaim

USDXMintingClaims slice of USDXMintingClaim

func (USDXMintingClaims) Validate ¶ added in v0.13.0

func (cs USDXMintingClaims) Validate() error

Validate checks if all the claims are valid and there are no duplicated entries.

Jump to

Keyboard shortcuts

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