Skip to main content

parse_depth_diff

Function parse_depth_diff 

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

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

Returns Ok(None) if the diff contains no updates.

ยงErrors

Returns an error if:

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