keeper

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPoolIdFromShareDenom

func GetPoolIdFromShareDenom(shareDenom string) (uint64, error)

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func Pow10

func Pow10(decimal uint64) (value sdk.Dec)

Types

type AmmHooks added in v0.35.0

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

Hooks wrapper struct for incentive keeper

func (AmmHooks) AfterExitPool added in v0.35.0

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 added in v0.35.0

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

AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut

func (AmmHooks) AfterPoolCreated added in v0.35.0

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

AfterPoolCreated is called after CreatePool

func (AmmHooks) AfterSwap added in v0.35.0

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,
	bankKeeper types.BankKeeper,
	oracleKeeper types.OracleKeeper,
	assetProfileKeeper types.AssetProfileKeeper,
	amm types.AmmKeeper,
	estaking types.EstakingKeeper,
	masterchef types.MasterchefKeeper,
	commitement types.CommitmentKeeper,
	stakingKeeper types.StakingKeeper,
	perpetual types.PerpetualKeeper,
	leveragelp types.LeverageLpKeeper,
	stablestakeKeeper types.StablestakeKeeper,
) *Keeper

func (Keeper) AfterAmmExitPool added in v0.35.0

func (k Keeper) AfterAmmExitPool(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

AfterAmmExitPool is called after ExitPool, ExitSwapShareAmountIn, and ExitSwapExternAmountOut

func (Keeper) AfterAmmJoinPool added in v0.35.0

func (k Keeper) AfterAmmJoinPool(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

AfterAmmJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut

func (Keeper) AfterAmmPoolCreated added in v0.35.0

func (k Keeper) AfterAmmPoolCreated(ctx sdk.Context, ammPool ammtypes.Pool, sender sdk.AccAddress) error

AfterAmmPoolCreated is called after CreatePool

func (Keeper) AfterAmmSwap added in v0.35.0

func (k Keeper) AfterAmmSwap(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

AfterAmmSwap is called after SwapExactAmountIn and SwapExactAmountOut

func (Keeper) AfterBond added in v0.35.0

func (k Keeper) AfterBond(ctx sdk.Context, sender sdk.AccAddress, shareAmount math.Int) error

func (Keeper) AfterDelegationModified added in v0.35.0

func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

Updating portfolio on delegation changes

func (Keeper) AfterExitPool added in v0.35.0

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 added in v0.35.0

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

AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut

func (Keeper) AfterLeverageLpPositionClose added in v0.44.0

func (k Keeper) AfterLeverageLpPositionClose(ctx sdk.Context, sender sdk.AccAddress) error

func (Keeper) AfterLeverageLpPositionOpen added in v0.44.0

func (k Keeper) AfterLeverageLpPositionOpen(ctx sdk.Context, sender sdk.AccAddress) error

func (Keeper) AfterLeverageLpPositionOpenConsolidate added in v0.44.0

func (k Keeper) AfterLeverageLpPositionOpenConsolidate(ctx sdk.Context, sender sdk.AccAddress) error

func (Keeper) AfterPerpetualPositionClosed added in v0.35.0

func (k Keeper) AfterPerpetualPositionClosed(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

func (Keeper) AfterPerpetualPositionModified added in v0.35.0

func (k Keeper) AfterPerpetualPositionModified(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

func (Keeper) AfterPerpetualPositionOpen added in v0.35.0

func (k Keeper) AfterPerpetualPositionOpen(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

func (Keeper) AfterPoolCreated added in v0.35.0

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

AfterPoolCreated is called after CreatePool

func (Keeper) AfterSwap added in v0.35.0

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) AfterUnbond added in v0.35.0

func (k Keeper) AfterUnbond(ctx sdk.Context, sender sdk.AccAddress, shareAmount math.Int) error

func (Keeper) AmmHooks added in v0.35.0

func (k Keeper) AmmHooks() AmmHooks

Return the wrapper struct

func (Keeper) BeforeDelegationCreated added in v0.35.0

func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

Creating a commitment object for a delegator if one does not exist:

func (Keeper) BeforeDelegationRemoved added in v0.35.0

func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Keeper) BeforeDelegationSharesModified added in v0.35.0

func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Keeper) BeginBlocker added in v0.37.0

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

func (Keeper) CalcAmmPrice added in v0.35.0

func (k Keeper) CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) sdk.Dec

func (Keeper) CalculateUSDValue added in v0.44.0

func (k Keeper) CalculateUSDValue(ctx sdk.Context, denom string, amount sdk.Int) sdk.Dec

func (Keeper) GetAllPortfolio

func (k Keeper) GetAllPortfolio(ctx sdk.Context) (list []types.Portfolio)

GetAllPortfolio returns all portfolio

func (Keeper) GetAmmPrice added in v0.35.0

func (Keeper) GetConsolidatedPrice added in v0.38.0

func (Keeper) GetDateAfterDaysFromContext added in v0.45.0

func (k Keeper) GetDateAfterDaysFromContext(ctx sdk.Context, n int) string

func (Keeper) GetDateFromContext added in v0.45.0

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

func (Keeper) GetLegacyPortfolios added in v0.45.0

func (k Keeper) GetLegacyPortfolios(ctx sdk.Context, date string) (list []types.Portfolio)

remove after migrations

func (Keeper) GetMembershipTier

func (k Keeper) GetMembershipTier(ctx sdk.Context, user sdk.AccAddress) (total_portfolio sdk.Dec, tier string, discount uint64)

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetPortfolio

func (k Keeper) GetPortfolio(ctx sdk.Context, user sdk.AccAddress, date string) (sdk.Dec, bool)

GetPortfolio returns a portfolio from its index

func (Keeper) LeverageLpHooks added in v0.44.0

func (k Keeper) LeverageLpHooks() LeverageLpHooks

Return the wrapper struct

func (Keeper) LeverageLpTotal added in v0.34.0

func (Keeper) LiquidTotal added in v0.35.0

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) Perpetual added in v0.35.0

func (Keeper) PerpetualHooks added in v0.35.0

func (k Keeper) PerpetualHooks() PerpetualHooks

Return the wrapper struct

func (Keeper) RemoveLegacyPortfolio added in v0.45.0

func (k Keeper) RemoveLegacyPortfolio(ctx sdk.Context, date string, user string)

func (Keeper) RemoveLegacyPortfolioCounted added in v0.45.0

func (k Keeper) RemoveLegacyPortfolioCounted(ctx sdk.Context, date string, num uint64)

func (Keeper) RemovePortfolioLast added in v0.37.0

func (k Keeper) RemovePortfolioLast(ctx sdk.Context, date string, num uint64) uint64

RemovePortfolioLast removes a portfolio from the store with a specific date

func (Keeper) RetrieveAllPortfolio added in v0.38.0

func (k Keeper) RetrieveAllPortfolio(ctx sdk.Context, user sdk.AccAddress)

func (Keeper) RetrieveConsolidatedPrice added in v0.38.0

func (k Keeper) RetrieveConsolidatedPrice(ctx sdk.Context, denom string) (sdk.Dec, sdk.Dec, sdk.Dec)

func (Keeper) RetrieveLeverageLpTotal added in v0.38.0

func (k Keeper) RetrieveLeverageLpTotal(ctx sdk.Context, user sdk.AccAddress) (sdk.Dec, sdk.Dec, sdk.Dec)

func (Keeper) RetrieveLiquidAssetsTotal added in v0.38.0

func (k Keeper) RetrieveLiquidAssetsTotal(ctx sdk.Context, user sdk.AccAddress) sdk.Dec

func (Keeper) RetrievePerpetualTotal added in v0.38.0

func (k Keeper) RetrievePerpetualTotal(ctx sdk.Context, user sdk.AccAddress) (sdk.Dec, sdk.Dec, sdk.Dec)

func (Keeper) RetrievePoolTotal added in v0.39.0

func (k Keeper) RetrievePoolTotal(ctx sdk.Context, user sdk.AccAddress) sdk.Dec

func (Keeper) RetrieveRewardsTotal added in v0.38.0

func (k Keeper) RetrieveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) sdk.Dec

func (Keeper) RetrieveStaked added in v0.39.0

func (k Keeper) RetrieveStaked(ctx sdk.Context, user sdk.AccAddress) (sdk.Dec, sdk.Dec, sdk.Dec, sdk.Dec)

func (Keeper) RewardsTotal added in v0.35.0

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetPortfolio

func (k Keeper) SetPortfolio(ctx sdk.Context, portfolio types.Portfolio)

SetPortfolio set a specific portfolio in the store from its index

func (Keeper) StableStakeHooks added in v0.35.0

func (k Keeper) StableStakeHooks() StableStakeHooks

Return the wrapper struct

func (Keeper) Staked added in v0.39.0

func (Keeper) StakedPool added in v0.35.0

func (Keeper) StakingHooks added in v0.35.0

func (k Keeper) StakingHooks() StakingHooks

Return the wrapper struct

type LeverageLpHooks added in v0.44.0

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

func (LeverageLpHooks) AfterLeverageLpPositionClose added in v0.44.0

func (h LeverageLpHooks) AfterLeverageLpPositionClose(ctx sdk.Context, sender sdk.AccAddress) error

func (LeverageLpHooks) AfterLeverageLpPositionOpen added in v0.44.0

func (h LeverageLpHooks) AfterLeverageLpPositionOpen(ctx sdk.Context, sender sdk.AccAddress) error

func (LeverageLpHooks) AfterLeverageLpPositionOpenConsolidate added in v0.44.0

func (h LeverageLpHooks) AfterLeverageLpPositionOpenConsolidate(ctx sdk.Context, sender sdk.AccAddress) error

type PerpetualHooks added in v0.35.0

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

Hooks wrapper struct for tvl keeper

func (PerpetualHooks) AfterAmmExitPool added in v0.35.0

func (h PerpetualHooks) AfterAmmExitPool(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

func (PerpetualHooks) AfterAmmJoinPool added in v0.35.0

func (h PerpetualHooks) AfterAmmJoinPool(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

func (PerpetualHooks) AfterAmmPoolCreated added in v0.35.0

func (h PerpetualHooks) AfterAmmPoolCreated(ctx sdk.Context, ammPool ammtypes.Pool, sender sdk.AccAddress) error

func (PerpetualHooks) AfterAmmSwap added in v0.35.0

func (h PerpetualHooks) AfterAmmSwap(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

func (PerpetualHooks) AfterPerpetualPositionClosed added in v0.35.0

func (h PerpetualHooks) AfterPerpetualPositionClosed(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

func (PerpetualHooks) AfterPerpetualPositionModified added in v0.35.0

func (h PerpetualHooks) AfterPerpetualPositionModified(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

func (PerpetualHooks) AfterPerpetualPositionOpen added in v0.35.0

func (h PerpetualHooks) AfterPerpetualPositionOpen(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender sdk.AccAddress) error

type StableStakeHooks added in v0.35.0

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

Hooks wrapper struct for incentive keeper

func (StableStakeHooks) AfterBond added in v0.35.0

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

func (StableStakeHooks) AfterUnbond added in v0.35.0

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

type StakingHooks added in v0.35.0

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

StakingHooks wrapper struct for slashing keeper

func (StakingHooks) AfterDelegationModified added in v0.35.0

func (h StakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (StakingHooks) AfterUnbondingInitiated added in v0.35.0

func (h StakingHooks) AfterUnbondingInitiated(ctx sdk.Context, id uint64) error

staking StakingHooks Must be called when a validator is created

func (StakingHooks) AfterValidatorBeginUnbonding added in v0.35.0

func (h StakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

Must be called when a validator begins unbonding

func (StakingHooks) AfterValidatorBonded added in v0.35.0

func (h StakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

Must be called when a validator is bonded

func (StakingHooks) AfterValidatorCreated added in v0.35.0

func (h StakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error

staking StakingHooks Must be called when a validator is created

func (StakingHooks) AfterValidatorRemoved added in v0.35.0

func (h StakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

Must be called when a validator is deleted

func (StakingHooks) BeforeDelegationCreated added in v0.35.0

func (h StakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

Must be called when a delegation is created

func (StakingHooks) BeforeDelegationRemoved added in v0.35.0

func (h StakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

Must be called when a delegation is removed

func (StakingHooks) BeforeDelegationSharesModified added in v0.35.0

func (h StakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

Must be called when a delegation's shares are modified

func (StakingHooks) BeforeValidatorModified added in v0.35.0

func (h StakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error

Must be called when a validator's state changes

func (StakingHooks) BeforeValidatorSlashed added in v0.35.0

func (h StakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error

Jump to

Keyboard shortcuts

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