UNPKG

orderbooks

Version:

In-memory state stores and handlers for caching multiple exchange:symbol orderbook states

21 lines (20 loc) 534 B
type Symbol = string; type Price = number; type Side = 'Buy' | 'Sell'; type Quantity = number; export type OrderBookLevelState<T = unknown> = [ Symbol, Price, Side, Quantity, (T[] | any)? ]; /** * One level in orderbook * @param {string} symbol * @param {number} price * @param {string} [side='Buy'|'Sell'] * @param {number} qty asset at this level */ export declare function OrderBookLevel<T>(symbol: string, price: number, side: Side, qty: Quantity, ...extraState: T[]): OrderBookLevelState<T>; export {};