Skip to main content

Module parse

Module parse 

Source
Expand description

Parsing utilities that convert Betfair stream messages into Nautilus domain models.

MCM (Market Change Messages) are parsed into order book deltas, trade ticks, and instrument status updates. OCM (Order Change Messages) are parsed into order status reports and fill reports.

Structs§

FillTracker
Tracks cumulative fill state per bet to compute incremental fills from the Betfair OCM stream.

Functions§

has_cancel_quantity
Returns true if the unmatched order has cancel, lapse, or void quantities.
is_lapsed
Returns true if the order is execution-complete and has lapsed.
make_fill_report
Creates a [FillReport] for a Betfair order fill.
make_trade_id
Generates a deterministic [TradeId] for a Betfair fill.
make_trade_tick
Creates a [TradeTick] from stream data.
parse_betfair_starting_prices
Extracts BetfairStartingPrice values from a market definition’s runners.
parse_betfair_ticker
Extracts a BetfairTicker from a runner change if any ticker fields are present.
parse_bsp_book_deltas
Extracts BSP order book deltas from a runner change’s spb/spl fields.
parse_instrument_closes
Produces [InstrumentClose] events from a market definition’s runner statuses.
parse_instrument_statuses
Produces per-runner [InstrumentStatus] events from a market definition.
parse_order_status_report
Parses a streaming UnmatchedOrder into a Nautilus [OrderStatusReport].
parse_race_progress
Parses a RaceProgressChange into a BetfairRaceProgress.
parse_race_runner_data
Parses a single RaceRunnerChange into a BetfairRaceRunnerData.
parse_runner_book_deltas
Parses a single runner’s book data into [OrderBookDeltas].