v0_13

package
v0.13.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Small                          MultiplierName = "small"
	Medium                         MultiplierName = "medium"
	Large                          MultiplierName = "large"
	USDXMintingClaimType                          = "usdx_minting"
	HardLiquidityProviderClaimType                = "hard_liquidity_provider"
	BondDenom                                     = "ukava"
)

Valid reward multipliers

Variables

View Source
var (
	KeyUSDXMintingRewardPeriods     = []byte("USDXMintingRewardPeriods")
	KeyHardSupplyRewardPeriods      = []byte("HardSupplyRewardPeriods")
	KeyHardBorrowRewardPeriods      = []byte("HardBorrowRewardPeriods")
	KeyHardDelegatorRewardPeriods   = []byte("HardDelegatorRewardPeriods")
	KeyClaimEnd                     = []byte("ClaimEnd")
	KeyMultipliers                  = []byte("ClaimMultipliers")
	DefaultActive                   = false
	DefaultRewardPeriods            = RewardPeriods{}
	DefaultMultipliers              = Multipliers{}
	DefaultUSDXClaims               = USDXMintingClaims{}
	DefaultHardClaims               = HardLiquidityProviderClaims{}
	DefaultGenesisAccumulationTimes = GenesisAccumulationTimes{}
	DefaultClaimEnd                 = tmtime.Canonical(time.Unix(0, 0))
	GovDenom                        = cdptypes.DefaultGovDenom
	PrincipalDenom                  = "usdx"
	IncentiveMacc                   = kavadistTypes.ModuleName
)

Parameter keys and default values

Functions

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable Key declaration for parameters

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

func (BaseClaim) GetReward

func (c BaseClaim) GetReward() sdk.Coin

GetReward is a getter for Claim Reward

func (BaseClaim) GetType

func (c BaseClaim) GetType() string

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

func (BaseClaim) String

func (c BaseClaim) String() string

String implements fmt.Stringer

func (BaseClaim) Validate

func (c BaseClaim) 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 Claims

type Claims []Claim

Claims is a slice of Claim

type GenesisAccumulationTime

type GenesisAccumulationTime struct {
	CollateralType           string    `json:"collateral_type" yaml:"collateral_type"`
	PreviousAccumulationTime time.Time `json:"previous_accumulation_time" yaml:"previous_accumulation_time"`
	RewardFactor             sdk.Dec   `json:"reward_factor" yaml:"reward_factor"`
}

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

func NewGenesisAccumulationTime

func NewGenesisAccumulationTime(ctype string, prevTime time.Time, factor sdk.Dec) 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 GenesisState

type GenesisState struct {
	Params                         Params                      `json:"params" yaml:"params"`
	USDXAccumulationTimes          GenesisAccumulationTimes    `json:"usdx_accumulation_times" yaml:"usdx_accumulation_times"`
	HardSupplyAccumulationTimes    GenesisAccumulationTimes    `json:"hard_supply_accumulation_times" yaml:"hard_supply_accumulation_times"`
	HardBorrowAccumulationTimes    GenesisAccumulationTimes    `json:"hard_borrow_accumulation_times" yaml:"hard_borrow_accumulation_times"`
	HardDelegatorAccumulationTimes GenesisAccumulationTimes    `json:"hard_delegator_accumulation_times" yaml:"hard_delegator_accumulation_times"`
	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, c USDXMintingClaims) 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 {
	BaseClaim              `json:"base_claim" yaml:"base_claim"`
	SupplyRewardIndexes    RewardIndexes `json:"supply_reward_indexes" yaml:"supply_reward_indexes"`
	BorrowRewardIndexes    RewardIndexes `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, reward sdk.Coin, supplyRewardIndexes,
	borrowRewardIndexes, delegatorRewardIndexes RewardIndexes) HardLiquidityProviderClaim

NewHardLiquidityProviderClaim returns a new HardLiquidityProviderClaim

func (HardLiquidityProviderClaim) GetOwner

GetOwner returns the claim's owner

func (HardLiquidityProviderClaim) GetReward

func (c HardLiquidityProviderClaim) GetReward() sdk.Coin

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

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 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

func (Multiplier) String

func (m Multiplier) String() string

String implements fmt.Stringer

func (Multiplier) Validate

func (m Multiplier) Validate() error

Validate multiplier param

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

func (ms Multipliers) String() string

String implements fmt.Stringer

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    RewardPeriods `json:"hard_supply_reward_periods" yaml:"hard_supply_reward_periods"`
	HardBorrowRewardPeriods    RewardPeriods `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, hardSupply, hardBorrow, 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

func (Params) Validate

func (p Params) Validate() error

Validate checks that the parameters have valid values.

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) Validate

func (ris RewardIndexes) Validate() error

Validate validation for reward indexes

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 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.

Jump to

Keyboard shortcuts

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