Skip to content

betting_combat.rounds.models.candidates

Candidate bets from the final probabilities.

Rows: every round start in the live era. Row time t = the end of the break (round 1: the minute before the fight). Quotes: the Kalshi book at t (Set 4 minutes: one row per fight and minute, {market}_bid / {market}_ask per market, A-framed).

Markets and the final probability for each: rounds ‘ends before round r+2’ at the start of round r+1 = P(ends this round) distance P(decision) = (1 - P(ends this round)) x layer 1’s no-finish chance in every later round, i.e. l1_p_decision / (1 - l1_p_finish_round)

Bet rule per market and row: YES edge = p - ask - fee(ask); NO edge = (1 - p) - (1 - bid)

  • fee(1 - bid) (Kalshi taker fee, common.fee). A candidate is a row with a positive edge on either side; its side is the larger edge (YES on a tie), entry = that side’s ask.

The fight clock (fights): one row per Kalshi-listed fight with fight_id, start and snap (see meta.add_lifetimes).

Research: ufc/modeling/flat_bets.py (quotes, final_candidates) and the event block shared by ufc/modeling/execution.py::final_events and ufc/modeling/forward.py::events.

Functions

candidate_events

candidate_events(p: pd.DataFrame, fights: pd.DataFrame, minutes: pd.DataFrame) -> pd.DataFrame

The candidate bets from the final probabilities per round start. p needs fight_id, round_idx, finish_final (P(ends this round)), finish_l1, decision_l1 (layer 1), y_finish_round, y_decision and event_id / event_date; its columns are carried along. Adds the probability p, outcome, both edges, side, edge, entry, p_side, spread, won, cost (entry + fee), pnl_settle and the bet’s life t_entry / t_end.

final_candidates

final_candidates(probs: pd.DataFrame, fights: pd.DataFrame, minutes: pd.DataFrame) -> pd.DataFrame

Every quoted rounds / distance row with the nested bagged layer 2 as P(ends this round) (finish_side; layer 1 where the fight has no side markets), its outcome and both edges. probs: the model probabilities per round start (training.model_probs).

quotes

quotes(rows: pd.DataFrame, fights: pd.DataFrame, minutes: pd.DataFrame) -> pd.DataFrame

The Kalshi book at each row’s time (fight_id, round_idx), for the markets each row can trade: one row per (row, market) with a two-sided book 0 < bid < ask < 1.