OrderBookSnapshotΒΆ

Defined in dccd.domain.records

class OrderBookSnapshot(*, ts, bids, asks, is_snapshot=True)[source]

Bases: BaseModel

A complete (or delta) order book state at a point in time.

Attributes:
tsint

Snapshot timestamp, nanoseconds UTC.

bidslist[OrderBookLevel]

Bid levels, sorted descending by price.

askslist[OrderBookLevel]

Ask levels, sorted ascending by price.

is_snapshotbool

True = full state; False = incremental delta to apply locally.

Examples

>>> snap = OrderBookSnapshot(ts=1_000_000_000_000_000_000, bids=[], asks=[])
>>> snap.is_snapshot
True