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 sdk.Int, custodyAmount sdk.Int, ...) error
- func (k Keeper) BorrowInterestRateComputation(ctx sdk.Context, pool types.Pool, ammPool ammtypes.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, ...) (sdk.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) (sdk.Int, error)
- func (k Keeper) CalcMinCollateral(ctx sdk.Context, leverage sdk.Dec) (sdk.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, sdk.Int, error)
- func (k Keeper) CloseShort(ctx sdk.Context, msg *types.MsgClose, baseCurrency string) (*types.MTP, sdk.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) EmitForceClose(ctx sdk.Context, mtp *types.MTP, repayAmount sdk.Int, closer string)
- func (k Keeper) EmitFundPayment(ctx sdk.Context, mtp *types.MTP, takeAmount sdk.Int, takeAsset string, ...)
- func (k Keeper) EmitFundingFeePayment(ctx sdk.Context, mtp *types.MTP, takeAmount sdk.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, ...) (sdk.Int, error)
- func (k Keeper) EstimateSwap(ctx sdk.Context, tokenInAmount sdk.Coin, tokenOutDenom string, ...) (sdk.Int, error)
- func (k Keeper) EstimateSwapGivenOut(ctx sdk.Context, tokenOutAmount sdk.Coin, tokenInDenom string, ...) (sdk.Int, error)
- func (k Keeper) ForceCloseLong(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, takeFundPayment bool, ...) (sdk.Int, error)
- func (k Keeper) ForceCloseShort(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, takeFundPayment bool, ...) (sdk.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) 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) GetFirstValidPool(ctx sdk.Context, collateralAsset string, tradingAsset string) (uint64, error)
- 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) GetRemovalQueueThreshold(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetSafetyFactor(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetSqModifier(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 sdk.Int, mtp *types.MTP, ...) sdk.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 sdk.Int, mtp *types.MTP, ...) (sdk.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, mtp *types.MTP, msg *types.MsgOpen, baseCurrency string) (*types.MsgOpenResponse, error)
- func (k Keeper) OpenConsolidateLong(ctx sdk.Context, poolId uint64, mtp *types.MTP, msg *types.MsgOpen, ...) (*types.MTP, error)
- func (k Keeper) OpenConsolidateShort(ctx sdk.Context, poolId uint64, mtp *types.MTP, msg *types.MsgOpen, ...) (*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.MarginHooks) *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 sdk.Int, returnAsset string, ...) (sdk.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 sdk.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 ¶ added in v0.12.0
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type AmmHooks ¶ added in v0.11.0
type AmmHooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for tvl keeper
func (AmmHooks) AfterExitPool ¶ added in v0.11.0
func (h AmmHooks) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, shareInAmount sdk.Int, exitCoins sdk.Coins) error
AfterExitPool is called after ExitPool, ExitSwapShareAmountIn, and ExitSwapExternAmountOut
func (AmmHooks) AfterJoinPool ¶ added in v0.11.0
func (h AmmHooks) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, pool ammtypes.Pool, enterCoins sdk.Coins, shareOutAmount sdk.Int)
AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut
func (AmmHooks) AfterPoolCreated ¶ added in v0.11.0
AfterPoolCreated is called after CreatePool
type Hooks ¶ added in v0.11.0
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for incentive keeper
func (Hooks) AfterEpochEnd ¶ added in v0.11.0
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 ¶ added in v0.11.0
AfterEpochEnd distributes vested tokens at the end of each epoch
func (Keeper) AfterExitPool ¶ added in v0.11.0
func (k Keeper) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, ammPool ammtypes.Pool, shareInAmount sdk.Int, exitCoins sdk.Coins) error
AfterExitPool is called after ExitPool, ExitSwapShareAmountIn, and ExitSwapExternAmountOut
func (Keeper) AfterJoinPool ¶ added in v0.11.0
func (k Keeper) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, ammPool ammtypes.Pool, enterCoins sdk.Coins, shareOutAmount sdk.Int)
AfterJoinPool is called after JoinPool, JoinSwapExternAmountIn, and JoinSwapShareAmountOut
func (Keeper) AfterPoolCreated ¶ added in v0.11.0
AfterPoolCreated is called after CreatePool
func (Keeper) AfterSwap ¶ added in v0.11.0
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 ¶ added in v0.11.0
func (Keeper) BeforeEpochStart ¶ added in v0.11.0
BeforeEpochStart performs a no-op
func (Keeper) BeginBlocker ¶ added in v0.12.0
func (Keeper) BorrowInterestRateComputation ¶ added in v0.15.0
func (Keeper) BorrowInterestRateComputationByPosition ¶ added in v0.15.0
func (Keeper) CalcMTPBorrowInterestLiabilities ¶ added in v0.15.0
func (Keeper) CalcMTPConsolidateCollateral ¶ added in v0.12.0
func (Keeper) CalcMTPTakeProfitBorrowRate ¶ added in v0.16.0
func (Keeper) CalcMTPTakeProfitLiability ¶ added in v0.16.0
func (Keeper) CalcMinCollateral ¶ added in v0.19.0
CalcMinCollateral calculates the minimum collateral required to open a position
func (Keeper) CalculatePoolHealth ¶ added in v0.10.0
func (Keeper) CalculatePoolHealthByPosition ¶ added in v0.15.0
func (Keeper) CheckIfWhitelisted ¶ added in v0.10.0
func (Keeper) CheckMaxOpenPositions ¶ added in v0.10.0
func (Keeper) CheckMinLiabilities ¶ added in v0.10.0
func (Keeper) CheckPoolHealth ¶ added in v0.10.0
func (Keeper) CheckSameAssetPosition ¶ added in v0.16.0
func (Keeper) CheckUserAuthorization ¶ added in v0.10.0
func (Keeper) CloseShort ¶ added in v0.12.0
func (Keeper) DestroyMTP ¶ added in v0.10.0
func (Keeper) DewhitelistAddress ¶ added in v0.10.0
func (Keeper) EmitForceClose ¶ added in v0.13.0
func (Keeper) EmitFundPayment ¶ added in v0.10.0
func (Keeper) EmitFundingFeePayment ¶ added in v0.16.0
func (Keeper) EmitOpenEvent ¶ added in v0.12.0
func (Keeper) EstimateAndRepay ¶ added in v0.12.0
func (Keeper) EstimateSwap ¶ added in v0.10.0
func (k Keeper) EstimateSwap(ctx sdk.Context, tokenInAmount sdk.Coin, tokenOutDenom string, ammPool ammtypes.Pool) (sdk.Int, error)
Swap estimation using amm CalcOutAmtGivenIn function
func (Keeper) EstimateSwapGivenOut ¶ added in v0.12.0
func (k Keeper) EstimateSwapGivenOut(ctx sdk.Context, tokenOutAmount sdk.Coin, tokenInDenom string, ammPool ammtypes.Pool) (sdk.Int, error)
Swap estimation using amm CalcInAmtGivenOut function
func (Keeper) ForceCloseLong ¶ added in v0.13.0
func (Keeper) ForceCloseShort ¶ added in v0.13.0
func (Keeper) GetAllPools ¶ added in v0.10.0
GetAllPool returns all pool
func (Keeper) GetAllWhitelistedAddress ¶ added in v0.10.0
func (Keeper) GetAmmPool ¶ added in v0.10.0
func (Keeper) GetBorrowInterestRateDecrease ¶ added in v0.15.0
func (Keeper) GetBorrowInterestRateIncrease ¶ added in v0.15.0
func (Keeper) GetBorrowInterestRateMax ¶ added in v0.15.0
func (Keeper) GetBorrowInterestRateMin ¶ added in v0.15.0
func (Keeper) GetEnabledPools ¶ added in v0.10.0
func (Keeper) GetEpochLength ¶ added in v0.10.0
func (Keeper) GetEpochPosition ¶ added in v0.12.0
get position of current block in epoch
func (Keeper) GetFirstValidPool ¶ added in v0.10.0
func (Keeper) GetForceCloseFundAddress ¶ added in v0.10.0
func (k Keeper) GetForceCloseFundAddress(ctx sdk.Context) sdk.AccAddress
func (Keeper) GetForceCloseFundPercentage ¶ added in v0.10.0
func (Keeper) GetFundingFeeBaseRate ¶ added in v0.16.0
func (Keeper) GetFundingFeeCollectionAddress ¶ added in v0.16.0
func (k Keeper) GetFundingFeeCollectionAddress(ctx sdk.Context) sdk.AccAddress
func (Keeper) GetFundingFeeMaxRate ¶ added in v0.16.0
func (Keeper) GetFundingFeeMinRate ¶ added in v0.16.0
func (Keeper) GetHealthGainFactor ¶ added in v0.10.0
func (Keeper) GetIncrementalBorrowInterestPaymentEnabled ¶ added in v0.15.0
func (Keeper) GetIncrementalBorrowInterestPaymentFundAddress ¶ added in v0.15.0
func (k Keeper) GetIncrementalBorrowInterestPaymentFundAddress(ctx sdk.Context) sdk.AccAddress
func (Keeper) GetIncrementalBorrowInterestPaymentFundPercentage ¶ added in v0.15.0
func (Keeper) GetMTPIterator ¶ added in v0.10.0
func (Keeper) GetMTPs ¶ added in v0.10.0
func (k Keeper) GetMTPs(ctx sdk.Context, pagination *query.PageRequest) ([]*types.MTP, *query.PageResponse, error)
func (Keeper) GetMTPsForAddress ¶ added in v0.10.0
func (Keeper) GetMTPsForPool ¶ added in v0.10.0
func (Keeper) GetMaxLeverageParam ¶ added in v0.10.0
func (Keeper) GetMaxOpenPositions ¶ added in v0.10.0
func (Keeper) GetOpenMTPCount ¶ added in v0.10.0
func (Keeper) GetPoolOpenThreshold ¶ added in v0.10.0
func (Keeper) GetPositions ¶ added in v0.10.0
func (k Keeper) GetPositions(goCtx context.Context, req *types.PositionsRequest) (*types.PositionsResponse, error)
func (Keeper) GetPositionsByPool ¶ added in v0.10.0
func (k Keeper) GetPositionsByPool(goCtx context.Context, req *types.PositionsByPoolRequest) (*types.PositionsByPoolResponse, error)
func (Keeper) GetPositionsForAddress ¶ added in v0.10.0
func (k Keeper) GetPositionsForAddress(goCtx context.Context, req *types.PositionsForAddressRequest) (*types.PositionsForAddressResponse, error)
func (Keeper) GetRemovalQueueThreshold ¶ added in v0.10.0
func (Keeper) GetSafetyFactor ¶ added in v0.10.0
func (Keeper) GetSqModifier ¶ added in v0.10.0
func (Keeper) GetStatus ¶ added in v0.10.0
func (k Keeper) GetStatus(goCtx context.Context, req *types.StatusRequest) (*types.StatusResponse, error)
func (Keeper) GetTakeProfitBorrowInterestRateMin ¶ added in v0.16.0
func (Keeper) GetWhitelist ¶ added in v0.10.0
func (k Keeper) GetWhitelist(goCtx context.Context, req *types.WhitelistRequest) (*types.WhitelistResponse, error)
func (Keeper) GetWhitelistAddressIterator ¶ added in v0.10.0
func (Keeper) GetWhitelistedAddress ¶ added in v0.10.0
func (k Keeper) GetWhitelistedAddress(ctx sdk.Context, pagination *query.PageRequest) ([]string, *query.PageResponse, error)
func (Keeper) HandleBorrowInterest ¶ added in v0.15.0
func (Keeper) HandleBorrowInterestPayment ¶ added in v0.15.0
func (Keeper) HandleFundingFeeCollection ¶ added in v0.16.0
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 ¶ added in v0.16.0
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 ¶ added in v0.15.0
func (Keeper) InvariantCheck ¶ added in v0.11.0
Check if amm pool balance in bank module is correct
func (Keeper) IsPoolClosed ¶ added in v0.10.0
func (Keeper) IsPoolEnabled ¶ added in v0.10.0
func (Keeper) IsWhitelisted ¶ added in v0.10.0
func (k Keeper) IsWhitelisted(goCtx context.Context, req *types.IsWhitelistedRequest) (*types.IsWhitelistedResponse, error)
func (Keeper) IsWhitelistingEnabled ¶ added in v0.10.0
func (Keeper) MTP ¶ added in v0.10.0
func (k Keeper) MTP(goCtx context.Context, req *types.MTPRequest) (*types.MTPResponse, error)
func (Keeper) OpenConsolidate ¶ added in v0.12.0
func (Keeper) OpenConsolidateLong ¶ added in v0.12.0
func (Keeper) OpenConsolidateShort ¶ added in v0.13.0
func (Keeper) OpenEstimation ¶ added in v0.19.0
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 ¶ added in v0.10.0
func (k Keeper) Pool(goCtx context.Context, req *types.QueryGetPoolRequest) (*types.QueryGetPoolResponse, error)
func (Keeper) Pools ¶ added in v0.10.0
func (k Keeper) Pools(goCtx context.Context, req *types.QueryAllPoolRequest) (*types.QueryAllPoolResponse, error)
func (Keeper) PreparePools ¶ added in v0.12.0
func (Keeper) ProcessOpenLong ¶ added in v0.12.0
func (Keeper) ProcessOpenShort ¶ added in v0.12.0
func (Keeper) RemovePool ¶ added in v0.10.0
RemovePool removes a pool from the store
func (Keeper) ResetStore ¶ added in v0.19.0
ResetStore resets all keys in the margin module store
func (Keeper) SetEnabledPools ¶ added in v0.10.0
func (*Keeper) SetHooks ¶ added in v0.11.0
func (k *Keeper) SetHooks(gh types.MarginHooks) *Keeper
Set the margin hooks.
func (Keeper) SetMTPCount ¶ added in v0.10.0
Set MTP count
func (Keeper) SetOpenMTPCount ¶ added in v0.10.0
Set Open MTP count
func (Keeper) TakeFundPayment ¶ added in v0.10.0
func (Keeper) TakeInCustody ¶ added in v0.10.0
func (Keeper) TakeOutCustody ¶ added in v0.10.0
func (Keeper) UpdateFundingRate ¶ added in v0.16.0
UpdateFundingRate updates the funding rate of a pool
func (Keeper) UpdateMTPHealth ¶ added in v0.10.0
func (Keeper) UpdatePoolHealth ¶ added in v0.10.0
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_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_epoch_length.go
- get_epoch_position.go
- get_first_valid_pool.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_update_pools.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