Skip to main content

parse_ws_order_book_depth

Function parse_ws_order_book_depth 

Source
pub fn parse_ws_order_book_depth(
    book: &LighterWsOrderBook,
    instrument: &InstrumentAny,
    timestamp_ms: u64,
    ts_init: UnixNanos,
) -> Result<OrderBookDepth>
Expand description

Parses a full Lighter order book payload into a Nautilus [OrderBookDepth].

Call this only for snapshot or depth payloads that contain the full visible book. Incremental updates should be parsed as deltas.

ยงErrors

Returns an error if any price or size cannot be converted.