Weaver ordering key. Monotonic by construction, not by measurement: when events arrive
faster than the clock resolves, it is the previous key plus one. So it is deliberately not
subtractable — the gap between two arrivals is not an elapsed duration.
The book fold. Domain-only — it knows nothing of Cell/Node; the graph node wraps this
through Book::step, and ShadowBook wraps the same instance, so the persisted stream and
the replayed one cannot drift.
One level of our own recollection — see ShadowBook: the persisted delta
lane is gapless and self-consistent, so kind (not the venue’s gapped flag) is what a
consumer reads. This is the stored row; unlike every other lane holder it carries its own
precision, because a Series hands out bare items and a raw price
no consumer can scale is not a reading. The persistence tier fills it from the file’s schema.
(price, qty) levels for both sides of an orderbook, keyed by raw price.
The wire/persist shape. Both BTreeMaps are ascending; Book holds the same levels best-first.
Unlike Kline, timestamp signifies the end of the period, not the start. As another difference - Vec<Close> can have uneven spacing between measured points.
Standard candlestick data unit. Can only ever be full, - if an exchange returns partial data for an ongoing candle, or if trading/exchange is down leading to the associated data being cut, the Kline object is NOT created.
most exchanges default to returning OI value in asset quantity, not quote. Exception would be Inverse on Bybit.
Which actually makes sense, as same endpoints accept things like “BTCETH”, where quote value would be irrelevant.
How coarsely a backtest batches, so that it runs faster than the market it replays. That is
the whole of it. Arrival time is cut into cells of this length and everything landing in one cell
is handed to the graph as a single step, so a replay does a day’s work in as many steps as the
cell size buys rather than one per message.
Relay’s columnar twin: per element where the element attests, on the holder where the run
does. Both shapes stay — Relay for a single event, this for a run.
We persist our own recollection, not the venue’s story. A gap or a resync is a fact about our
connection; stored raw, every replay would re-derive the reconciliation from whatever venue
snapshots happened to land. Reconciled once here, replay is exact and free.
Whether a level is market activity or our own reconciliation — a UInt8 column exactly parallel
to the side byte. Per row, not per run: what a run of levels is, is what its rows say it is,
and the one consumer that discriminates (a flow derivation, which a correction would feed
fabricated signal) filters on it.
Boundary view for serialisation, logging and inspection. Objects keep their concrete shape;
this is what they flatten to when something generic has to look at them.
Feature-gated exchange construction. Local extension trait over the foreign ExchangeName
(defined in trading_data_core) — the only piece of exchange behavior that cannot leave this crate.
Per-exchange book-event ordering token. Used internally by the WS connection to detect gaps
in the per-pair delta chain. Not persisted; the result (gapped: bool) is.
Live event feeds. Not every venue has one — a venue that doesn’t simply doesn’t implement this,
and Exchange::stream answers None rather than a runtime “not supported”.
The weaker bound: it crossed a wire. Generic code bounds on this and accepts either shape; code
that needs origin attestation takes Leg concretely and a Relay will not compile.
NTP’s estimator. The two recv - send terms straddle actors, which is exactly why this is the
one place that touches raw nanos and the only thing that can mint an Offset.
Project a venue reading onto our clock. The result is Bounded, never a Ts<Local>: the
skew is estimated, and collapsing the interval would re-hide exactly what the estimate cost.