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, ts_event: u64, ts_init: u64, ) -> *mut OrderBookDeltas
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.
  • ts_event - UNIX timestamp (nanoseconds) when the book event occurred.
  • ts_init - UNIX timestamp (nanoseconds) when the instance was created.

§Returns

An owning pointer to an OrderBookDeltas containing a snapshot of the current order book state, which the caller must eventually pass to crate::ffi::data::deltas::orderbook_deltas_drop.