Skip to content

betting_combat.trading.rounds_v2

The primary at a card run’s breaks (2026-10-27): what a strategy row on primary_model ‘stats’ / ‘no_stats’ reads (models.v2: the bundle on the artifact).

card_props the card's market prices at the card start (the Kalshi distance and method-of-
finish books): ``features.props``' columns for the card's fights
upcoming_v2 the card's Dataset 1 v2 rows: the old rows (``live.upcoming.build_upcoming``)
with the primary's clock (the card's curve, p0 and the KO share from the
market's prices, else history - ``clock_v2``'s rule by source), the market's
prices as features; the round statistics come at each break
chances the break's chances per engine (``models.v2.cells_of``) from the row; for
'stats' the row carries the live round statistics (``rounds.live.round_feed``
-> ``features.breaks.BreakStats.live``)
finish_of the chances as the decision's ``Finish`` (P(ends this round), the chain to the
distance), so every rule downstream reads the primary unchanged; a break
decided late (the 'stats' variant waits for the round's line, which lands
after the bell) conditioned on no finish in the seconds of the round gone
(``joint.clock_probs``' rule)
noko_chances the 'no KO' strategy's chances (``live.noko``): P(no KO from here), this
round's KO and submission chances, the KO chance after it
minute_bars the markets' minute candles to the decision (Kalshi REST), as Set 4's panel
builds them (every minute from the fight's start - 30 minutes, prices carried
forward): the meta model's market inputs
meta_prob the bet's meta probability (``models.meta``)

Functions

card_props

card_props(books: Mapping[str, Mapping[str, Any]]) -> pd.DataFrame

Per fight (books: ufc fight id -> role -> its book at the card start): the market’s P(goes the distance) and P(KO | finish) with features.props’ rule (the method outcomes renormalised over 3+ quoted; the distance market else decision + draw).

chances

chances(model: PrimaryModel, row: Mapping[str, Any], stats: Mapping[str, Any] | None) -> dict[str, float]

One break’s chances per engine (cells_of’s columns) from its Dataset 1 v2 row, with stats (the live round statistics’ columns) merged when given.

finish_of

finish_of(ch: Mapping[str, float], clock: FinishClock | None = None, round_no: int = 1, tau_s: float = 0.0) -> Finish

The primary’s chances as the decision’s Finish: P(ends this round) = 1 - no finish; the chain to the distance = the fight from here’s decision chance. With clock and tau_s > 0 (a break decided tau_s seconds into round round_no): conditioned on no finish so far, A (1 - F(tau)) / (1 - A F(tau)) and the distance / (1 - A F(tau)).

live_stats

live_stats(lines: pd.DataFrame | None, fight_id: str, round_idx: int) -> dict[str, Any] | None

The break’s round-statistics columns from the feed’s lines (BreakStats.live), None when the lines do not cover the round.

meta_markets

meta_markets(inst: str) -> tuple[str, ...]

The markets a bet’s meta inputs read: its own (models.meta.OWN_MARKET) and those pricing its event elsewhere.

meta_prob

meta_prob(meta: MetaModel, bets: pd.DataFrame, ch: Mapping[str, float], bars: pd.DataFrame, bells: pd.DataFrame) -> np.ndarray

Each bet’s meta probability (bets: row_id, fight_id, round_idx, strategy, inst, t) at the break: its inputs from the minute bars, the engines’ chances ch and the bells.

minute_bars

minute_bars(candles: Any, tickers: Mapping[str, tuple[str, str]], fight_id: str, start: dt.datetime, until: dt.datetime) -> pd.DataFrame

The markets’ minute bars up to until as Set 4’s panel (market.minutes.set4_minutes): <name>_<field> columns, ts at each minute’s end, every minute from the fight’s start - 30 minutes, bid / ask / mid / oi carried forward, vol / dvol 0 in a minute without a candle. tickers: dataset name -> (ticker, series); candles: the Kalshi REST client’s candlesticks. A market whose read fails is left out (its inputs NaN).

noko_chances

noko_chances(ch: Mapping[str, float], clock: MethodClock | None = None, round_no: int = 1, tau_s: float = 0.0) -> dict[str, float]

The ‘no KO’ strategy’s numbers (backtest.noko.break_rows’ rule): p P(no KO from here) - at the break, or tau_s seconds into round round_no with no finish yet (noko.p_no_ko on the method clock) - and what it came from.

upcoming_v2

upcoming_v2(raw: RawData, rows: pd.DataFrame, v2: V2Models, market: pd.DataFrame) -> pd.DataFrame

The card’s Dataset 1 v2 rows (the module doc): rows the card’s old rows (build_upcoming, every scheduled round start), market its prices (card_props).