Documentation ¶
Index ¶
- type Hooks
- func (h Hooks) AfterCFMMPoolCreated(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)
- func (h Hooks) AfterCFMMSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, input sdk.Coins, ...)
- func (h Hooks) AfterConcentratedPoolCreated(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)
- func (h Hooks) AfterConcentratedPoolSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, input sdk.Coins, ...)
- func (h Hooks) AfterDistributeMintedCoin(ctx sdk.Context)
- func (h Hooks) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, ...)
- func (h Hooks) AfterInitialPoolPositionCreated(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)
- func (h Hooks) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, enterCoins sdk.Coins, ...)
- func (h Hooks) AfterLastPoolPositionRemoved(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)
- type Keeper
- func (k Keeper) AllocateAsset(ctx sdk.Context) error
- func (k Keeper) CreateConcentratedLiquidityPoolGauge(ctx sdk.Context, poolId uint64) error
- func (k Keeper) CreateLockablePoolGauges(ctx sdk.Context, poolId uint64) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) FundCommunityPoolFromModule(ctx sdk.Context, asset sdk.Coin) error
- func (k Keeper) GetAllGauges(ctx sdk.Context) []incentivestypes.Gauge
- func (k Keeper) GetDistrInfo(ctx sdk.Context) types.DistrInfo
- func (k Keeper) GetGaugesForCFMMPool(ctx sdk.Context, poolId uint64) ([]incentivestypes.Gauge, error)
- func (k Keeper) GetInternalGaugeIDForPool(ctx sdk.Context, poolID uint64) (uint64, error)
- func (k Keeper) GetLockableDurations(ctx sdk.Context) []time.Duration
- func (k Keeper) GetLongestLockableDuration(ctx sdk.Context) (time.Duration, error)
- func (k Keeper) GetNoLockGaugeIdsFromPool(ctx sdk.Context, poolId uint64) ([]uint64, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPoolGaugeId(ctx sdk.Context, poolId uint64, lockableDuration time.Duration) (uint64, error)
- func (k Keeper) GetPoolIdFromGaugeId(ctx sdk.Context, gaugeId uint64, lockableDuration time.Duration) (uint64, error)
- func (k Keeper) HandleReplacePoolIncentivesProposal(ctx sdk.Context, p *types.ReplacePoolIncentivesProposal) error
- func (k Keeper) HandleUpdatePoolIncentivesProposal(ctx sdk.Context, p *types.UpdatePoolIncentivesProposal) error
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)
- func (k Keeper) IsPoolIncentivized(ctx sdk.Context, providedPoolId uint64) (bool, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) ReplaceDistrRecords(ctx sdk.Context, records ...types.DistrRecord) error
- func (k Keeper) SetDistrInfo(ctx sdk.Context, distrInfo types.DistrInfo)
- func (k Keeper) SetLockableDurations(ctx sdk.Context, lockableDurations []time.Duration)
- func (k Keeper) SetParam(ctx sdk.Context, key []byte, value interface{})
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPoolGaugeIdInternalIncentive(ctx sdk.Context, poolId uint64, incentivizedDuration time.Duration, ...) error
- func (k Keeper) SetPoolGaugeIdNoLock(ctx sdk.Context, poolId uint64, gaugeId uint64)
- func (k Keeper) UpdateDistrRecords(ctx sdk.Context, records ...types.DistrRecord) error
- type Querier
- func (q Querier) DistrInfo(ctx context.Context, _ *types.QueryDistrInfoRequest) (*types.QueryDistrInfoResponse, error)
- func (q Querier) ExternalIncentiveGauges(ctx context.Context, req *types.QueryExternalIncentiveGaugesRequest) (*types.QueryExternalIncentiveGaugesResponse, error)
- func (q Querier) GaugeIds(ctx context.Context, req *types.QueryGaugeIdsRequest) (*types.QueryGaugeIdsResponse, error)
- func (q Querier) IncentivizedPools(ctx context.Context, _ *types.QueryIncentivizedPoolsRequest) (*types.QueryIncentivizedPoolsResponse, error)
- func (q Querier) LockableDurations(ctx context.Context, _ *types.QueryLockableDurationsRequest) (*types.QueryLockableDurationsResponse, error)
- func (q Querier) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
func (Hooks) AfterCFMMPoolCreated ¶
AfterCFMMPoolCreated creates a gauge for each pool’s lockable duration.
func (Hooks) AfterCFMMSwap ¶
func (h Hooks) AfterCFMMSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, input sdk.Coins, output sdk.Coins)
AfterCFMMSwap hook is a noop.
func (Hooks) AfterConcentratedPoolCreated ¶
AfterConcentratedPoolCreated creates a single gauge for the concentrated liquidity pool.
func (Hooks) AfterConcentratedPoolSwap ¶
func (h Hooks) AfterConcentratedPoolSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, input sdk.Coins, output sdk.Coins)
AfterConcentratedPoolSwap is a noop.
func (Hooks) AfterDistributeMintedCoin ¶
Distribute coins after minter module allocate assets to pool-incentives module.
func (Hooks) AfterExitPool ¶
func (h Hooks) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareInAmount osmomath.Int, exitCoins sdk.Coins)
AfterExitPool hook is a noop.
func (Hooks) AfterInitialPoolPositionCreated ¶
func (h Hooks) AfterInitialPoolPositionCreated(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)
AfterInitialPoolPositionCreated is a noop.
func (Hooks) AfterJoinPool ¶
func (h Hooks) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, enterCoins sdk.Coins, shareOutAmount osmomath.Int)
AfterJoinPool hook is a noop.
func (Hooks) AfterLastPoolPositionRemoved ¶
AfterLastPoolPositionRemoved is a noop.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, incentivesKeeper types.IncentivesKeeper, distrKeeper types.DistrKeeper, poolmanagerKeeper types.PoolManagerKeeper, epochKeeper types.EpochKeeper, gammKeeper types.GAMMKeeper) Keeper
func (Keeper) AllocateAsset ¶
AllocateAsset allocates and distributes coin according a gauge’s proportional weight that is recorded in the record.
func (Keeper) CreateConcentratedLiquidityPoolGauge ¶
CreateConcentratedLiquidityPoolGauge creates a gauge for concentrated liquidity pool.
func (Keeper) CreateLockablePoolGauges ¶
CreateLockablePoolGauges create multiple gauges based on lockableDurations.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
func (Keeper) FundCommunityPoolFromModule ¶
FundCommunityPoolFromModule allows the pool-incentives module to directly fund the community fund pool.
func (Keeper) GetAllGauges ¶
func (k Keeper) GetAllGauges(ctx sdk.Context) []incentivestypes.Gauge
func (Keeper) GetGaugesForCFMMPool ¶
func (k Keeper) GetGaugesForCFMMPool(ctx sdk.Context, poolId uint64) ([]incentivestypes.Gauge, error)
GetGaugesForCFMMPool returns the gauges associated with the given CFMM pool ID, by first retrieving the lockable durations for the pool, then using them to query the pool incentives keeper for the gauge IDs associated with each duration, and finally using the incentives keeper to retrieve the actual gauges from the retrieved gauge IDs. CONTRACT: pool id must be assocated with a CFMM pool.
func (Keeper) GetInternalGaugeIDForPool ¶
GetInternalGaugeIdForPool returns the internally incentivized gauge ID associated with the pool ID. Contrary to GetPoolGaugeId, it determines the appropriate lockable duration based on the pool type. For balancer or stableswap pools that have 3 gauges, it assumes the longest lockable duration gauge. For CL pools, it assumes the gauge with the incentive module epoch duration. Returns gauge ID on succcess, returns error if: - fails to get pool - given pool type does not support incentives (e.g. CW pools at the time of writing) - fails to get the gauge ID for the given poolID and inferred lockable duration
func (Keeper) GetLockableDurations ¶
func (Keeper) GetLongestLockableDuration ¶
func (Keeper) GetNoLockGaugeIdsFromPool ¶
GetNoLockGaugeIdsFromPool returns all the NoLock gauge ids associated with the pool id. This can only be used for the "NoLock" gauges. For "NoLock" gauges there are 2 kinds of links created: - general - by duration (for internal incentives)
Every "NoLock" gauge has the first link. Only the internal incentives "NoLock" gauges have the second link.
func (Keeper) GetPoolGaugeId ¶
func (k Keeper) GetPoolGaugeId(ctx sdk.Context, poolId uint64, lockableDuration time.Duration) (uint64, error)
GetPoolGaugeId returns the gauge id associated with the pool id and lockable duration. This can only be used for the internally incentivized gauges. Externally incentivized gauges do not have such link created.
func (Keeper) GetPoolIdFromGaugeId ¶
func (Keeper) HandleReplacePoolIncentivesProposal ¶
func (Keeper) HandleUpdatePoolIncentivesProposal ¶
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)
func (Keeper) IsPoolIncentivized ¶
IsPoolIncentivized checks if a given pool is internally incentivized or not. It first retrieves the epoch duration and lockable durations from the keeper. Then it iterates over the distribution records, retrieving the gauge for each record. If the gauge's DistributeTo.LockQueryType is ByGroup, it retrieves the group and checks if it's perpetual. If it is, it retrieves the pool IDs from the group and checks if the provided pool ID is in the list. If the gauge's DistributeTo.LockQueryType is NoLock, it retrieves the pool ID from the gauge and checks if it matches the provided pool ID. If the gauge's DistributeTo.LockQueryType is ByDuration, it iterates over the lockableDurations, retrieves the pool ID for each duration, and checks if it matches the provided pool ID. If none of the checks pass, it returns false, indicating that the pool is not incentivized.
func (Keeper) ReplaceDistrRecords ¶
This is checked for no err when a proposal is made, and executed when a proposal passes.
func (Keeper) SetDistrInfo ¶
func (Keeper) SetLockableDurations ¶
func (Keeper) SetParam ¶
SetParam sets a specific pool-incentives module's parameter with the provided parameter.
func (Keeper) SetPoolGaugeIdInternalIncentive ¶
func (k Keeper) SetPoolGaugeIdInternalIncentive(ctx sdk.Context, poolId uint64, incentivizedDuration time.Duration, gaugeId uint64) error
SetPoolGaugeIdInternalIncentive sets the gauge id for the pool and internally incentivized duration. Returns error if the incentivized duration is zero. CONTRACT: this link is created only for the internally incentivized gauges.
func (Keeper) SetPoolGaugeIdNoLock ¶
SetPoolGaugeIdNoLock sets the link between pool id and gauge id for "NoLock" gauges. CONTRACT: the gauge of the given id must be "NoLock" gauge.
func (Keeper) UpdateDistrRecords ¶
UpdateDistrRecords is checked for no err when a proposal is made, and executed when a proposal passes.
type Querier ¶
type Querier struct {
Keeper
}
Querier defines a wrapper around the x/pool-incentives keeper providing gRPC method handlers.
func NewQuerier ¶
func (Querier) DistrInfo ¶
func (q Querier) DistrInfo(ctx context.Context, _ *types.QueryDistrInfoRequest) (*types.QueryDistrInfoResponse, error)
DistrInfo returns gauges receiving pool rewards and their respective weights.
func (Querier) ExternalIncentiveGauges ¶
func (q Querier) ExternalIncentiveGauges(ctx context.Context, req *types.QueryExternalIncentiveGaugesRequest) (*types.QueryExternalIncentiveGaugesResponse, error)
ExternalIncentiveGauges iterates over all gauges and returns gauges externally incentivized by excluding default (internal) gauges.
func (Querier) GaugeIds ¶
func (q Querier) GaugeIds(ctx context.Context, req *types.QueryGaugeIdsRequest) (*types.QueryGaugeIdsResponse, error)
GaugeIds takes provided gauge request and returns the respective internally incentivized gaugeIDs. If internally incentivized for a given pool id is not found, returns an error.
func (Querier) IncentivizedPools ¶
func (q Querier) IncentivizedPools(ctx context.Context, _ *types.QueryIncentivizedPoolsRequest) (*types.QueryIncentivizedPoolsResponse, error)
IncentivizedPools iterates over all internally incentivized gauges and returns their corresponding pools.
func (Querier) LockableDurations ¶
func (q Querier) LockableDurations(ctx context.Context, _ *types.QueryLockableDurationsRequest) (*types.QueryLockableDurationsResponse, error)
LockableDurations returns the lock durations that are incentivized through pool-incentives.
func (Querier) Params ¶
func (q Querier) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params return pool-incentives module params.