Documentation ¶
Index ¶
- func AllInvariants(k *Keeper) sdk.Invariant
- func HandleAddProtocolDataProposal(ctx sdk.Context, k *Keeper, p *types.AddProtocolDataProposal) error
- func LoadSubmodules() map[cmtypes.ClaimType]Submodule
- func NewMsgServerImpl(keeper *Keeper) types.MsgServer
- func OsmosisPoolUpdateCallback(ctx sdk.Context, k *Keeper, response []byte, query icqtypes.Query) error
- func ParamsInvariant(k *Keeper) sdk.Invariant
- func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper)
- func SetEpochBlockCallback(ctx sdk.Context, k *Keeper, args []byte, query icqtypes.Query) error
- func ValidatorSelectionRewardsCallback(ctx sdk.Context, k *Keeper, response []byte, query icqtypes.Query) error
- type Callback
- type Callbacks
- type Hooks
- type Keeper
- func (k *Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64) error
- func (k *Keeper) AllKeyedProtocolDatas(ctx sdk.Context) []*types.KeyedProtocolData
- func (k Keeper) AllocateHoldingsRewards(ctx sdk.Context) error
- func (k Keeper) AllocateLockupRewards(ctx sdk.Context, allocation math.Int) error
- func (k Keeper) AllocateValidatorSelectionRewards(ctx sdk.Context)
- func (k *Keeper) AllocateZoneRewards(ctx sdk.Context, tvs TokenValues, allocation types.RewardsAllocation) error
- func (k *Keeper) BeforeEpochStart(_ sdk.Context, _ string, _ int64) error
- func (k *Keeper) BeginBlocker(_ sdk.Context)
- func (k Keeper) CalcDistributionScores(ctx sdk.Context, zone icstypes.Zone, zs *types.ZoneScore) error
- func (k Keeper) CalcOverallScores(ctx sdk.Context, zone icstypes.Zone, ...) error
- func (k *Keeper) CalcTokenValues(ctx sdk.Context) (TokenValues, error)
- func (k Keeper) CalcUserHoldingsAllocations(ctx sdk.Context, zone *icstypes.Zone) ([]types.UserAllocation, math.Int)
- func (k Keeper) CalcUserValidatorSelectionAllocations(ctx sdk.Context, zone *icstypes.Zone, zs types.ZoneScore) []types.UserAllocation
- func (k *Keeper) CallbackHandler() Callbacks
- func (k *Keeper) DeleteProtocolData(ctx sdk.Context, key []byte)
- func (k *Keeper) DistributeToUsers(ctx sdk.Context, userAllocations []types.UserAllocation) error
- func (k *Keeper) GetClaimsEnabled(ctx sdk.Context) bool
- func (k *Keeper) GetCodec() codec.BinaryCodec
- func (k *Keeper) GetModuleBalance(ctx sdk.Context) sdkmath.Int
- func (k *Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k *Keeper) GetProtocolData(ctx sdk.Context, pdType types.ProtocolDataType, key string) (types.ProtocolData, bool)
- func (k *Keeper) Hooks() Hooks
- func (k *Keeper) IterateAllProtocolDatas(ctx sdk.Context, ...)
- func (k *Keeper) IteratePrefixedProtocolDatas(ctx sdk.Context, key []byte, ...)
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k *Keeper) ProtocolData(c context.Context, q *types.QueryProtocolDataRequest) (*types.QueryProtocolDataResponse, error)
- func (k *Keeper) SetEpochsKeeper(epochsKeeper epochskeeper.Keeper)
- func (k *Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetProtocolData(ctx sdk.Context, key []byte, data *types.ProtocolData)
- func (k *Keeper) SetZoneAllocations(ctx sdk.Context, tvs TokenValues, allocation types.RewardsAllocation) error
- func (k *Keeper) UpdateSelfConnectionData(ctx sdk.Context) error
- type LiquidTokensModule
- type OsmosisModule
- func (m *OsmosisModule) GetKeyPrefixPools(poolID uint64) []byte
- func (m *OsmosisModule) Hooks(ctx sdk.Context, k *Keeper)
- func (m *OsmosisModule) IsActive() bool
- func (m *OsmosisModule) IsReady() bool
- func (m *OsmosisModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (uint64, error)
- type Submodule
- type TokenValues
- type UserAllocation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the module.
func HandleAddProtocolDataProposal ¶
func HandleAddProtocolDataProposal(ctx sdk.Context, k *Keeper, p *types.AddProtocolDataProposal) error
HandleAddProtocolDataProposal is a handler for executing a passed add protocol data proposal.
func LoadSubmodules ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
func ParamsInvariant ¶
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k *Keeper)
RegisterInvariants registers all participtationrewards invariants.
func SetEpochBlockCallback ¶
SetEpochBlockCallback records the block height of the registered zone at the epoch boundary.
Types ¶
type Callbacks ¶
type Callbacks struct {
// contains filtered or unexported fields
}
func (Callbacks) AddCallback ¶
func (c Callbacks) AddCallback(id string, fn interface{}) icqtypes.QueryCallbacks
func (Callbacks) RegisterCallbacks ¶
func (c Callbacks) RegisterCallbacks() icqtypes.QueryCallbacks
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for incentives keeper.
func (Hooks) AfterEpochEnd ¶
type Keeper ¶
type Keeper struct { IcqKeeper icqkeeper.Keeper ValidateProofOps utils.ProofOpsFn ValidateSelfProofOps utils.SelfProofOpsFn // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, key storetypes.StoreKey, ps paramtypes.Subspace, ak types.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, icqk icqkeeper.Keeper, icsk icskeeper.Keeper, feeCollectorName string, proofValidationFn utils.ProofOpsFn, selfProofValidationFn utils.SelfProofOpsFn, ) *Keeper
NewKeeper returns a new instance of participationrewards Keeper. This function will panic on failure.
func (*Keeper) AfterEpochEnd ¶
func (*Keeper) AllKeyedProtocolDatas ¶
func (k *Keeper) AllKeyedProtocolDatas(ctx sdk.Context) []*types.KeyedProtocolData
AllKeyedProtocolDatas returns a slice containing all protocol datas and their keys from the store.
func (Keeper) AllocateHoldingsRewards ¶
func (Keeper) AllocateLockupRewards ¶
func (Keeper) AllocateValidatorSelectionRewards ¶
AllocateValidatorSelectionRewards utilizes IBC to query the performance rewards account for each zone to determine validator performance and corresponding rewards allocations. Each zone's response is dealt with individually in a callback.
func (*Keeper) AllocateZoneRewards ¶
func (k *Keeper) AllocateZoneRewards(ctx sdk.Context, tvs TokenValues, allocation types.RewardsAllocation) error
AllocateZoneRewards executes zone based rewards allocation. This entails rewards that are proportionally distributed to zones based on the tvl for each zone relative to the tvl of the QS protocol.
func (*Keeper) BeforeEpochStart ¶
func (*Keeper) BeginBlocker ¶
BeginBlocker of participationrewards module.
func (Keeper) CalcDistributionScores ¶
func (k Keeper) CalcDistributionScores(ctx sdk.Context, zone icstypes.Zone, zs *types.ZoneScore) error
CalcDistributionScores calculates the validator distribution scores for the given zone based on the normalized voting power of the validators; scoring favours smaller validators for decentraliztion purposes.
func (Keeper) CalcOverallScores ¶
func (k Keeper) CalcOverallScores( ctx sdk.Context, zone icstypes.Zone, delegatorRewards distrtypes.QueryDelegationTotalRewardsResponse, zs *types.ZoneScore, ) error
CalcOverallScores calculates the overall validator scores for the given zone based on the combination of performance score and distribution score.
The performance score is first calculated based on validator rewards earned from the zone performance account that delegates an exact amount to each validator. The total rewards earned by the performance account is divided by the number of active validators to obtain the expected rewards. The performance score for each validator is then simply the percentage of actual rewards compared to the expected rewards (capped at 100%).
On completion a msg is submitted to withdraw the zone performance rewards, resetting zone performance scoring for the next epoch.
func (*Keeper) CalcTokenValues ¶
func (k *Keeper) CalcTokenValues(ctx sdk.Context) (TokenValues, error)
func (Keeper) CalcUserHoldingsAllocations ¶
func (k Keeper) CalcUserHoldingsAllocations(ctx sdk.Context, zone *icstypes.Zone) ([]types.UserAllocation, math.Int)
CalcUserHoldingsAllocations calculates allocations per user for a given zone, based upon claims submitted and zone.
func (Keeper) CalcUserValidatorSelectionAllocations ¶
func (k Keeper) CalcUserValidatorSelectionAllocations( ctx sdk.Context, zone *icstypes.Zone, zs types.ZoneScore, ) []types.UserAllocation
CalcUserValidatorSelectionAllocations returns a slice of userAllocation. It calculates individual user scores relative to overall zone score and then proportionally allocates rewards based on the individual zone allocation.
func (*Keeper) CallbackHandler ¶
func (*Keeper) DeleteProtocolData ¶
DeleteProtocolData deletes protocol data info.
func (*Keeper) DistributeToUsers ¶
DistributeToUsers sends the allocated user rewards to the user address.
func (*Keeper) GetCodec ¶
func (k *Keeper) GetCodec() codec.BinaryCodec
func (*Keeper) GetProtocolData ¶
func (k *Keeper) GetProtocolData(ctx sdk.Context, pdType types.ProtocolDataType, key string) (types.ProtocolData, bool)
GetProtocolData returns protocol data.
func (*Keeper) IterateAllProtocolDatas ¶
func (k *Keeper) IterateAllProtocolDatas(ctx sdk.Context, fn func(index int64, key string, data types.ProtocolData) (stop bool))
IterateAllProtocolDatas iterates through protocol data and perform the provided function.
func (*Keeper) IteratePrefixedProtocolDatas ¶
func (k *Keeper) IteratePrefixedProtocolDatas(ctx sdk.Context, key []byte, fn func(index int64, key []byte, data types.ProtocolData) (stop bool))
IteratePrefixedProtocolDatas iterate through protocol data with the given prefix and perform the provided function.
func (*Keeper) Params ¶
func (k *Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params returns params of the participationrewards module.
func (*Keeper) ProtocolData ¶
func (k *Keeper) ProtocolData(c context.Context, q *types.QueryProtocolDataRequest) (*types.QueryProtocolDataResponse, error)
func (*Keeper) SetEpochsKeeper ¶
func (k *Keeper) SetEpochsKeeper(epochsKeeper epochskeeper.Keeper)
func (Keeper) SetProtocolData ¶
SetProtocolData set protocol data info.
func (*Keeper) SetZoneAllocations ¶
func (k *Keeper) SetZoneAllocations(ctx sdk.Context, tvs TokenValues, allocation types.RewardsAllocation) error
SetZoneAllocations returns the proportional zone rewards allocations as a map indexed by the zone id.
type LiquidTokensModule ¶
type LiquidTokensModule struct{}
func (*LiquidTokensModule) IsActive ¶
func (m *LiquidTokensModule) IsActive() bool
func (*LiquidTokensModule) IsReady ¶
func (m *LiquidTokensModule) IsReady() bool
func (*LiquidTokensModule) ValidateClaim ¶
func (m *LiquidTokensModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (uint64, error)
type OsmosisModule ¶
type OsmosisModule struct{}
func (*OsmosisModule) GetKeyPrefixPools ¶
func (m *OsmosisModule) GetKeyPrefixPools(poolID uint64) []byte
func (*OsmosisModule) IsActive ¶
func (m *OsmosisModule) IsActive() bool
func (*OsmosisModule) IsReady ¶
func (m *OsmosisModule) IsReady() bool
func (*OsmosisModule) ValidateClaim ¶
func (m *OsmosisModule) ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (uint64, error)
type Submodule ¶
type Submodule interface { Hooks(ctx sdk.Context, keeper *Keeper) IsActive() bool IsReady() bool ValidateClaim(ctx sdk.Context, k *Keeper, msg *types.MsgSubmitClaim) (uint64, error) }
Submodule defines the interface for for tracking off-chain qAssets with regards to participation rewards claims.
type TokenValues ¶
type UserAllocation ¶
UserAllocation is an internal keeper struct to track transient state for rewards distribution. It contains the user address and the coins that are allocated to it.