Documentation ¶
Index ¶
- func BeginBlockerProcessMTP(ctx sdk.Context, k Keeper, mtp *types.MTP, pool types.Pool, ...) error
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- 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 Hooks
- type Keeper
- func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64)
- func (k Keeper) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, ammPool ammtypes.Pool, ...) error
- func (k Keeper) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, ammPool ammtypes.Pool, ...)
- func (k Keeper) AfterPoolCreated(ctx sdk.Context, sender sdk.AccAddress, ammPool ammtypes.Pool)
- func (k Keeper) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, ammPool ammtypes.Pool, input sdk.Coins, ...) error
- func (k Keeper) AmmHooks() AmmHooks
- func (k Keeper) AmmPoolBalanceCheck(ctx sdk.Context, poolId uint64) error
- func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)
- func (k Keeper) BeginBlocker(ctx sdk.Context)
- func (k Keeper) Borrow(ctx sdk.Context, collateralAmount math.Int, custodyAmount math.Int, ...) error
- func (k Keeper) BorrowInterestRateComputation(ctx sdk.Context, pool types.Pool) (sdk.Dec, error)
- func (k Keeper) BorrowInterestRateComputationByPosition(ctx sdk.Context, pool types.Pool, ammPool ammtypes.Pool, ...) (sdk.Dec, error)
- func (k Keeper) CalcMTPBorrowInterestLiabilities(ctx sdk.Context, mtp *types.MTP, borrowInterestRate sdk.Dec, ...) (math.Int, error)
- func (k Keeper) CalcMTPConsolidateCollateral(ctx sdk.Context, mtp *types.MTP, baseCurrency string) error
- func (k Keeper) CalcMTPTakeProfitBorrowRate(ctx sdk.Context, mtp *types.MTP) (sdk.Dec, error)
- func (k Keeper) CalcMTPTakeProfitLiability(ctx sdk.Context, mtp *types.MTP, baseCurrency string) (math.Int, error)
- func (k Keeper) CalcMinCollateral(ctx sdk.Context, leverage sdk.Dec) (math.Int, error)
- func (k Keeper) CalculatePoolHealth(ctx sdk.Context, pool *types.Pool) sdk.Dec
- func (k Keeper) CalculatePoolHealthByPosition(ctx sdk.Context, pool *types.Pool, ammPool ammtypes.Pool, ...) sdk.Dec
- func (k Keeper) CheckIfWhitelisted(ctx sdk.Context, address string) bool
- func (k Keeper) CheckMaxOpenPositions(ctx sdk.Context) error
- func (k Keeper) CheckMinLiabilities(ctx sdk.Context, collateralAmount sdk.Coin, eta sdk.Dec, ammPool ammtypes.Pool, ...) error
- func (k Keeper) CheckPoolHealth(ctx sdk.Context, poolId uint64) error
- func (k Keeper) CheckSameAssetPosition(ctx sdk.Context, msg *types.MsgOpen) *types.MTP
- func (k Keeper) CheckUserAuthorization(ctx sdk.Context, msg *types.MsgOpen) error
- func (k Keeper) Close(ctx sdk.Context, msg *types.MsgClose) (*types.MsgCloseResponse, error)
- func (k Keeper) CloseLong(ctx sdk.Context, msg *types.MsgClose, baseCurrency string) (*types.MTP, math.Int, error)
- func (k Keeper) CloseShort(ctx sdk.Context, msg *types.MsgClose, baseCurrency string) (*types.MTP, math.Int, error)
- func (k Keeper) DestroyMTP(ctx sdk.Context, mtpAddress string, id uint64) error
- func (k Keeper) DewhitelistAddress(ctx sdk.Context, address string)
- func (k Keeper) EmitCloseEvent(ctx sdk.Context, mtp *types.MTP, repayAmount math.Int)
- func (k Keeper) EmitForceClose(ctx sdk.Context, mtp *types.MTP, repayAmount math.Int, closer string)
- func (k Keeper) EmitFundPayment(ctx sdk.Context, mtp *types.MTP, takeAmount math.Int, takeAsset string, ...)
- func (k Keeper) EmitFundingFeePayment(ctx sdk.Context, mtp *types.MTP, takeAmount math.Int, takeAsset string, ...)
- func (k Keeper) EmitOpenEvent(ctx sdk.Context, mtp *types.MTP)
- func (k Keeper) EstimateAndRepay(ctx sdk.Context, mtp types.MTP, pool types.Pool, ammPool ammtypes.Pool, ...) (math.Int, error)
- func (k Keeper) EstimateSwap(ctx sdk.Context, tokenInAmount sdk.Coin, tokenOutDenom string, ...) (math.Int, error)
- func (k Keeper) EstimateSwapGivenOut(ctx sdk.Context, tokenOutAmount sdk.Coin, tokenInDenom string, ...) (math.Int, error)
- func (k Keeper) ForceCloseLong(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, takeFundPayment bool, ...) (math.Int, error)
- func (k Keeper) ForceCloseShort(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, takeFundPayment bool, ...) (math.Int, error)
- func (k Keeper) GetAllMTPs(ctx sdk.Context) []types.MTP
- func (k Keeper) GetAllPools(ctx sdk.Context) (list []types.Pool)
- func (k Keeper) GetAllWhitelistedAddress(ctx sdk.Context) []string
- func (k Keeper) GetAmmPool(ctx sdk.Context, poolId uint64, tradingAsset string) (ammtypes.Pool, error)
- func (k Keeper) GetBestPool(ctx sdk.Context, collateralAsset string, tradingAsset string) (uint64, error)
- func (k Keeper) GetBorrowInterestRateDecrease(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetBorrowInterestRateIncrease(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetBorrowInterestRateMax(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetBorrowInterestRateMin(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetEnabledPools(ctx sdk.Context) []uint64
- func (k Keeper) GetEpochLength(ctx sdk.Context) int64
- func (k Keeper) GetEpochPosition(ctx sdk.Context, epochLength int64) int64
- func (k Keeper) GetForceCloseFundAddress(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetForceCloseFundPercentage(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetFundingFeeBaseRate(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetFundingFeeCollectionAddress(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetFundingFeeMaxRate(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetFundingFeeMinRate(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetHealthGainFactor(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetIncrementalBorrowInterestPaymentEnabled(ctx sdk.Context) bool
- func (k Keeper) GetIncrementalBorrowInterestPaymentFundAddress(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetIncrementalBorrowInterestPaymentFundPercentage(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetMTP(ctx sdk.Context, mtpAddress string, id uint64) (types.MTP, error)
- func (k Keeper) GetMTPCount(ctx sdk.Context) uint64
- func (k Keeper) GetMTPIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetMTPs(ctx sdk.Context, pagination *query.PageRequest) ([]*types.MTP, *query.PageResponse, error)
- func (k Keeper) GetMTPsForAddress(ctx sdk.Context, mtpAddress sdk.Address, pagination *query.PageRequest) ([]*types.MTP, *query.PageResponse, error)
- func (k Keeper) GetMTPsForPool(ctx sdk.Context, ammPoolId uint64, pagination *query.PageRequest) ([]*types.MTP, *query.PageResponse, error)
- func (k Keeper) GetMaxLeverageParam(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetMaxOpenPositions(ctx sdk.Context) uint64
- func (k Keeper) GetOpenMTPCount(ctx sdk.Context) uint64
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPool(ctx sdk.Context, poolId uint64) (val types.Pool, found bool)
- func (k Keeper) GetPoolOpenThreshold(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetPositions(goCtx context.Context, req *types.PositionsRequest) (*types.PositionsResponse, error)
- func (k Keeper) GetPositionsByPool(goCtx context.Context, req *types.PositionsByPoolRequest) (*types.PositionsByPoolResponse, error)
- func (k Keeper) GetPositionsForAddress(goCtx context.Context, req *types.PositionsForAddressRequest) (*types.PositionsForAddressResponse, error)
- func (k Keeper) GetSafetyFactor(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetStatus(goCtx context.Context, req *types.StatusRequest) (*types.StatusResponse, error)
- func (k Keeper) GetSwapFee(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetTakeProfitBorrowInterestRateMin(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetWhitelist(goCtx context.Context, req *types.WhitelistRequest) (*types.WhitelistResponse, error)
- func (k Keeper) GetWhitelistAddressIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetWhitelistedAddress(ctx sdk.Context, pagination *query.PageRequest) ([]string, *query.PageResponse, error)
- func (k Keeper) HandleBorrowInterest(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, ammPool ammtypes.Pool) error
- func (k Keeper) HandleBorrowInterestPayment(ctx sdk.Context, borrowInterestPayment math.Int, mtp *types.MTP, ...) math.Int
- func (k Keeper) HandleFundingFeeCollection(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, ammPool ammtypes.Pool, ...) error
- func (k Keeper) HandleFundingFeeDistribution(ctx sdk.Context, mtps []*types.MTP, pool *types.Pool, ammPool ammtypes.Pool, ...) error
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IncrementalBorrowInterestPayment(ctx sdk.Context, borrowInterestPayment math.Int, mtp *types.MTP, ...) (math.Int, error)
- func (k Keeper) InvariantCheck(ctx sdk.Context) error
- func (k Keeper) IsPoolClosed(ctx sdk.Context, poolId uint64) bool
- func (k Keeper) IsPoolEnabled(ctx sdk.Context, poolId uint64) bool
- func (k Keeper) IsWhitelisted(goCtx context.Context, req *types.IsWhitelistedRequest) (*types.IsWhitelistedResponse, error)
- func (k Keeper) IsWhitelistingEnabled(ctx sdk.Context) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MTP(goCtx context.Context, req *types.MTPRequest) (*types.MTPResponse, error)
- func (k Keeper) Open(ctx sdk.Context, msg *types.MsgOpen) (*types.MsgOpenResponse, error)
- func (k Keeper) OpenConsolidate(ctx sdk.Context, existingMtp *types.MTP, newMtp *types.MTP, msg *types.MsgOpen, ...) (*types.MsgOpenResponse, error)
- func (k Keeper) OpenConsolidateLong(ctx sdk.Context, poolId uint64, existingMtp *types.MTP, newMtp *types.MTP, ...) (*types.MTP, error)
- func (k Keeper) OpenConsolidateShort(ctx sdk.Context, poolId uint64, existingMtp *types.MTP, newMtp *types.MTP, ...) (*types.MTP, error)
- func (k Keeper) OpenEstimation(goCtx context.Context, req *types.QueryOpenEstimationRequest) (*types.QueryOpenEstimationResponse, error)
- func (k Keeper) OpenLong(ctx sdk.Context, poolId uint64, msg *types.MsgOpen, baseCurrency string) (*types.MTP, error)
- func (k Keeper) OpenShort(ctx sdk.Context, poolId uint64, msg *types.MsgOpen, baseCurrency string) (*types.MTP, error)
- func (k Keeper) Params(goCtx context.Context, req *types.ParamsRequest) (*types.ParamsResponse, error)
- func (k Keeper) Pool(goCtx context.Context, req *types.QueryGetPoolRequest) (*types.QueryGetPoolResponse, error)
- func (k Keeper) Pools(goCtx context.Context, req *types.QueryAllPoolRequest) (*types.QueryAllPoolResponse, error)
- func (k Keeper) PreparePools(ctx sdk.Context, collateralAsset, tradingAsset string) (poolId uint64, ammPool ammtypes.Pool, pool types.Pool, err error)
- func (k Keeper) ProcessOpenLong(ctx sdk.Context, mtp *types.MTP, leverage sdk.Dec, eta sdk.Dec, ...) (*types.MTP, error)
- func (k Keeper) ProcessOpenShort(ctx sdk.Context, mtp *types.MTP, leverage sdk.Dec, eta sdk.Dec, ...) (*types.MTP, error)
- func (k Keeper) RemovePool(ctx sdk.Context, index uint64)
- func (k Keeper) Repay(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, ammPool ammtypes.Pool, ...) error
- func (k Keeper) ResetStore(ctx sdk.Context) error
- func (k Keeper) SetEnabledPools(ctx sdk.Context, pools []uint64)
- func (k *Keeper) SetHooks(gh types.PerpetualHooks) *Keeper
- func (k Keeper) SetMTP(ctx sdk.Context, mtp *types.MTP) error
- func (k Keeper) SetMTPCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetOpenMTPCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params *types.Params) error
- func (k Keeper) SetPool(ctx sdk.Context, pool types.Pool)
- func (k Keeper) TakeFundPayment(ctx sdk.Context, returnAmount math.Int, returnAsset string, ...) (math.Int, error)
- func (k Keeper) TakeInCustody(ctx sdk.Context, mtp types.MTP, pool *types.Pool) error
- func (k Keeper) TakeOutCustody(ctx sdk.Context, mtp types.MTP, pool *types.Pool, amount math.Int) error
- func (k Keeper) UpdateFundingRate(ctx sdk.Context, pool *types.Pool) error
- func (k Keeper) UpdateMTPHealth(ctx sdk.Context, mtp types.MTP, ammPool ammtypes.Pool, baseCurrency string) (sdk.Dec, error)
- func (k Keeper) UpdatePoolHealth(ctx sdk.Context, pool *types.Pool) error
- func (k Keeper) WhitelistAddress(ctx sdk.Context, address string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeginBlockerProcessMTP ¶
func NewMsgServerImpl ¶
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 tvl 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 ¶
AfterPoolCreated is called after CreatePool
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for incentive keeper
func (Hooks) AfterEpochEnd ¶
AfterEpochEnd implements EpochHooks
type Keeper ¶
type Keeper struct { types.AuthorizationChecker types.PositionChecker types.PoolChecker types.OpenChecker types.OpenLongChecker types.OpenShortChecker types.CloseLongChecker types.CloseShortChecker // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, authority string, amm types.AmmKeeper, bk types.BankKeeper, oracleKeeper ammtypes.OracleKeeper, assetProfileKeeper types.AssetProfileKeeper, parameterKeeper *pkeeper.Keeper, ) *Keeper
func (Keeper) AfterEpochEnd ¶
AfterEpochEnd distributes vested tokens at the end of each epoch
func (Keeper) AfterExitPool ¶
func (k Keeper) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, ammPool ammtypes.Pool, 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, ammPool ammtypes.Pool, enterCoins sdk.Coins, shareOutAmount math.Int)
AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut
func (Keeper) AfterPoolCreated ¶
AfterPoolCreated is called after CreatePool
func (Keeper) AfterSwap ¶
func (k Keeper) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, ammPool ammtypes.Pool, input sdk.Coins, output sdk.Coins) error
AfterSwap is called after SwapExactAmountIn and SwapExactAmountOut
func (Keeper) AmmPoolBalanceCheck ¶
func (Keeper) BeforeEpochStart ¶
BeforeEpochStart performs a no-op
func (Keeper) BeginBlocker ¶
func (Keeper) BorrowInterestRateComputation ¶
func (Keeper) BorrowInterestRateComputationByPosition ¶
func (Keeper) CalcMTPBorrowInterestLiabilities ¶
func (Keeper) CalcMTPConsolidateCollateral ¶
func (Keeper) CalcMTPTakeProfitBorrowRate ¶
func (Keeper) CalcMTPTakeProfitLiability ¶
func (Keeper) CalcMinCollateral ¶
CalcMinCollateral calculates the minimum collateral required to open a position
func (Keeper) CalculatePoolHealth ¶
func (Keeper) CalculatePoolHealthByPosition ¶
func (Keeper) CheckIfWhitelisted ¶
func (Keeper) CheckMinLiabilities ¶
func (Keeper) CheckPoolHealth ¶
func (Keeper) CheckSameAssetPosition ¶
func (Keeper) CheckUserAuthorization ¶
func (Keeper) CloseShort ¶
func (Keeper) DestroyMTP ¶
func (Keeper) DewhitelistAddress ¶
func (Keeper) EmitCloseEvent ¶ added in v0.29.3
func (Keeper) EmitForceClose ¶
func (Keeper) EmitFundPayment ¶
func (Keeper) EmitFundingFeePayment ¶
func (Keeper) EstimateAndRepay ¶
func (Keeper) EstimateSwap ¶
func (k Keeper) EstimateSwap(ctx sdk.Context, tokenInAmount sdk.Coin, tokenOutDenom string, ammPool ammtypes.Pool) (math.Int, error)
Swap estimation using amm CalcOutAmtGivenIn function
func (Keeper) EstimateSwapGivenOut ¶
func (k Keeper) EstimateSwapGivenOut(ctx sdk.Context, tokenOutAmount sdk.Coin, tokenInDenom string, ammPool ammtypes.Pool) (math.Int, error)
Swap estimation using amm CalcInAmtGivenOut function
func (Keeper) ForceCloseLong ¶
func (Keeper) ForceCloseShort ¶
func (Keeper) GetAllPools ¶
GetAllPool returns all pool
func (Keeper) GetAllWhitelistedAddress ¶
func (Keeper) GetAmmPool ¶
func (Keeper) GetBestPool ¶
func (Keeper) GetBorrowInterestRateDecrease ¶
func (Keeper) GetBorrowInterestRateIncrease ¶
func (Keeper) GetBorrowInterestRateMax ¶
func (Keeper) GetBorrowInterestRateMin ¶
func (Keeper) GetEpochPosition ¶
get position of current block in epoch
func (Keeper) GetForceCloseFundAddress ¶
func (k Keeper) GetForceCloseFundAddress(ctx sdk.Context) sdk.AccAddress
func (Keeper) GetForceCloseFundPercentage ¶
func (Keeper) GetFundingFeeBaseRate ¶
func (Keeper) GetFundingFeeCollectionAddress ¶
func (k Keeper) GetFundingFeeCollectionAddress(ctx sdk.Context) sdk.AccAddress
func (Keeper) GetIncrementalBorrowInterestPaymentEnabled ¶
func (Keeper) GetIncrementalBorrowInterestPaymentFundAddress ¶
func (k Keeper) GetIncrementalBorrowInterestPaymentFundAddress(ctx sdk.Context) sdk.AccAddress
func (Keeper) GetIncrementalBorrowInterestPaymentFundPercentage ¶
func (Keeper) GetMTPs ¶
func (k Keeper) GetMTPs(ctx sdk.Context, pagination *query.PageRequest) ([]*types.MTP, *query.PageResponse, error)
func (Keeper) GetMTPsForAddress ¶
func (Keeper) GetMTPsForPool ¶
func (Keeper) GetPositions ¶
func (k Keeper) GetPositions(goCtx context.Context, req *types.PositionsRequest) (*types.PositionsResponse, error)
func (Keeper) GetPositionsByPool ¶
func (k Keeper) GetPositionsByPool(goCtx context.Context, req *types.PositionsByPoolRequest) (*types.PositionsByPoolResponse, error)
func (Keeper) GetPositionsForAddress ¶
func (k Keeper) GetPositionsForAddress(goCtx context.Context, req *types.PositionsForAddressRequest) (*types.PositionsForAddressResponse, error)
func (Keeper) GetStatus ¶
func (k Keeper) GetStatus(goCtx context.Context, req *types.StatusRequest) (*types.StatusResponse, error)
func (Keeper) GetTakeProfitBorrowInterestRateMin ¶
func (Keeper) GetWhitelist ¶
func (k Keeper) GetWhitelist(goCtx context.Context, req *types.WhitelistRequest) (*types.WhitelistResponse, error)
func (Keeper) GetWhitelistAddressIterator ¶
func (Keeper) GetWhitelistedAddress ¶
func (k Keeper) GetWhitelistedAddress(ctx sdk.Context, pagination *query.PageRequest) ([]string, *query.PageResponse, error)
func (Keeper) HandleBorrowInterest ¶
func (Keeper) HandleBorrowInterestPayment ¶
func (Keeper) HandleFundingFeeCollection ¶
func (k Keeper) HandleFundingFeeCollection(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, ammPool ammtypes.Pool, baseCurrency string) error
HandleFundingFeeCollection handles funding fee collection
func (Keeper) HandleFundingFeeDistribution ¶
func (k Keeper) HandleFundingFeeDistribution(ctx sdk.Context, mtps []*types.MTP, pool *types.Pool, ammPool ammtypes.Pool, baseCurrency string) error
HandleFundingFeeDistribution handles funding fee distribution
func (Keeper) IncrementalBorrowInterestPayment ¶
func (Keeper) InvariantCheck ¶
Check if amm pool balance in bank module is correct
func (Keeper) IsWhitelisted ¶
func (k Keeper) IsWhitelisted(goCtx context.Context, req *types.IsWhitelistedRequest) (*types.IsWhitelistedResponse, error)
func (Keeper) MTP ¶
func (k Keeper) MTP(goCtx context.Context, req *types.MTPRequest) (*types.MTPResponse, error)
func (Keeper) OpenConsolidate ¶
func (Keeper) OpenConsolidateLong ¶
func (Keeper) OpenConsolidateShort ¶
func (Keeper) OpenEstimation ¶
func (k Keeper) OpenEstimation(goCtx context.Context, req *types.QueryOpenEstimationRequest) (*types.QueryOpenEstimationResponse, error)
func (Keeper) Params ¶
func (k Keeper) Params(goCtx context.Context, req *types.ParamsRequest) (*types.ParamsResponse, error)
func (Keeper) Pool ¶
func (k Keeper) Pool(goCtx context.Context, req *types.QueryGetPoolRequest) (*types.QueryGetPoolResponse, error)
func (Keeper) Pools ¶
func (k Keeper) Pools(goCtx context.Context, req *types.QueryAllPoolRequest) (*types.QueryAllPoolResponse, error)
func (Keeper) PreparePools ¶
func (k Keeper) PreparePools(ctx sdk.Context, collateralAsset, tradingAsset string) (poolId uint64, ammPool ammtypes.Pool, pool types.Pool, err error)
PreparePools creates accounted pools
func (Keeper) ProcessOpenLong ¶
func (Keeper) ProcessOpenShort ¶
func (Keeper) RemovePool ¶
RemovePool removes a pool from the store
func (Keeper) ResetStore ¶
ResetStore resets all keys in the perpetual module store
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(gh types.PerpetualHooks) *Keeper
Set the perpetual hooks.
func (Keeper) SetMTPCount ¶
Set MTP count
func (Keeper) SetOpenMTPCount ¶
Set Open MTP count
func (Keeper) TakeFundPayment ¶
func (Keeper) TakeInCustody ¶
func (Keeper) TakeOutCustody ¶
func (Keeper) UpdateFundingRate ¶
UpdateFundingRate updates the funding rate of a pool
func (Keeper) UpdateMTPHealth ¶
func (Keeper) UpdatePoolHealth ¶
Source Files ¶
- begin_blocker.go
- begin_blocker_process_mtp.go
- calc_min_collateral.go
- calc_mtp_consolidate_collateral.go
- calc_mtp_interest_liabilities.go
- calc_mtp_take_profit_borrow_rate.go
- calc_mtp_take_profit_liabilities.go
- check_max_open_positions.go
- check_pool_health.go
- check_same_asset_position.go
- check_user_authorization.go
- close.go
- close_long.go
- close_short.go
- emit_close_event.go
- emit_open_event.go
- estimate_and_repay.go
- estimate_swap.go
- events.go
- force_close_long.go
- force_close_short.go
- get_amm_pool.go
- get_best_pool.go
- get_epoch_length.go
- get_epoch_position.go
- get_mtp.go
- get_params.go
- get_pool.go
- handle_borrow_interest.go
- handle_borrow_interest_payment.go
- handle_funding_fee_collection.go
- handle_funding_fee_distribution.go
- hooks_amm.go
- hooks_epoch.go
- invariant_check.go
- keeper.go
- msg_server.go
- msg_server_close.go
- msg_server_dewhitelist.go
- msg_server_open.go
- msg_server_update_params.go
- msg_server_whitelist.go
- open.go
- open_consolidate.go
- open_consolidate_long.go
- open_consolidate_short.go
- open_long.go
- open_long_process.go
- open_short.go
- open_short_process.go
- params.go
- pool.go
- prepare_pools.go
- query.go
- query_get_positions.go
- query_get_positions_by_pool.go
- query_get_positions_for_address.go
- query_get_status.go
- query_get_whitelist.go
- query_is_whitelisted.go
- query_mtp.go
- query_open_estimation.go
- query_params.go
- query_pool.go
- repay.go
- reset_store.go
- set_pool.go
- take_out_custody.go
- update_funding_rate.go
- update_mtp_health.go