Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidatePairSymbol ¶
ValidatePairSymbol validates the given trading pair.
Types ¶
type OpenOrder ¶
type OpenOrder struct { Id string `json:"id"` Symbol string `json:"symbol"` Price utils.Fixed8 `json:"price"` Quantity utils.Fixed8 `json:"quantity"` CumQty utils.Fixed8 `json:"cumQty"` CreatedHeight int64 `json:"createdHeight"` CreatedTimestamp int64 `json:"createdTimestamp"` LastUpdatedHeight int64 `json:"lastUpdatedHeight"` LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp"` }
func GetOpenOrders ¶
type OrderBook ¶
type OrderBook struct { Height int64 Levels []OrderBookLevel PendingMatch bool }
OrderBook represents an order book at the current point block height, which is included in its struct.
func GetOrderBook ¶
func GetOrderBook(cdc *wire.Codec, ctx context.CLIContext, pair string, levels int) (*OrderBook, error)
GetOrderBook decodes the order book from the serialized store
type OrderBookLevel ¶
type OrderBookLevel struct { BuyQty utils.Fixed8 `json:"buyQty"` BuyPrice utils.Fixed8 `json:"buyPrice"` SellQty utils.Fixed8 `json:"sellQty"` SellPrice utils.Fixed8 `json:"sellPrice"` }
OrderBookLevel represents a single order book level.
type RecentPrice ¶
type TradingPairMapper ¶
type TradingPairMapper interface { AddTradingPair(ctx sdk.Context, pair types.TradingPair) error Exists(ctx sdk.Context, baseAsset, quoteAsset string) bool GetTradingPair(ctx sdk.Context, baseAsset, quoteAsset string) (types.TradingPair, error) DeleteTradingPair(ctx sdk.Context, baseAsset, quoteAsset string) error ListAllTradingPairs(ctx sdk.Context) []types.TradingPair UpdateRecentPrices(ctx sdk.Context, pricesStoreEvery, numPricesStored int64, lastTradePrices map[string]int64) GetRecentPrices(ctx sdk.Context, pricesStoreEvery, numPricesStored int64) map[string]*utils.FixedSizeRing DeleteRecentPrices(ctx sdk.Context, symbol string) }
func NewTradingPairMapper ¶
func NewTradingPairMapper(cdc *wire.Codec, key sdk.StoreKey) TradingPairMapper
Click to show internal directories.
Click to hide internal directories.