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 DistributionKeeper
- type FeeCollectionKeeper
- type GenesisState
- type Keeper
- 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) 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 MarketKeeper
- type MintKeeper
- type Params
- type PolicyConstraints
- type QueryCurrentEpochResponse
- type QueryIssuanceResponse
- type QueryMiningRewardWeightResponse
- type QuerySeigniorageProceedsResponse
- type QueryTaxCapResponse
- type QueryTaxProceedsResponse
- type QueryTaxRateResponse
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" 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 DistributionKeeper ¶ added in v0.2.0
type DistributionKeeper interface {
AllocateTokensToValidator(ctx sdk.Context, val sdk.Validator, tokens sdk.DecCoins)
}
expected coin keeper
type FeeCollectionKeeper ¶ added in v0.2.0
expected fee keeper
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 MintKeeper, mk MarketKeeper, paramspace params.Subspace) Keeper
NewKeeper constructs a new keeper
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) 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 MarketKeeper ¶ added in v0.2.0
type MarketKeeper interface { GetSwapDecCoin(ctx sdk.Context, offerCoin sdk.DecCoin, askDenom string) (sdk.DecCoin, sdk.Error) GetSwapCoin(ctx sdk.Context, offerCoin sdk.Coin, askDenom string, isInternal bool) (sdk.Coin, sdk.Dec, sdk.Error) }
expected market keeper
type MintKeeper ¶ added in v0.2.0
type MintKeeper interface { PeekEpochSeigniorage(ctx sdk.Context, epoch sdk.Int) (seignioragePool sdk.Int) Mint(ctx sdk.Context, recipient sdk.AccAddress, coin sdk.Coin) (err sdk.Error) GetIssuance(ctx sdk.Context, denom string, day sdk.Int) (issuance sdk.Int) }
expected mint keeper
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
type QueryCurrentEpochResponse ¶ added in v0.2.2
JSON response format
func (QueryCurrentEpochResponse) String ¶ added in v0.2.2
func (r QueryCurrentEpochResponse) String() (out string)
type QueryIssuanceResponse ¶ added in v0.2.2
JSON response format
func (QueryIssuanceResponse) String ¶ added in v0.2.2
func (r QueryIssuanceResponse) String() (out string)
type QueryMiningRewardWeightResponse ¶ added in v0.2.2
JSON response format
func (QueryMiningRewardWeightResponse) String ¶ added in v0.2.2
func (r QueryMiningRewardWeightResponse) String() (out string)
type QuerySeigniorageProceedsResponse ¶ added in v0.2.2
type QuerySeigniorageProceedsResponse struct {
SeigniorageProceeds sdk.Int `json:"seigniorage_proceeds"`
}
JSON response format
func (QuerySeigniorageProceedsResponse) String ¶ added in v0.2.2
func (r QuerySeigniorageProceedsResponse) String() (out string)
type QueryTaxCapResponse ¶ added in v0.2.2
JSON response format
func (QueryTaxCapResponse) String ¶ added in v0.2.2
func (r QueryTaxCapResponse) String() (out string)
type QueryTaxProceedsResponse ¶ added in v0.2.2
JSON response format
func (QueryTaxProceedsResponse) String ¶ added in v0.2.2
func (r QueryTaxProceedsResponse) String() (out string)
type QueryTaxRateResponse ¶ added in v0.2.2
JSON response format
func (QueryTaxRateResponse) String ¶ added in v0.2.2
func (r QueryTaxRateResponse) String() (out string)