keeper

package
v0.49.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPendingPerpetualOrderIDBytes added in v0.46.0

func GetPendingPerpetualOrderIDBytes(id uint64) []byte

GetPendingPerpetualOrderIDBytes returns the byte representation of the ID

func GetPendingPerpetualOrderIDFromBytes added in v0.46.0

func GetPendingPerpetualOrderIDFromBytes(bz []byte) uint64

GetPendingPerpetualOrderIDFromBytes returns ID in uint64 format from a byte array

func GetPendingSpotOrderIDBytes added in v0.46.0

func GetPendingSpotOrderIDBytes(id uint64) []byte

GetPendingSpotOrderIDBytes returns the byte representation of the ID

func GetPendingSpotOrderIDFromBytes added in v0.46.0

func GetPendingSpotOrderIDFromBytes(bz []byte) uint64

GetPendingSpotOrderIDFromBytes returns ID in uint64 format from a byte array

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,
	tier types.TierKeeper,
	perpetual types.PerpetualKeeper,
) *Keeper

func (Keeper) AppendPendingPerpetualOrder added in v0.46.0

func (k Keeper) AppendPendingPerpetualOrder(
	ctx sdk.Context,
	pendingPerpetualOrder types.PerpetualOrder,
) uint64

AppendPendingPerpetualOrder appends a pendingPerpetualOrder in the store with a new id and update the count

func (Keeper) AppendPendingSpotOrder added in v0.46.0

func (k Keeper) AppendPendingSpotOrder(
	ctx sdk.Context,
	pendingSpotOrder types.SpotOrder,
) uint64

AppendPendingSpotOrder appends a pendingSpotOrder in the store with a new id and update the count

func (Keeper) ExecuteLimitBuyOrder added in v0.46.0

func (k Keeper) ExecuteLimitBuyOrder(ctx sdk.Context, order types.SpotOrder) error

ExecuteLimitBuyOrder executes a limit buy order

func (Keeper) ExecuteLimitCloseOrder added in v0.46.0

func (k Keeper) ExecuteLimitCloseOrder(ctx sdk.Context, order types.PerpetualOrder) error

ExecuteLimitCloseOrder executes a limit close order

func (Keeper) ExecuteLimitOpenOrder added in v0.46.0

func (k Keeper) ExecuteLimitOpenOrder(ctx sdk.Context, order types.PerpetualOrder) error

ExecuteLimitOpenOrder executes a limit open order

func (Keeper) ExecuteLimitSellOrder added in v0.46.0

func (k Keeper) ExecuteLimitSellOrder(ctx sdk.Context, order types.SpotOrder) error

ExecuteLimitSellOrder executes a limit sell order

func (Keeper) ExecuteMarketBuyOrder added in v0.46.0

func (k Keeper) ExecuteMarketBuyOrder(ctx sdk.Context, order types.SpotOrder) error

ExecuteMarketBuyOrder executes a market buy order

func (Keeper) ExecuteMarketCloseOrder added in v0.46.0

func (k Keeper) ExecuteMarketCloseOrder(ctx sdk.Context, order types.PerpetualOrder) error

ExecuteMarketCloseOrder executes a market close order

func (Keeper) ExecuteMarketOpenOrder added in v0.46.0

func (k Keeper) ExecuteMarketOpenOrder(ctx sdk.Context, order types.PerpetualOrder) error

ExecuteMarketOpenOrder executes a market open order

func (Keeper) ExecuteStopLossOrder added in v0.46.0

func (k Keeper) ExecuteStopLossOrder(ctx sdk.Context, order types.SpotOrder) error

ExecuteStopLossSpotOrder executes a stop loss order

func (Keeper) FillUpExtraPerpetualOrderInfo added in v0.48.0

func (k Keeper) FillUpExtraPerpetualOrderInfo(ctx sdk.Context, order *types.PerpetualOrder) error

FillUpExtraPerpetualOrderInfo fills up the extra information of the perpetual order

func (Keeper) GetAllLegacyPendingPerpetualOrder added in v0.48.0

func (k Keeper) GetAllLegacyPendingPerpetualOrder(ctx sdk.Context) (list []types.LegacyPerpetualOrder)

GetAllPendingPerpetualOrder returns all legacy pendingPerpetualOrder

func (Keeper) GetAllPendingPerpetualOrder added in v0.46.0

func (k Keeper) GetAllPendingPerpetualOrder(ctx sdk.Context) (list []types.PerpetualOrder)

GetAllPendingPerpetualOrder returns all pendingPerpetualOrder

func (Keeper) GetAllPendingSpotOrder added in v0.46.0

func (k Keeper) GetAllPendingSpotOrder(ctx sdk.Context) (list []types.SpotOrder)

GetAllPendingSpotOrder returns all pendingSpotOrder

func (Keeper) GetAllSortedPerpetualOrder added in v0.46.0

func (k Keeper) GetAllSortedPerpetualOrder(ctx sdk.Context) (list [][]uint64, err error)

func (Keeper) GetAllSortedSpotOrder added in v0.46.0

func (k Keeper) GetAllSortedSpotOrder(ctx sdk.Context) (list [][]uint64, err error)

GetAllPendingSpotOrder returns all pendingSpotOrder

func (Keeper) GetAssetPriceFromDenomInToDenomOut added in v0.46.0

func (k Keeper) GetAssetPriceFromDenomInToDenomOut(ctx sdk.Context, denomIn, denomOut string) (sdk.Dec, error)

GetAssetPriceFromDenomInToDenomOut returns the price of an asset from a denom to another denom

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetPendingPerpetualOrder added in v0.46.0

func (k Keeper) GetPendingPerpetualOrder(ctx sdk.Context, id uint64) (val types.PerpetualOrder, found bool)

GetPendingPerpetualOrder returns a pendingPerpetualOrder from its id

func (Keeper) GetPendingPerpetualOrderCount added in v0.46.0

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

GetPendingPerpetualOrderCount get the total number of pendingPerpetualOrder

func (Keeper) GetPendingPerpetualOrdersForAddress added in v0.48.0

func (k Keeper) GetPendingPerpetualOrdersForAddress(ctx sdk.Context, address string, status *types.Status, pagination *query.PageRequest) ([]types.PerpetualOrder, *query.PageResponse, error)

func (Keeper) GetPendingSpotOrder added in v0.46.0

func (k Keeper) GetPendingSpotOrder(ctx sdk.Context, id uint64) (val types.SpotOrder, found bool)

GetPendingSpotOrder returns a pendingSpotOrder from its id

func (Keeper) GetPendingSpotOrderCount added in v0.46.0

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

GetPendingSpotOrderCount get the total number of pendingSpotOrder

func (Keeper) GetPendingSpotOrdersForAddress added in v0.48.0

func (k Keeper) GetPendingSpotOrdersForAddress(ctx sdk.Context, address string, status *types.Status, pagination *query.PageRequest) ([]types.SpotOrder, *query.PageResponse, error)

func (Keeper) GetUserDiscount added in v0.46.0

func (k Keeper) GetUserDiscount(ctx sdk.Context, address string) (sdk.Dec, error)

GetUserDiscount returns the discount of a user

func (Keeper) InsertPerptualSortedOrder added in v0.46.0

func (k Keeper) InsertPerptualSortedOrder(ctx sdk.Context, newOrder types.PerpetualOrder) error

func (Keeper) InsertSpotSortedOrder added in v0.46.0

func (k Keeper) InsertSpotSortedOrder(ctx sdk.Context, newOrder types.SpotOrder) error

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) PendingPerpetualOrder added in v0.46.0

func (Keeper) PendingPerpetualOrderAll added in v0.46.0

func (Keeper) PendingSpotOrder added in v0.46.0

func (Keeper) PendingSpotOrderAll added in v0.46.0

func (Keeper) PendingSpotOrderForAddress added in v0.48.0

func (Keeper) PerpetualBinarySearch added in v0.46.0

func (k Keeper) PerpetualBinarySearch(ctx sdk.Context, orderPrice sdk.Dec, orders []uint64) (int, error)

func (Keeper) RemovePendingPerpetualOrder added in v0.46.0

func (k Keeper) RemovePendingPerpetualOrder(ctx sdk.Context, id uint64)

RemovePendingPerpetualOrder removes a pendingPerpetualOrder from the store

func (Keeper) RemovePendingSpotOrder added in v0.46.0

func (k Keeper) RemovePendingSpotOrder(ctx sdk.Context, id uint64)

RemovePendingSpotOrder removes a pendingSpotOrder from the store

func (Keeper) RemovePerpetualSortedOrder added in v0.46.0

func (k Keeper) RemovePerpetualSortedOrder(ctx sdk.Context, orderID uint64) error

RemoveSortedOrder removes an order from the sorted order list.

func (Keeper) RemoveSpotSortedOrder added in v0.46.0

func (k Keeper) RemoveSpotSortedOrder(ctx sdk.Context, orderID uint64) error

RemoveSortedOrder removes an order from the sorted order list.

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetPendingPerpetualOrder added in v0.46.0

func (k Keeper) SetPendingPerpetualOrder(ctx sdk.Context, pendingPerpetualOrder types.PerpetualOrder)

SetPendingPerpetualOrder set a specific pendingPerpetualOrder in the store

func (Keeper) SetPendingPerpetualOrderCount added in v0.46.0

func (k Keeper) SetPendingPerpetualOrderCount(ctx sdk.Context, count uint64)

SetPendingPerpetualOrderCount set the total number of pendingPerpetualOrder

func (Keeper) SetPendingSpotOrder added in v0.46.0

func (k Keeper) SetPendingSpotOrder(ctx sdk.Context, pendingSpotOrder types.SpotOrder)

SetPendingSpotOrder set a specific pendingSpotOrder in the store

func (Keeper) SetPendingSpotOrderCount added in v0.46.0

func (k Keeper) SetPendingSpotOrderCount(ctx sdk.Context, count uint64)

SetPendingSpotOrderCount set the total number of pendingSpotOrder

func (Keeper) SpotBinarySearch added in v0.46.0

func (k Keeper) SpotBinarySearch(ctx sdk.Context, orderPrice sdk.Dec, orders []uint64) (int, error)

Jump to

Keyboard shortcuts

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