keeper

package
v0.9.0-test-purpose-3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcMTPInterestLiabilities added in v0.10.0

func CalcMTPInterestLiabilities(mtp *types.MTP, interestRate sdk.Dec, epochPosition, epochLength int64) sdk.Int

func GetEpochPosition added in v0.10.0

func GetEpochPosition(ctx sdk.Context, epochLength int64) int64

get position of current block in epoch

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	authority string,
	amm types.AmmKeeper,
	bk types.BankKeeper,
) *Keeper

func (Keeper) Borrow added in v0.10.0

func (k Keeper) Borrow(ctx sdk.Context, collateralAsset string, collateralAmount sdk.Int, custodyAmount sdk.Int, mtp *types.MTP, ammPool *ammtypes.Pool, pool *types.Pool, eta sdk.Dec) error

func (Keeper) CalculatePoolHealth added in v0.10.0

func (k Keeper) CalculatePoolHealth(ctx sdk.Context, pool *types.Pool) sdk.Dec

func (Keeper) CheckIfWhitelisted added in v0.10.0

func (k Keeper) CheckIfWhitelisted(ctx sdk.Context, address string) bool

func (Keeper) CheckMinLiabilities added in v0.10.0

func (k Keeper) CheckMinLiabilities(ctx sdk.Context, collateralAmount sdk.Coin, eta sdk.Dec, pool types.Pool, ammPool ammtypes.Pool, custodyAsset string) error

func (Keeper) DestroyMTP added in v0.10.0

func (k Keeper) DestroyMTP(ctx sdk.Context, mtpAddress string, id uint64) error

func (Keeper) EmitFundPayment added in v0.10.0

func (k Keeper) EmitFundPayment(ctx sdk.Context, mtp *types.MTP, takeAmount sdk.Int, takeAsset string, paymentType string)

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) GetAllPool

func (k Keeper) GetAllPool(ctx sdk.Context) (list []types.Pool)

GetAllPool returns all pool

func (Keeper) GetEnabledPools added in v0.10.0

func (k Keeper) GetEnabledPools(ctx sdk.Context) []uint64

func (Keeper) GetEpochLength added in v0.10.0

func (k Keeper) GetEpochLength(ctx sdk.Context) int64

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 (k Keeper) GetForceCloseFundPercentage(ctx sdk.Context) sdk.Dec

func (Keeper) GetHealthGainFactor added in v0.10.0

func (k Keeper) GetHealthGainFactor(ctx sdk.Context) sdk.Dec

func (Keeper) GetIncrementalInterestPaymentEnabled added in v0.10.0

func (k Keeper) GetIncrementalInterestPaymentEnabled(ctx sdk.Context) bool

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 (k Keeper) GetIncrementalInterestPaymentFundPercentage(ctx sdk.Context) sdk.Dec

func (Keeper) GetInterestRateDecrease added in v0.10.0

func (k Keeper) GetInterestRateDecrease(ctx sdk.Context) sdk.Dec

func (Keeper) GetInterestRateIncrease added in v0.10.0

func (k Keeper) GetInterestRateIncrease(ctx sdk.Context) sdk.Dec

func (Keeper) GetInterestRateMax added in v0.10.0

func (k Keeper) GetInterestRateMax(ctx sdk.Context) sdk.Dec

func (Keeper) GetInterestRateMin added in v0.10.0

func (k Keeper) GetInterestRateMin(ctx sdk.Context) sdk.Dec

func (Keeper) GetMTP added in v0.10.0

func (k Keeper) GetMTP(ctx sdk.Context, mtpAddress string, id uint64) (types.MTP, error)

func (Keeper) GetMTPCount added in v0.10.0

func (k Keeper) GetMTPCount(ctx sdk.Context) uint64

func (Keeper) GetMaxLeverageParam added in v0.10.0

func (k Keeper) GetMaxLeverageParam(ctx sdk.Context) sdk.Dec

func (Keeper) GetMaxOpenPositions added in v0.10.0

func (k Keeper) GetMaxOpenPositions(ctx sdk.Context) int64

func (Keeper) GetOpenMTPCount added in v0.10.0

func (k Keeper) GetOpenMTPCount(ctx sdk.Context) uint64

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetPool added in v0.10.0

func (k Keeper) GetPool(
	ctx sdk.Context,
	poolId uint64,

) (val types.Pool, found bool)

GetPool returns a pool from its index

func (Keeper) GetPoolBalanceOfExternal

func (k Keeper) GetPoolBalanceOfExternal(ctx sdk.Context, ammPool ammtypes.Pool) (sdk.Dec, error)

Get balance of custody

func (Keeper) GetPoolBalanceOfNative

func (k Keeper) GetPoolBalanceOfNative(ctx sdk.Context, ammPool ammtypes.Pool) (sdk.Dec, error)

Get balance of collateral Assume USDC as collateral in Elys

func (Keeper) GetPoolOpenThreshold added in v0.10.0

func (k Keeper) GetPoolOpenThreshold(ctx sdk.Context) sdk.Dec

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 (Keeper) GetRemovalQueueThreshold added in v0.10.0

func (k Keeper) GetRemovalQueueThreshold(ctx sdk.Context) sdk.Dec

func (Keeper) GetSQParams

func (Keeper) GetSafetyFactor added in v0.10.0

func (k Keeper) GetSafetyFactor(ctx sdk.Context) sdk.Dec

func (Keeper) GetSqModifier added in v0.10.0

func (k Keeper) GetSqModifier(ctx sdk.Context) sdk.Dec

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) HandleInterestPayment added in v0.10.0

func (k Keeper) HandleInterestPayment(ctx sdk.Context, interestPayment sdk.Int, mtp *types.MTP, pool *types.Pool, ammPool ammtypes.Pool) sdk.Int

func (Keeper) IncrementalInterestPayment added in v0.10.0

func (k Keeper) IncrementalInterestPayment(ctx sdk.Context, interestPayment sdk.Int, mtp *types.MTP, pool *types.Pool, ammPool ammtypes.Pool) (sdk.Int, error)

func (Keeper) InterestRateComputation added in v0.10.0

func (k Keeper) InterestRateComputation(ctx sdk.Context, pool types.Pool, ammPool ammtypes.Pool) (sdk.Dec, error)

func (Keeper) IsPoolClosed added in v0.10.0

func (k Keeper) IsPoolClosed(ctx sdk.Context, poolId uint64) bool

func (Keeper) IsPoolEnabled added in v0.10.0

func (k Keeper) IsPoolEnabled(ctx sdk.Context, poolId uint64) bool

func (Keeper) IsWhitelisted added in v0.10.0

func (Keeper) IsWhitelistingEnabled added in v0.10.0

func (k Keeper) IsWhitelistingEnabled(ctx sdk.Context) bool

func (Keeper) Logger

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

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 (Keeper) Pools added in v0.10.0

func (Keeper) RemovePool added in v0.10.0

func (k Keeper) RemovePool(
	ctx sdk.Context,
	index uint64,

)

RemovePool removes a pool from the store

func (Keeper) Repay added in v0.10.0

func (k Keeper) Repay(ctx sdk.Context, mtp *types.MTP, pool *types.Pool, ammPool ammtypes.Pool, repayAmount sdk.Int, takeFundPayment bool) error

func (Keeper) SetEnabledPools added in v0.10.0

func (k Keeper) SetEnabledPools(ctx sdk.Context, pools []uint64)

func (Keeper) SetMTP added in v0.10.0

func (k Keeper) SetMTP(ctx sdk.Context, mtp *types.MTP) error

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetPool added in v0.10.0

func (k Keeper) SetPool(ctx sdk.Context, pool types.Pool)

SetPool set a specific pool in the store from its index

func (Keeper) TakeFundPayment added in v0.10.0

func (k Keeper) TakeFundPayment(ctx sdk.Context, returnAmount sdk.Int, returnAsset string, takePercentage sdk.Dec, fundAddr sdk.AccAddress, ammPool *ammtypes.Pool) (sdk.Int, error)

func (Keeper) TakeInCustody added in v0.10.0

func (k Keeper) TakeInCustody(ctx sdk.Context, mtp types.MTP, pool *types.Pool) error

func (Keeper) TakeOutCustody added in v0.10.0

func (k Keeper) TakeOutCustody(ctx sdk.Context, mtp types.MTP, pool *types.Pool) error

func (Keeper) UpdateMTPHealth added in v0.10.0

func (k Keeper) UpdateMTPHealth(ctx sdk.Context, mtp types.MTP, ammPool ammtypes.Pool) (sdk.Dec, error)

func (Keeper) UpdatePoolHealth added in v0.10.0

func (k Keeper) UpdatePoolHealth(ctx sdk.Context, pool *types.Pool) error

Jump to

Keyboard shortcuts

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