Skip to main content

parse_ws_order_book_depth

Function parse_ws_order_book_depth 

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

Parses a WebSocket L2 order book snapshot into [OrderBookDepth].

Hyperliquid’s l2Book subscription emits snapshots of bid/ask levels. Fills any missing levels past the venue-provided depth with zero-size placeholder orders so the fixed-size [BookOrder; 10] arrays are always fully populated.