Skip to content

aetelier_connect::synchronizers::ob_sync

src/syncrhonizers/ob_sync.rs

Time-synchronized orderbook snapshot sampling.

Produces uniformly-spaced Orderbook snapshots from an irregular stream of full-book updates by selecting the most recent snapshot at each discrete grid point.

Model

  stream:  S₁  S₂     S₃  S₄  S₅        S₆   S₇
  time: ───┼───┼───────┼───┼───┼──────────┼────┼──→
  grid: ───────|───────────|───────────|───────────|
           t₀         t₁         t₂         t₃

  output:       S₂          S₅          S₇
               (@ t₁)      (@ t₂)      (@ t₃ via finalize)

At each grid boundary, the last snapshot received before the crossing is emitted with its orderbook_ts reassigned to the grid-aligned nanosecond timestamp. Gaps (periods with no updates) are forward-filled from the previous snapshot.

Skeleton API reference

This page lists the public items in aetelier_connect::synchronizers::ob_sync with a one-line summary each. Signatures and source live in the SDK repository.

Structs

Item Summary
ObSynchronizer Produces uniformly-spaced Orderbook snapshots from an irregular update stream.

Functions

Item Summary
capture_levels Extract the current book state from an OrderbookDelta as Vec<Level> pairs.