keeper

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type AmmHooks

type AmmHooks struct {
	// contains filtered or unexported fields
}

Hooks wrapper struct for incentive keeper

func (AmmHooks) AfterExitPool

func (h AmmHooks) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, shareInAmount math.Int, exitCoins sdk.Coins) error

AfterExitPool is called after ExitPool, ExitSwapShareAmountIn, and ExitSwapExternAmountOut

func (AmmHooks) AfterJoinPool

func (h AmmHooks) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, enterCoins sdk.Coins, shareOutAmount math.Int)

AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut

func (AmmHooks) AfterPoolCreated

func (h AmmHooks) AfterPoolCreated(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool)

AfterPoolCreated is called after CreatePool

func (AmmHooks) AfterSwap

func (h AmmHooks) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, input sdk.Coins, output sdk.Coins) error

AfterSwap is called after SwapExactAmountIn and SwapExactAmountOut

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,
	parameterKeeper types.ParameterKeeper,
	ck types.CommitmentKeeper,
	amm types.AmmKeeper,
	ok types.OracleKeeper,
	ap types.AssetProfileKeeper,
	accountedPoolKeeper types.AccountedPoolKeeper,
	stableKeeper types.StableStakeKeeper,
	tokenomicsKeeper types.TokenomicsKeeper,
	ak types.AccountKeeper,
	bk types.BankKeeper,
	authority string,
) *Keeper

func (Keeper) AddPoolRewardsAccum added in v0.33.0

func (k Keeper) AddPoolRewardsAccum(ctx sdk.Context, poolId, timestamp uint64, height int64, dexReward, gasReward, edenReward math.LegacyDec)

func (Keeper) AfterDeposit

func (k Keeper) AfterDeposit(ctx sdk.Context, poolId uint64, user string, amount math.Int)

func (Keeper) AfterDepositPerReward

func (k Keeper) AfterDepositPerReward(ctx sdk.Context, poolId uint64, rewardDenom string, user string, amount math.Int)

func (Keeper) AfterExitPool

func (k Keeper) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareInAmount math.Int, exitCoins sdk.Coins) error

AfterExitPool is called after ExitPool, ExitSwapShareAmountIn, and ExitSwapExternAmountOut

func (Keeper) AfterJoinPool

func (k Keeper) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, enterCoins sdk.Coins, shareOutAmount math.Int)

AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut

func (Keeper) AfterPoolCreated

func (k Keeper) AfterPoolCreated(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)

AfterPoolCreated is called after CreatePool

func (Keeper) AfterSwap

func (k Keeper) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, input sdk.Coins, output sdk.Coins) error

AfterSwap is called after SwapExactAmountIn and SwapExactAmountOut

func (Keeper) AfterWithdraw

func (k Keeper) AfterWithdraw(ctx sdk.Context, poolId uint64, user string, amount math.Int)

func (Keeper) AfterWithdrawPerReward

func (k Keeper) AfterWithdrawPerReward(ctx sdk.Context, poolId uint64, rewardDenom string, user string, amount math.Int)

func (Keeper) AmmHooks

func (k Keeper) AmmHooks() AmmHooks

Return the wrapper struct

func (Keeper) CalculatePoolAprs

func (k Keeper) CalculatePoolAprs(ctx sdk.Context, ids []uint64) []types.PoolApr

func (Keeper) CalculateProxyTVL

func (k Keeper) CalculateProxyTVL(ctx sdk.Context, baseCurrency string) sdk.Dec

Calculate Proxy TVL

func (Keeper) CalculateStableStakeApr

func (k Keeper) CalculateStableStakeApr(ctx sdk.Context, query *types.QueryStableStakeAprRequest) (math.Int, error)

func (Keeper) ClaimRewards added in v0.33.0

func (k Keeper) ClaimRewards(ctx sdk.Context, sender sdk.AccAddress, poolIds []uint64, recipient sdk.AccAddress) error

func (Keeper) CollectDEXRevenue

func (k Keeper) CollectDEXRevenue(ctx sdk.Context) (sdk.Coins, sdk.DecCoins, map[uint64]sdk.Dec)

Collect all DEX revenues to DEX revenue wallet, while tracking the 60% of it for LPs reward distribution transfer collected fees from different wallets(liquidity pool, perpetual module etc) to the distribution module account Assume this is already in USDC.

func (Keeper) CollectGasFees

func (k Keeper) CollectGasFees(ctx sdk.Context, baseCurrency string) sdk.DecCoins

func (Keeper) ConvertGasFeesToUsdc

func (k Keeper) ConvertGasFeesToUsdc(ctx sdk.Context, baseCurrency string) sdk.Coins

Move gas fees collected to dex revenue wallet Convert it into USDC

func (Keeper) DeletePoolRewardsAccum added in v0.33.0

func (k Keeper) DeletePoolRewardsAccum(ctx sdk.Context, accum types.PoolRewardsAccum)

func (Keeper) EndBlocker

func (k Keeper) EndBlocker(ctx sdk.Context)

EndBlocker of amm module

func (Keeper) FirstPoolRewardsAccum added in v0.33.0

func (k Keeper) FirstPoolRewardsAccum(ctx sdk.Context, poolId uint64) types.PoolRewardsAccum

func (Keeper) GetAllExternalIncentives

func (k Keeper) GetAllExternalIncentives(ctx sdk.Context) (list []types.ExternalIncentive)

func (Keeper) GetAllPoolRewardInfos

func (k Keeper) GetAllPoolRewardInfos(ctx sdk.Context) (list []types.PoolRewardInfo)

func (Keeper) GetAllPoolRewardsAccum added in v0.33.0

func (k Keeper) GetAllPoolRewardsAccum(ctx sdk.Context) (list []types.PoolRewardsAccum)

func (Keeper) GetAllPools

func (k Keeper) GetAllPools(ctx sdk.Context) (list []types.PoolInfo)

func (Keeper) GetAllUserRewardInfos

func (k Keeper) GetAllUserRewardInfos(ctx sdk.Context) (list []types.UserRewardInfo)

func (Keeper) GetBaseCurrencyDenom

func (k Keeper) GetBaseCurrencyDenom(ctx sdk.Context) string

func (Keeper) GetExternalIncentive

func (k Keeper) GetExternalIncentive(ctx sdk.Context, id uint64) (val types.ExternalIncentive, found bool)

func (Keeper) GetExternalIncentiveIndex

func (k Keeper) GetExternalIncentiveIndex(ctx sdk.Context) (index uint64)

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetPool

func (k Keeper) GetPool(ctx sdk.Context, poolId uint64) (val types.PoolInfo, found bool)

func (Keeper) GetPoolBalance

func (k Keeper) GetPoolBalance(ctx sdk.Context, poolId uint64, user string) math.Int

func (Keeper) GetPoolRewardInfo

func (k Keeper) GetPoolRewardInfo(ctx sdk.Context, poolId uint64, rewardDenom string) (val types.PoolRewardInfo, found bool)

func (Keeper) GetPoolRewardsAccum added in v0.33.0

func (k Keeper) GetPoolRewardsAccum(ctx sdk.Context, poolId, timestamp uint64) (types.PoolRewardsAccum, error)

func (Keeper) GetPoolTVL

func (k Keeper) GetPoolTVL(ctx sdk.Context, poolId uint64) math.LegacyDec

func (Keeper) GetPoolTotalCommit

func (k Keeper) GetPoolTotalCommit(ctx sdk.Context, poolId uint64) math.Int

func (Keeper) GetRewardDenoms

func (k Keeper) GetRewardDenoms(ctx sdk.Context, poolId uint64) []string

func (Keeper) GetUserRewardInfo

func (k Keeper) GetUserRewardInfo(ctx sdk.Context, user string, poolId uint64, rewardDenom string) (val types.UserRewardInfo, found bool)

func (Keeper) InitPoolParams

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

InitPoolParams: creates a poolInfo at the time of pool creation.

func (Keeper) InitStableStakePoolParams

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

InitStableStakePoolMultiplier: create a stable stake pool information responding to the pool creation.

func (Keeper) IterateAllPoolRewardsAccum added in v0.33.0

func (k Keeper) IterateAllPoolRewardsAccum(ctx sdk.Context, handler func(accum types.PoolRewardsAccum) (stop bool))

func (Keeper) IteratePoolRewardsAccum added in v0.33.0

func (k Keeper) IteratePoolRewardsAccum(ctx sdk.Context, poolId uint64, handler func(accum types.PoolRewardsAccum) (stop bool))

func (Keeper) LastPoolRewardsAccum added in v0.33.0

func (k Keeper) LastPoolRewardsAccum(ctx sdk.Context, poolId uint64) types.PoolRewardsAccum

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) PoolAprs

func (Keeper) PoolInfo

func (Keeper) ProcessExternalRewardsDistribution

func (k Keeper) ProcessExternalRewardsDistribution(ctx sdk.Context)

func (Keeper) ProcessLPRewardDistribution

func (k Keeper) ProcessLPRewardDistribution(ctx sdk.Context)

func (Keeper) ProcessUpdateIncentiveParams

func (k Keeper) ProcessUpdateIncentiveParams(ctx sdk.Context)

func (Keeper) RemoveExternalIncentive

func (k Keeper) RemoveExternalIncentive(ctx sdk.Context, id uint64)

func (Keeper) RemovePool

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

func (Keeper) RemovePoolRewardInfo

func (k Keeper) RemovePoolRewardInfo(ctx sdk.Context, poolId uint64, rewardDenom string)

func (Keeper) RemoveUserRewardInfo

func (k Keeper) RemoveUserRewardInfo(ctx sdk.Context, user string, poolId uint64, rewardDenom string)

func (Keeper) SetExternalIncentive

func (k Keeper) SetExternalIncentive(ctx sdk.Context, externalIncentive types.ExternalIncentive)

func (Keeper) SetExternalIncentiveIndex

func (k Keeper) SetExternalIncentiveIndex(ctx sdk.Context, index uint64)

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetPool

func (k Keeper) SetPool(ctx sdk.Context, pool types.PoolInfo) error

func (Keeper) SetPoolRewardInfo

func (k Keeper) SetPoolRewardInfo(ctx sdk.Context, poolReward types.PoolRewardInfo) error

func (Keeper) SetPoolRewardsAccum added in v0.33.0

func (k Keeper) SetPoolRewardsAccum(ctx sdk.Context, accum types.PoolRewardsAccum)

func (Keeper) SetUserRewardInfo

func (k Keeper) SetUserRewardInfo(ctx sdk.Context, userReward types.UserRewardInfo) error

func (Keeper) StableStakeHooks

func (k Keeper) StableStakeHooks() StableStakeHooks

Return the wrapper struct

func (Keeper) UpdateAccPerShare

func (k Keeper) UpdateAccPerShare(ctx sdk.Context, poolId uint64, rewardDenom string, amount math.Int)

func (Keeper) UpdateAmmPoolAPR

func (k Keeper) UpdateAmmPoolAPR(ctx sdk.Context, totalBlocksPerYear int64, totalProxyTVL sdk.Dec, edenDenomPrice sdk.Dec)

Update APR for AMM pool

func (Keeper) UpdateLPRewards

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

func (Keeper) UpdatePoolMultipliers

func (k Keeper) UpdatePoolMultipliers(ctx sdk.Context, poolMultipliers []types.PoolMultiplier) bool

func (Keeper) UpdateUserRewardDebt

func (k Keeper) UpdateUserRewardDebt(ctx sdk.Context, poolId uint64, rewardDenom string, user string)

func (Keeper) UpdateUserRewardPending

func (k Keeper) UpdateUserRewardPending(ctx sdk.Context, poolId uint64, rewardDenom string, user string, isDeposit bool, amount math.Int)

func (Keeper) UserPoolPendingReward added in v0.33.0

func (k Keeper) UserPoolPendingReward(ctx sdk.Context, user sdk.AccAddress, poolId uint64) sdk.Coins

type StableStakeHooks

type StableStakeHooks struct {
	// contains filtered or unexported fields
}

Hooks wrapper struct for incentive keeper

func (StableStakeHooks) AfterBond

func (h StableStakeHooks) AfterBond(ctx sdk.Context, sender string, shareAmount math.Int) error

func (StableStakeHooks) AfterUnbond

func (h StableStakeHooks) AfterUnbond(ctx sdk.Context, sender string, shareAmount math.Int) error

Jump to

Keyboard shortcuts

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