Skip to main content

orderbook_to_snapshot_deltas

Function orderbook_to_snapshot_deltas 

Source
#[unsafe(no_mangle)]
pub extern "C" fn orderbook_to_snapshot_deltas( book: &OrderBook_API, ts_event: u64, ts_init: u64, ) -> OrderBookDeltas_API
Expand description

Creates an OrderBookDeltas snapshot from the current order book state.

This is the reverse operation of orderbook_apply_deltas: it converts the current book state back into a snapshot format with a Clear delta followed by Add deltas for all orders.

§Parameters

  • book - The order book to convert.
  • sequence - The message sequence number for the snapshot.
  • ts_event - UNIX timestamp (nanoseconds) when the book event occurred.
  • ts_init - UNIX timestamp (nanoseconds) when the instance was created.

§Returns

An OrderBookDeltas_API containing a snapshot of the current order book state.