Skip to main content

Module depth

Module depth 

Source
Expand description

Limit-order-book depth: the execution-layer observable.

Pricing never walks a ladder — it reads a Quote mark. Execution analytics (slippage, liquidation value, sizing) do walk it. Keeping MarketDepth as a sibling of Quote under its own market key (Depth) preserves that layering: a trading system publishes the book here and the top-of-book collapses into a Quote at the snapshot boundary ([to_quote] (MarketDepth::to_quote)); the pricing layer never changes.

Scenario shocks do not rewrite ladders: bump the pricing observables (Spot), let the adapter republish depth.

Structs§

DepthLevel
One book level: a price and the size displayed at it.
MarketDepth
A price-aggregated (L2) snapshot of one instrument’s book: bids best (highest) first, asks best (lowest) first. Validated on construction — sorted sides, positive finite sizes, uncrossed top — so consumers can walk it without re-checking.