Telemetry

StockMarketABM.MarketTelemetryMod manages rolling market snapshots. It keeps current best bid/ask, midprice, and last trade data in memory, maintains bounded buffers for recent ticks and configurable OHLCV bars, and exposes an on-demand API for retrieving the current top-of-book depth. Helper utilities are provided for batching tick/bar buffers to persistent storage when needed. StockMarketABM.OrderFlowMod complements this with an order-flow log that records every add, cancel, trade, and expiry event and offers a flush queue for archival.

StockMarketABM.MarketTelemetryMod.get_depth_levelsMethod
get_depth_levels(market, instrument; levels=nothing) -> NamedTuple

Collect the current depth snapshot up to levels price levels per side. When levels === nothing, the depth level configured in TelemetryConfig is used. Returns a named tuple (bids, asks) with vectors of (price, qty) pairs.

source