Documentation ¶
Index ¶
- Constants
- Variables
- func EndBlocker(ctx sdk.Context, k Keeper) (resTags sdk.Tags)
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
- func MRL(ctx sdk.Context, k Keeper, epoch sdk.Int) sdk.Dec
- func MiningRewardForEpoch(ctx sdk.Context, k Keeper, epoch sdk.Int) sdk.Dec
- func NewQuerier(keeper Keeper) sdk.Querier
- func RegisterCodec(cdc *codec.Codec)
- func RollingAverageIndicator(ctx sdk.Context, k Keeper, epochs sdk.Int, ...) sdk.Dec
- func SRL(ctx sdk.Context, k Keeper, epoch sdk.Int) sdk.Dec
- func SeigniorageRewardsForEpoch(ctx sdk.Context, k Keeper, epoch sdk.Int) sdk.Dec
- func SumIndicator(ctx sdk.Context, k Keeper, epochs sdk.Int, ...) sdk.Dec
- func TRL(ctx sdk.Context, k Keeper, epoch sdk.Int) sdk.Dec
- func TaxRewardsForEpoch(ctx sdk.Context, k Keeper, epoch sdk.Int) sdk.Dec
- func UnitLunaIndicator(ctx sdk.Context, k Keeper, epoch sdk.Int, ...) sdk.Dec
- func ValidateGenesis(data GenesisState) error
- type GenesisState
- type Keeper
- func (k Keeper) AddClaim(ctx sdk.Context, claim types.Claim)
- func (k Keeper) GetParams(ctx sdk.Context) Params
- func (k Keeper) GetRewardWeight(ctx sdk.Context, epoch sdk.Int) (rewardWeight sdk.Dec)
- func (k Keeper) GetTaxCap(ctx sdk.Context, denom string) (taxCap sdk.Int)
- func (k Keeper) GetTaxRate(ctx sdk.Context, epoch sdk.Int) (rate sdk.Dec)
- func (k Keeper) IterateClaims(ctx sdk.Context, handler func(types.Claim) (stop bool))
- func (k Keeper) PeekTaxProceeds(ctx sdk.Context, epoch sdk.Int) (res sdk.Coins)
- func (k Keeper) RecordTaxProceeds(ctx sdk.Context, delta sdk.Coins)
- func (k Keeper) SetParams(ctx sdk.Context, params Params)
- func (k Keeper) SetRewardWeight(ctx sdk.Context, weight sdk.Dec)
- func (k Keeper) SetTaxRate(ctx sdk.Context, rate sdk.Dec)
- type Params
- type PolicyConstraints
Constants ¶
const ( // ModuleName is the name of the treasury module ModuleName = "treasury" // StoreKey is the string store representation StoreKey = ModuleName // RouterKey is the msg router key for the treasury module RouterKey = ModuleName // QuerierRoute is the query router key for the treasury module QuerierRoute = ModuleName // DefaultParamspace is the paramspace representation DefaultParamspace = ModuleName )
const ( QueryTaxRate = "tax-rate" QueryTaxCap = "tax-cap" QueryMiningRewardWeight = "reward-weight" QuerySeigniorageProceeds = "seigniorage-proceeds" QueryActiveClaims = "active-claims" QueryCurrentEpoch = "current-epoch" QueryParams = "params" QueryIssuance = "issuance" QueryTaxProceeds = "tax-proceeds" )
query endpoints supported by the treasury Querier
Variables ¶
var (
PrefixClaim = []byte("claim")
)
nolint
Functions ¶
func EndBlocker ¶ added in v0.0.5
EndBlocker called to adjust macro weights (tax, mining reward) and settle outstanding claims.
func InitGenesis ¶ added in v0.0.5
func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
InitGenesis new treasury genesis
func MiningRewardForEpoch ¶ added in v0.0.7
MiningRewardForEpoch returns the sum of tax and seigniorage rewards for the epoch
func NewQuerier ¶ added in v0.0.5
NewQuerier is the module level router for state queries
func RegisterCodec ¶ added in v0.0.5
RegisterCodec registers concrete types on codec codec
func RollingAverageIndicator ¶ added in v0.0.7
func RollingAverageIndicator(ctx sdk.Context, k Keeper, epochs sdk.Int, indicatorFunction func(sdk.Context, Keeper, sdk.Int) sdk.Dec) sdk.Dec
RollingAverageIndicator returns the rolling average of the indicator over several epochs. If current epoch < epochs, we return the best we can and return RollingAverageIndicator(currentEpoch)
func SeigniorageRewardsForEpoch ¶ added in v0.0.7
SeigniorageRewardsForEpoch returns seigniorage rewards for the epoch
func SumIndicator ¶ added in v0.0.7
func SumIndicator(ctx sdk.Context, k Keeper, epochs sdk.Int, indicatorFunction func(sdk.Context, Keeper, sdk.Int) sdk.Dec) sdk.Dec
SumIndicator returns the sum of the indicator over several epochs. If current epoch < epochs, we return the best we can and return SumIndicator(currentEpoch)
func TaxRewardsForEpoch ¶ added in v0.0.7
TaxRewardsForEpoch returns tax rewards that have been collected in the epoch
func UnitLunaIndicator ¶ added in v0.0.7
func UnitLunaIndicator(ctx sdk.Context, k Keeper, epoch sdk.Int, indicatorFunction func(sdk.Context, Keeper, sdk.Int) sdk.Dec) sdk.Dec
UnitLunaIndicator evaluates the indicator function and divides it by the luna supply for the epoch
func ValidateGenesis ¶ added in v0.0.5
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the provided treasury genesis state to ensure the expected invariants holds. (i.e. params in correct bounds, no duplicate validators)
Types ¶
type GenesisState ¶ added in v0.0.5
type GenesisState struct { Params Params `json:"params"` // treasury params GenesisTaxRate sdk.Dec `json:"tax_rate"` GenesisRewardWeight sdk.Dec `json:"reward_weight"` }
GenesisState - all treasury state that must be provided at genesis
func DefaultGenesisState ¶ added in v0.0.5
func DefaultGenesisState() GenesisState
DefaultGenesisState returns raw genesis message for testing
func ExportGenesis ¶ added in v0.0.5
func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper. The GenesisState will contain the pool, and validator/delegator distribution info's
func NewGenesisState ¶ added in v0.0.5
func NewGenesisState(params Params, taxRate, rewardWeight sdk.Dec) GenesisState
NewGenesisState constructs a new genesis state
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the treasury store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, valset sdk.ValidatorSet, mtk mint.Keeper, mk market.Keeper, paramspace params.Subspace) Keeper
NewKeeper constructs a new keeper
func (Keeper) AddClaim ¶
AddClaim adds a claim to the store, to be settled and cleared at the end of the epoch
func (Keeper) GetRewardWeight ¶ added in v0.0.5
GetRewardWeight returns the mining reward weight
func (Keeper) GetTaxCap ¶ added in v0.0.5
GetTaxCap gets the Tax Cap. Denominated in integer units of the reference {denom}
func (Keeper) GetTaxRate ¶ added in v0.0.5
GetTaxRate gets the tax rate
func (Keeper) IterateClaims ¶ added in v0.0.7
IterateClaims iterates over all the claims in the store.
func (Keeper) PeekTaxProceeds ¶ added in v0.0.5
PeekTaxProceeds peeks the total amount of taxes that have been collected in the given epoch.
func (Keeper) RecordTaxProceeds ¶ added in v0.0.7
RecordTaxProceeds add tax proceeds that have been added this epoch
func (Keeper) SetRewardWeight ¶ added in v0.0.5
SetRewardWeight sets the ratio of the treasury that goes to mining rewards, i.e. supply of Luna that is burned. You can only set the reward weight of the current epoch.
type Params ¶ added in v0.0.5
type Params struct { TaxPolicy PolicyConstraints `json:"tax_policy"` RewardPolicy PolicyConstraints `json:"reward_policy"` SeigniorageBurdenTarget sdk.Dec `json:"seigniorage_burden_target"` MiningIncrement sdk.Dec `json:"mining_increment"` WindowShort sdk.Int `json:"window_short"` WindowLong sdk.Int `json:"window_long"` WindowProbation sdk.Int `json:"window_probation"` }
Params treasury parameters
func DefaultParams ¶ added in v0.0.5
func DefaultParams() Params
DefaultParams creates default treasury module parameters
type PolicyConstraints ¶ added in v0.0.7
type PolicyConstraints struct { RateMin sdk.Dec `json:"rate_min"` RateMax sdk.Dec `json:"rate_max"` Cap sdk.Coin `json:"cap"` ChangeRateMax sdk.Dec `json:"change_max"` }
PolicyConstraints wraps constraints around updating a key Treasury variable
func (PolicyConstraints) Clamp ¶ added in v0.0.7
Clamp constrains a policy variable update within the policy constraints
func (PolicyConstraints) String ¶ added in v0.0.7
func (pc PolicyConstraints) String() string
String implements fmt.Stringer