Skip to main content

parse_depth_snapshot

Function parse_depth_snapshot 

Source
pub fn parse_depth_snapshot(
    event: &DepthSnapshotStreamEvent,
    instrument: &InstrumentAny,
    ts_init: UnixNanos,
) -> Result<OrderBookDeltas>
Expand description

Parses a depth snapshot event into OrderBookDeltas using the supplied adapter initialization timestamp for the aggregate and every inner delta.

A snapshot without levels clears the book.

ยงErrors

Returns an error if:

  • A price is out of range or a reserved sentinel value.
  • A quantity is negative, out of range, or zero at the instrument size precision.