keeper

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const MaxPageLimit = 100

Variables

This section is empty.

Functions

func BeginBlockerProcessMTP

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

func CalcMTPInterestLiabilities

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

func GetEpochPosition

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

get position of current block in epoch

func NewLegacyHandler

func NewLegacyHandler(k types.Keeper) sdk.Handler

func NewLegacyQuerier

func NewLegacyQuerier(k types.Keeper, cdc *codec.LegacyAmino) sdk.Querier

func NewMsgServerImpl

func NewMsgServerImpl(k types.Keeper) types.MsgServer

func NewQueryServer

func NewQueryServer(k types.Keeper) types.QueryServer

func ToAsset

func ToAsset(asset string) clptypes.Asset

func ValidateParams

func ValidateParams(params *types.Params) error

Types

type Keeper

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

func NewKeeper

func NewKeeper(storeKey sdk.StoreKey,
	cdc codec.BinaryCodec,
	bankKeeper types.BankKeeper,
	clpKeeper types.CLPKeeper,
	adminKeeper adminkeeper.Keeper,
	ps paramtypes.Subspace) Keeper

func (Keeper) AdminKeeper

func (k Keeper) AdminKeeper() adminkeeper.Keeper

func (Keeper) BankKeeper

func (k Keeper) BankKeeper() types.BankKeeper

func (Keeper) BeginBlocker

func (k Keeper) BeginBlocker(ctx sdk.Context)

func (Keeper) Borrow

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

func (Keeper) CLPSwap

func (k Keeper) CLPSwap(ctx sdk.Context, sentAmount sdk.Uint, to string, pool clptypes.Pool) (sdk.Uint, error)

func (Keeper) CalculatePoolHealth

func (k Keeper) CalculatePoolHealth(pool *clptypes.Pool) sdk.Dec

func (Keeper) CheckMinLiabilities

func (k Keeper) CheckMinLiabilities(ctx sdk.Context, collateralAmount sdk.Uint, eta sdk.Dec, pool clptypes.Pool, custodyAsset string) error

func (Keeper) ClpKeeper

func (k Keeper) ClpKeeper() types.CLPKeeper

func (Keeper) DestroyMTP

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

func (Keeper) DewhitelistAddress

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

func (Keeper) EmitAboveRemovalThreshold

func (k Keeper) EmitAboveRemovalThreshold(ctx sdk.Context, pool *clptypes.Pool)

func (Keeper) EmitAdminClose

func (k Keeper) EmitAdminClose(ctx sdk.Context, mtp *types.MTP, repayAmount sdk.Uint, closer string)

func (Keeper) EmitAdminCloseAll

func (k Keeper) EmitAdminCloseAll(ctx sdk.Context, takeMarginFund bool)

func (Keeper) EmitBelowRemovalThreshold

func (k Keeper) EmitBelowRemovalThreshold(ctx sdk.Context, pool *clptypes.Pool)

func (Keeper) EmitForceClose

func (k Keeper) EmitForceClose(ctx sdk.Context, mtp *types.MTP, repayAmount sdk.Uint, closer string)

func (Keeper) EmitFundPayment

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

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

func (Keeper) ForceCloseLong

func (k Keeper) ForceCloseLong(ctx sdk.Context, mtp *types.MTP, pool *clptypes.Pool, isAdminClose bool, takeFundPayment bool) (sdk.Uint, error)

func (Keeper) GetAllMTPS

func (k Keeper) GetAllMTPS(ctx sdk.Context) []*types.MTP

func (Keeper) GetEnabledPools

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

func (Keeper) GetEpochLength

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

func (Keeper) GetForceCloseFundAddress

func (k Keeper) GetForceCloseFundAddress(ctx sdk.Context) sdk.AccAddress

func (Keeper) GetForceCloseFundPercentage

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

func (Keeper) GetHealthGainFactor

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

func (Keeper) GetIncrementalInterestPaymentEnabled

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

func (Keeper) GetIncrementalInterestPaymentFundAddress

func (k Keeper) GetIncrementalInterestPaymentFundAddress(ctx sdk.Context) sdk.AccAddress

func (Keeper) GetIncrementalInterestPaymentFundPercentage

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

func (Keeper) GetInterestRateDecrease

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

func (Keeper) GetInterestRateIncrease

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

func (Keeper) GetInterestRateMax

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

func (Keeper) GetInterestRateMin

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

func (Keeper) GetMTP

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

func (Keeper) GetMTPCount

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

func (Keeper) GetMTPIterator

func (k Keeper) GetMTPIterator(ctx sdk.Context) sdk.Iterator

func (Keeper) GetMTPs

func (k Keeper) GetMTPs(ctx sdk.Context, pagination *query.PageRequest) ([]*types.MTP, *query.PageResponse, error)

func (Keeper) GetMTPsForAddress

func (k Keeper) GetMTPsForAddress(ctx sdk.Context, mtpAddress sdk.Address, pagination *query.PageRequest) ([]*types.MTP, *query.PageResponse, error)

func (Keeper) GetMTPsForPool

func (k Keeper) GetMTPsForPool(ctx sdk.Context, asset string, pagination *query.PageRequest) ([]*types.MTP, *query.PageResponse, error)

func (Keeper) GetMaxLeverageParam

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

func (Keeper) GetMaxOpenPositions

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

func (Keeper) GetOpenMTPCount

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

func (Keeper) GetParams

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

func (Keeper) GetPoolOpenThreshold

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

func (Keeper) GetRemovalQueueThreshold

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

func (Keeper) GetSQBeginBlock

func (k Keeper) GetSQBeginBlock(ctx sdk.Context, pool *clptypes.Pool) uint64

func (Keeper) GetSQFromBlocks

func (k Keeper) GetSQFromBlocks(ctx sdk.Context, pool clptypes.Pool, poolInterestRate sdk.Dec) sdk.Dec

func (Keeper) GetSQFromQueue

func (k Keeper) GetSQFromQueue(ctx sdk.Context, pool clptypes.Pool) sdk.Dec

func (Keeper) GetSafetyFactor

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

func (Keeper) GetSqModifier

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

func (Keeper) GetWhitelist

func (k Keeper) GetWhitelist(ctx sdk.Context, pagination *query.PageRequest) ([]string, *query.PageResponse, error)

func (Keeper) HandleInterestPayment

func (k Keeper) HandleInterestPayment(ctx sdk.Context, interestPayment sdk.Uint, mtp *types.MTP, pool *clptypes.Pool) sdk.Uint

func (Keeper) IncrementalInterestPayment

func (k Keeper) IncrementalInterestPayment(ctx sdk.Context, interestPayment sdk.Uint, mtp *types.MTP, pool *clptypes.Pool) (sdk.Uint, error)

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) []abci.ValidatorUpdate

func (Keeper) InterestRateComputation

func (k Keeper) InterestRateComputation(ctx sdk.Context, pool clptypes.Pool) (sdk.Dec, error)

func (Keeper) IsPoolClosed

func (k Keeper) IsPoolClosed(ctx sdk.Context, asset string) bool

func (Keeper) IsPoolEnabled

func (k Keeper) IsPoolEnabled(ctx sdk.Context, asset string) bool

func (Keeper) IsRowanCollateralEnabled

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

func (Keeper) IsWhitelisted

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

func (Keeper) IsWhitelistingEnabled

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

func (Keeper) Repay

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

func (Keeper) SetEnabledPools

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

func (Keeper) SetMTP

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

func (Keeper) SetParams

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

func (Keeper) SetSQBeginBlock

func (k Keeper) SetSQBeginBlock(ctx sdk.Context, pool *clptypes.Pool, height uint64)

func (Keeper) TakeFundPayment

func (k Keeper) TakeFundPayment(ctx sdk.Context, returnAmount sdk.Uint, returnAsset string, takePercentage sdk.Dec, fundAddr sdk.AccAddress) (sdk.Uint, error)

func (Keeper) TakeInCustody

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

func (Keeper) TakeOutCustody

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

func (Keeper) TrackSQBeginBlock

func (k Keeper) TrackSQBeginBlock(ctx sdk.Context, pool *clptypes.Pool)

func (Keeper) UpdateMTPHealth

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

func (Keeper) UpdatePoolHealth

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

func (Keeper) WhitelistAddress

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

type Migrator

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

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

func (Migrator) MigrateToVer2

func (m Migrator) MigrateToVer2(ctx sdk.Context) error

Jump to

Keyboard shortcuts

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