Documentation ¶
Index ¶
- func CalcMTPInterestLiabilities(mtp *types.MTP, interestRate sdk.Dec, epochPosition, epochLength int64) sdk.Int
- func GetEpochPosition(ctx sdk.Context, epochLength int64) int64
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) Borrow(ctx sdk.Context, collateralAsset string, collateralAmount sdk.Int, ...) error
- func (k Keeper) CalculatePoolHealth(ctx sdk.Context, pool *types.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, pool types.Pool, ...) error
- func (k Keeper) CheckPoolHealth(ctx sdk.Context, poolId uint64) error
- func (k Keeper) CheckUserAuthorization(ctx sdk.Context, msg *types.MsgOpen) 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) EmitFundPayment(ctx sdk.Context, mtp *types.MTP, takeAmount sdk.Int, takeAsset string, ...)
- func (k Keeper) EstimateSwap(ctx sdk.Context, tokenInAmount sdk.Coin, tokenOutDenom string, ...) (sdk.Int, error)
- func (k Keeper) GenerateOpenEvent(mtp *types.MTP) sdk.Event
- 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, nonNativeAsset string) (ammtypes.Pool, error)
- func (k Keeper) GetAmmPoolBalance(ctx sdk.Context, ammPool ammtypes.Pool, assetDenom string) (sdk.Int, error)
- func (k Keeper) GetEnabledPools(ctx sdk.Context) []uint64
- func (k Keeper) GetEpochLength(ctx sdk.Context) int64
- func (k Keeper) GetFirstValidPool(ctx sdk.Context, borrowAsset string) (uint64, error)
- func (k Keeper) GetForceCloseFundAddress(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetForceCloseFundPercentage(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetHealthGainFactor(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetIncrementalInterestPaymentEnabled(ctx sdk.Context) bool
- func (k Keeper) GetIncrementalInterestPaymentFundAddress(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetIncrementalInterestPaymentFundPercentage(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetInterestRateDecrease(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetInterestRateIncrease(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetInterestRateMax(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetInterestRateMin(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) int64
- func (k Keeper) GetNonNativeAsset(collateralAsset string, borrowAsset string) string
- 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) 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) HandleInterestPayment(ctx sdk.Context, interestPayment sdk.Int, mtp *types.MTP, pool *types.Pool, ...) sdk.Int
- func (k Keeper) HasSufficientPoolBalance(ctx sdk.Context, ammPool ammtypes.Pool, assetDenom string, ...) bool
- func (k Keeper) IncrementalInterestPayment(ctx sdk.Context, interestPayment sdk.Int, mtp *types.MTP, pool *types.Pool, ...) (sdk.Int, error)
- func (k Keeper) InterestRateComputation(ctx sdk.Context, pool types.Pool, ammPool ammtypes.Pool) (sdk.Dec, 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) OpenLong(ctx sdk.Context, poolId uint64, msg *types.MsgOpen) (*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) 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) SetEnabledPools(ctx sdk.Context, pools []uint64)
- 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) error
- func (k Keeper) UpdateMTPHealth(ctx sdk.Context, mtp types.MTP, ammPool ammtypes.Pool) (sdk.Dec, error)
- func (k Keeper) UpdatePoolHealth(ctx sdk.Context, pool *types.Pool) error
- func (k Keeper) ValidateCollateralAsset(collateralAsset string) error
- func (k Keeper) WhitelistAddress(ctx sdk.Context, address string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcMTPInterestLiabilities ¶ added in v0.10.0
func GetEpochPosition ¶ added in v0.10.0
get position of current block in epoch
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct { types.AuthorizationChecker types.PositionChecker types.PoolChecker types.OpenLongChecker // 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, ) *Keeper
func (Keeper) CalculatePoolHealth ¶ added in v0.10.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) CheckUserAuthorization ¶ added in v0.10.0
func (Keeper) DestroyMTP ¶ added in v0.10.0
func (Keeper) DewhitelistAddress ¶ added in v0.10.0
func (Keeper) EmitFundPayment ¶ added in v0.10.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) GenerateOpenEvent ¶ added in v0.10.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) GetAmmPoolBalance ¶ added in v0.10.0
func (k Keeper) GetAmmPoolBalance(ctx sdk.Context, ammPool ammtypes.Pool, assetDenom string) (sdk.Int, error)
Get balance of a denom
func (Keeper) GetEnabledPools ¶ added in v0.10.0
func (Keeper) GetEpochLength ¶ added in v0.10.0
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) GetHealthGainFactor ¶ added in v0.10.0
func (Keeper) GetIncrementalInterestPaymentEnabled ¶ added in v0.10.0
func (Keeper) GetIncrementalInterestPaymentFundAddress ¶ added in v0.10.0
func (k Keeper) GetIncrementalInterestPaymentFundAddress(ctx sdk.Context) sdk.AccAddress
func (Keeper) GetIncrementalInterestPaymentFundPercentage ¶ added in v0.10.0
func (Keeper) GetInterestRateDecrease ¶ added in v0.10.0
func (Keeper) GetInterestRateIncrease ¶ added in v0.10.0
func (Keeper) GetInterestRateMax ¶ added in v0.10.0
func (Keeper) GetInterestRateMin ¶ added in v0.10.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) GetNonNativeAsset ¶ 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) 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) HandleInterestPayment ¶ added in v0.10.0
func (Keeper) HasSufficientPoolBalance ¶ added in v0.10.0
func (k Keeper) HasSufficientPoolBalance(ctx sdk.Context, ammPool ammtypes.Pool, assetDenom string, requiredAmount sdk.Int) bool
Check if amm pool has sufficcient balance
func (Keeper) IncrementalInterestPayment ¶ added in v0.10.0
func (Keeper) InterestRateComputation ¶ added in v0.10.0
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) 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) RemovePool ¶ added in v0.10.0
RemovePool removes a pool from the store
func (Keeper) SetEnabledPools ¶ added in v0.10.0
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) UpdateMTPHealth ¶ added in v0.10.0
func (Keeper) UpdatePoolHealth ¶ added in v0.10.0
func (Keeper) ValidateCollateralAsset ¶ added in v0.10.0
Source Files ¶
- check_max_open_positions.go
- check_pool_health.go
- check_user_authorization.go
- events.go
- generate_open_event.go
- get_amm_pool.go
- get_amm_pool_balance.go
- get_first_valid_pool.go
- get_none_native_asset.go
- has_sufficient_pool_balance.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_long.go
- params.go
- pool.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_params.go
- query_pool.go
- validate_collateral_asset.go
Click to show internal directories.
Click to hide internal directories.