Skip to content

betting_combat.rounds.market.minutes

Set 4: the minute panel. One row per fight per minute, from 30 minutes before the fight started until its last market candle, with the fight clock and every market of the fight.

Ported from the research (ufc/dataset/live.py: candle_frame, LiveSets.all_candles, LiveSets.set4, LiveSets.clock).

Keys: fight_id, event_id, event_date, split, ts (UTC, the minute’s end: everything in the row was knowable at ts). Clock:

t_min minutes since the fight started (negative before)
round 0 before the start, 1..R in the fight, R+1 after the final bell
phase pre / round / break / post_bell / settled
fight_min fight time elapsed (0 to 5R, stops in the breaks)
result_priced 1 from the winner market's snap on

Then <market>_<field> for every market of the fight (A-framed names), fields bid, ask, mid (YES, dollars), vol (contracts in the minute), dvol (vol x the minute’s mean price), oi; and poly_win_a, Polymarket’s price for A (carried at most 5 minutes). A minute without a candle carries bid/ask/oi forward with vol 0.

Functions

all_candles

all_candles(winner: Mapping[str, list[dict[str, Any]]], distance: Mapping[str, list[dict[str, Any]]], series: Iterable[Mapping[str, list[dict[str, Any]]]]) -> dict[str, list[dict[str, Any]]]

Every market’s candles by ticker, merged in the research’s order: winner, distance, then the side series (KXUFCMOV, KXUFCMOF, KXUFCROUNDS, KXUFCVICROUND); a later source wins a ticker listed twice.

candle_frame

candle_frame(candles: Sequence[Mapping[str, Any]]) -> pd.DataFrame

Minute frame from Kalshi candles: bid/ask/mid carried forward, vol, dvol, oi.

clock_columns

clock_columns(panel: pd.DataFrame, f: Any) -> pd.DataFrame

The keys and the fight clock on a fight’s minute panel (research LiveSets.clock). f needs fight_id, event_id, event_date, split, start, snap, rounds.

set4_minutes

set4_minutes(fights: pd.DataFrame, markets: pd.DataFrame, candles: Mapping[str, list[dict[str, Any]]], poly_history: Mapping[str, Any], a_slot: Mapping[str, int]) -> pd.DataFrame

The Set 4 panel (research LiveSets.set4).

Args: fights: :func:~.listing.live_fights rows. markets: :func:~.listing.market_list rows. candles: :func:all_candles. poly_history: Polymarket price histories by fight_id (polymarket_ufc.json’s history: None, or {'history': [{'t': epoch s, 'p': price of UFCStats slot 1}, ...], ...}). a_slot: fight_id -> the UFCStats slot (1 or 2) of fighter A.