keeper

package
v15.5.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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 added in v15.5.0

func (h Hooks) AfterCFMMPoolCreated(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)

AfterCFMMPoolCreated creates a gauge for each pool’s lockable duration.

func (Hooks) AfterCFMMSwap added in v15.5.0

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 added in v15.5.0

func (h Hooks) AfterConcentratedPoolCreated(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)

AfterConcentratedPoolCreated creates a single gauge for the concentrated liquidity pool.

func (Hooks) AfterConcentratedPoolSwap added in v15.5.0

func (h Hooks) AfterConcentratedPoolSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)

AfterConcentratedPoolSwap is a noop.

func (Hooks) AfterDistributeMintedCoin

func (h Hooks) AfterDistributeMintedCoin(ctx sdk.Context)

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 sdk.Int, exitCoins sdk.Coins)

AfterExitPool hook is a noop.

func (Hooks) AfterInitialPoolPositionCreated added in v15.5.0

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 sdk.Int)

AfterJoinPool hook is a noop.

func (Hooks) AfterLastPoolPositionRemoved added in v15.5.0

func (h Hooks) AfterLastPoolPositionRemoved(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)

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

func (Keeper) AllocateAsset

func (k Keeper) AllocateAsset(ctx sdk.Context) error

AllocateAsset allocates and distributes coin according a gauge’s proportional weight that is recorded in the record.

func (Keeper) CreateConcentratedLiquidityPoolGauge added in v15.5.0

func (k Keeper) CreateConcentratedLiquidityPoolGauge(ctx sdk.Context, poolId uint64) error

CreateConcentratedLiquidityPoolGauge creates a gauge for concentrated liquidity pool.

func (Keeper) CreateLockablePoolGauges added in v15.5.0

func (k Keeper) CreateLockablePoolGauges(ctx sdk.Context, poolId uint64) error

CreateLockablePoolGauges create multiple gauges based on lockableDurations.

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

func (Keeper) FundCommunityPoolFromModule

func (k Keeper) FundCommunityPoolFromModule(ctx sdk.Context, asset sdk.Coin) error

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

func (k Keeper) GetDistrInfo(ctx sdk.Context) types.DistrInfo

func (Keeper) GetGaugesForCFMMPool added in v15.5.0

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

func (k Keeper) GetLockableDurations(ctx sdk.Context) []time.Duration

func (Keeper) GetLongestLockableDuration added in v15.5.0

func (k Keeper) GetLongestLockableDuration(ctx sdk.Context) (time.Duration, error)

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

func (Keeper) GetPoolGaugeId

func (k Keeper) GetPoolGaugeId(ctx sdk.Context, poolId uint64, lockableDuration time.Duration) (uint64, error)

func (Keeper) GetPoolIdFromGaugeId

func (k Keeper) GetPoolIdFromGaugeId(ctx sdk.Context, gaugeId uint64, lockableDuration time.Duration) (uint64, error)

func (Keeper) HandleReplacePoolIncentivesProposal

func (k Keeper) HandleReplacePoolIncentivesProposal(ctx sdk.Context, p *types.ReplacePoolIncentivesProposal) error

func (Keeper) HandleUpdatePoolIncentivesProposal

func (k Keeper) HandleUpdatePoolIncentivesProposal(ctx sdk.Context, p *types.UpdatePoolIncentivesProposal) error

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Create new pool incentives hooks.

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)

func (Keeper) IsPoolIncentivized

func (k Keeper) IsPoolIncentivized(ctx sdk.Context, poolId uint64) bool

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) ReplaceDistrRecords

func (k Keeper) ReplaceDistrRecords(ctx sdk.Context, records ...types.DistrRecord) error

This is checked for no err when a proposal is made, and executed when a proposal passes.

func (Keeper) SetDistrInfo

func (k Keeper) SetDistrInfo(ctx sdk.Context, distrInfo types.DistrInfo)

func (Keeper) SetLockableDurations

func (k Keeper) SetLockableDurations(ctx sdk.Context, lockableDurations []time.Duration)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

func (Keeper) SetPoolGaugeId

func (k Keeper) SetPoolGaugeId(ctx sdk.Context, poolId uint64, lockableDuration time.Duration, gaugeId uint64)

func (Keeper) UpdateDistrRecords

func (k Keeper) UpdateDistrRecords(ctx sdk.Context, records ...types.DistrRecord) error

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 NewQuerier(k Keeper) Querier

func (Querier) DistrInfo

DistrInfo returns gauges receiving pool rewards and their respective weights.

func (Querier) ExternalIncentiveGauges

ExternalIncentiveGauges iterates over all gauges, returns gauges externally incentivized, excluding default gauges created with pool.

func (Querier) GaugeIds

GaugeIds takes provided gauge request and returns the respective gaugeIDs.

func (Querier) IncentivizedPools

IncentivizedPools iterates over all gauges, returns default gauges created with pool.

func (Querier) LockableDurations

LockableDurations returns the lock durations that are incentivized through pool-incentives.

func (Querier) Params

Params return pool-incentives module params.

Jump to

Keyboard shortcuts

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