Documentation ¶
Index ¶
- func GetPoolIdFromShareDenom(shareDenom string) (uint64, error)
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func Pow10(decimal uint64) (value sdk.Dec)
- type AmmHooks
- func (h AmmHooks) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, ...) error
- func (h AmmHooks) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, ...)
- func (h AmmHooks) AfterPoolCreated(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool)
- func (h AmmHooks) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, input sdk.Coins, ...) error
- type Keeper
- func (k Keeper) AfterAmmExitPool(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- func (k Keeper) AfterAmmJoinPool(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- func (k Keeper) AfterAmmPoolCreated(ctx sdk.Context, ammPool ammtypes.Pool, sender string)
- func (k Keeper) AfterAmmSwap(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- func (k Keeper) AfterBond(ctx sdk.Context, sender string, shareAmount math.Int) error
- func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareInAmount math.Int, ...) error
- func (k Keeper) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, enterCoins sdk.Coins, ...)
- func (k Keeper) AfterPerpetualPositionClosed(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- func (k Keeper) AfterPerpetualPositionModified(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- func (k Keeper) AfterPerpetualPositionOpen(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- func (k Keeper) AfterPoolCreated(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)
- func (k Keeper) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, input sdk.Coins, ...) error
- func (k Keeper) AfterUnbond(ctx sdk.Context, sender string, shareAmount math.Int) error
- func (k Keeper) AmmHooks() AmmHooks
- func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) CalcAmmPrice(ctx sdk.Context, denom string, decimal uint64) sdk.Dec
- func (k Keeper) CalculateDiscount(goCtx context.Context, req *types.QueryCalculateDiscountRequest) (*types.QueryCalculateDiscountResponse, error)
- func (k Keeper) GetAllPortfolio(ctx sdk.Context, timestamp string) (list []types.Portfolio)
- func (k Keeper) GetAmmPrice(goCtx context.Context, req *types.QueryGetAmmPriceRequest) (*types.QueryGetAmmPriceResponse, error)
- func (k Keeper) GetDateFromBlock(blockTime time.Time) string
- func (k Keeper) GetMembershipTier(ctx sdk.Context, user string) (total_portfoilio sdk.Dec, tier string, discount uint64)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPortfolio(ctx sdk.Context, user string, timestamp string) (sdk.Dec, bool)
- func (k Keeper) LeverageLpTotal(goCtx context.Context, req *types.QueryLeverageLpTotalRequest) (*types.QueryLeverageLpTotalResponse, error)
- func (k Keeper) LiquidTotal(goCtx context.Context, req *types.QueryLiquidTotalRequest) (*types.QueryLiquidTotalResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) Perpetual(goCtx context.Context, req *types.QueryPerpetualRequest) (*types.QueryPerpetualResponse, error)
- func (k Keeper) PerpetualHooks() PerpetualHooks
- func (k Keeper) Portfolio(goCtx context.Context, req *types.QueryGetPortfolioRequest) (*types.QueryGetPortfolioResponse, error)
- func (k Keeper) PortfolioAll(goCtx context.Context, req *types.QueryAllPortfolioRequest) (*types.QueryAllPortfolioResponse, error)
- func (k Keeper) RemovePortfolio(ctx sdk.Context, user string, timestamp string)
- func (k Keeper) RetreiveAllPortfolio(ctx sdk.Context, user string)
- func (k Keeper) RetreiveLeverageLpTotal(ctx sdk.Context, user sdk.AccAddress) sdk.Dec
- func (k Keeper) RetreiveLiquidAssetsTotal(ctx sdk.Context, user sdk.AccAddress) sdk.Dec
- func (k Keeper) RetreivePerpetualTotal(ctx sdk.Context, user sdk.AccAddress) sdk.Dec
- func (k Keeper) RetreiveRewardsTotal(ctx sdk.Context, user sdk.AccAddress) sdk.Dec
- func (k Keeper) RetreiveStakedAndPoolTotal(ctx sdk.Context, user sdk.AccAddress) sdk.Dec
- func (k Keeper) RewardsTotal(goCtx context.Context, req *types.QueryRewardsTotalRequest) (*types.QueryRewardsTotalResponse, error)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPortfolio(ctx sdk.Context, todayDate string, user string, portfolio types.Portfolio)
- func (k Keeper) StableStakeHooks() StableStakeHooks
- func (k Keeper) StakedPool(goCtx context.Context, req *types.QueryStakedPoolRequest) (*types.QueryStakedPoolResponse, error)
- func (k Keeper) StakingHooks() StakingHooks
- type PerpetualHooks
- func (h PerpetualHooks) AfterAmmExitPool(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- func (h PerpetualHooks) AfterAmmJoinPool(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- func (h PerpetualHooks) AfterAmmPoolCreated(ctx sdk.Context, ammPool ammtypes.Pool, sender string)
- func (h PerpetualHooks) AfterAmmSwap(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- func (h PerpetualHooks) AfterPerpetualPositionClosed(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- func (h PerpetualHooks) AfterPerpetualPositionModified(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- func (h PerpetualHooks) AfterPerpetualPositionOpen(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, ...)
- type StableStakeHooks
- type StakingHooks
- func (h StakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) AfterUnbondingInitiated(ctx sdk.Context, id uint64) error
- func (h StakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (h StakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h StakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (h StakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPoolIdFromShareDenom ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
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)
AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut
func (AmmHooks) AfterPoolCreated ¶ added in v0.35.0
AfterPoolCreated is called after CreatePool
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, ) *Keeper
func (Keeper) AfterAmmExitPool ¶ added in v0.35.0
func (k Keeper) AfterAmmExitPool(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender string)
AfterExitPool 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 string)
AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut
func (Keeper) AfterAmmPoolCreated ¶ added in v0.35.0
AfterPoolCreated 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 string)
AfterSwap is called after SwapExactAmountIn and SwapExactAmountOut
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)
AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut
func (Keeper) AfterPerpetualPositionClosed ¶ added in v0.35.0
func (Keeper) AfterPerpetualPositionModified ¶ added in v0.35.0
func (Keeper) AfterPerpetualPositionOpen ¶ added in v0.35.0
func (Keeper) AfterPoolCreated ¶ added in v0.35.0
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 (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) CalcAmmPrice ¶ added in v0.35.0
func (Keeper) CalculateDiscount ¶
func (k Keeper) CalculateDiscount(goCtx context.Context, req *types.QueryCalculateDiscountRequest) (*types.QueryCalculateDiscountResponse, error)
func (Keeper) GetAllPortfolio ¶
GetAllPortfolio returns all portfolio
func (Keeper) GetAmmPrice ¶ added in v0.35.0
func (k Keeper) GetAmmPrice(goCtx context.Context, req *types.QueryGetAmmPriceRequest) (*types.QueryGetAmmPriceResponse, error)
func (Keeper) GetMembershipTier ¶
func (Keeper) GetPortfolio ¶
GetPortfolio returns a portfolio from its index
func (Keeper) LeverageLpTotal ¶ added in v0.34.0
func (k Keeper) LeverageLpTotal(goCtx context.Context, req *types.QueryLeverageLpTotalRequest) (*types.QueryLeverageLpTotalResponse, error)
func (Keeper) LiquidTotal ¶ added in v0.35.0
func (k Keeper) LiquidTotal(goCtx context.Context, req *types.QueryLiquidTotalRequest) (*types.QueryLiquidTotalResponse, error)
func (Keeper) Params ¶
func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) Perpetual ¶ added in v0.35.0
func (k Keeper) Perpetual(goCtx context.Context, req *types.QueryPerpetualRequest) (*types.QueryPerpetualResponse, error)
func (Keeper) PerpetualHooks ¶ added in v0.35.0
func (k Keeper) PerpetualHooks() PerpetualHooks
Return the wrapper struct
func (Keeper) Portfolio ¶
func (k Keeper) Portfolio(goCtx context.Context, req *types.QueryGetPortfolioRequest) (*types.QueryGetPortfolioResponse, error)
func (Keeper) PortfolioAll ¶
func (k Keeper) PortfolioAll(goCtx context.Context, req *types.QueryAllPortfolioRequest) (*types.QueryAllPortfolioResponse, error)
func (Keeper) RemovePortfolio ¶
RemovePortfolio removes a portfolio from the store
func (Keeper) RetreiveAllPortfolio ¶
func (Keeper) RetreiveLeverageLpTotal ¶ added in v0.34.0
func (Keeper) RetreiveLiquidAssetsTotal ¶ added in v0.35.0
func (Keeper) RetreivePerpetualTotal ¶ added in v0.35.0
func (Keeper) RetreiveRewardsTotal ¶ added in v0.35.0
func (Keeper) RetreiveStakedAndPoolTotal ¶ added in v0.35.0
func (Keeper) RewardsTotal ¶ added in v0.35.0
func (k Keeper) RewardsTotal(goCtx context.Context, req *types.QueryRewardsTotalRequest) (*types.QueryRewardsTotalResponse, error)
func (Keeper) SetPortfolio ¶
func (k Keeper) SetPortfolio(ctx sdk.Context, todayDate string, user string, 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) StakedPool ¶ added in v0.35.0
func (k Keeper) StakedPool(goCtx context.Context, req *types.QueryStakedPoolRequest) (*types.QueryStakedPoolResponse, error)
func (Keeper) StakingHooks ¶ added in v0.35.0
func (k Keeper) StakingHooks() StakingHooks
Return the wrapper struct
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 string)
func (PerpetualHooks) AfterAmmJoinPool ¶ added in v0.35.0
func (h PerpetualHooks) AfterAmmJoinPool(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender string)
func (PerpetualHooks) AfterAmmPoolCreated ¶ added in v0.35.0
func (PerpetualHooks) AfterAmmSwap ¶ added in v0.35.0
func (h PerpetualHooks) AfterAmmSwap(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender string)
func (PerpetualHooks) AfterPerpetualPositionClosed ¶ added in v0.35.0
func (h PerpetualHooks) AfterPerpetualPositionClosed(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender string)
func (PerpetualHooks) AfterPerpetualPositionModified ¶ added in v0.35.0
func (h PerpetualHooks) AfterPerpetualPositionModified(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender string)
func (PerpetualHooks) AfterPerpetualPositionOpen ¶ added in v0.35.0
func (h PerpetualHooks) AfterPerpetualPositionOpen(ctx sdk.Context, ammPool ammtypes.Pool, perpetualPool perpetualtypes.Pool, sender string)
type StableStakeHooks ¶ added in v0.35.0
type StableStakeHooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for incentive keeper
func (StableStakeHooks) AfterUnbond ¶ added in v0.35.0
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
Source Files ¶
- hooks_amm.go
- hooks_perpetual.go
- hooks_stable_stake.go
- hooks_staking.go
- keeper.go
- msg_server.go
- msg_server_set_portfolio.go
- params.go
- portfolio.go
- query.go
- query_calculate_discount.go
- query_get_amm_price.go
- query_leverage_lp_total.go
- query_liquid_total.go
- query_params.go
- query_perpetual.go
- query_portfolio.go
- query_rewards_total.go
- query_staked_pool.go