Skip to content

betting_combat.rounds.identity.keys

Source keys bound to our fighters, events and bouts after a confirmed match: kalshi_keys (Kalshi’s competitor ids), kalshi_bout_keys (Kalshi’s winner events) and bind (any key rows, append-only).

A key is bound only from a bout the one matcher found (Matcher) with the source’s result agreeing with UFCStats’; it is never re-bound: a key already bound to another fighter, or bound to two fighters by the new rows, is refused and reported (two fighters under one key is one man split in two, or a source’s error: either way a human decides). A fighter may hold several keys of one source (Kalshi issued second competitor ids for a few: Ozzy Diaz, King Green, Ding Meng, Serghei Spivac).

Functions

bind

bind(identity: Identity, rows: pd.DataFrame, table: str = 'fighter_keys') -> tuple[Identity, pd.DataFrame]

identity with the key rows of table (‘fighter_keys’ / ‘event_keys’ / ‘bout_keys’) added where new and consistent (see the module doc), and the findings (KEY_FINDINGS: kind, source, key, owner, detail).

competitor

competitor(market: Mapping[str, Any]) -> str | None

A winner market’s competitor id (custom_strike.ufc_competitor), else None.

kalshi_bout_keys

kalshi_bout_keys(matched: pd.DataFrame) -> pd.DataFrame

‘kalshi’ bout key rows: each matched Kalshi winner event (event_ticker, fight_id: its bout) -> the bout.

kalshi_keys

kalshi_keys(matched: pd.DataFrame, markets: Sequence[Mapping[str, Any]]) -> pd.DataFrame

‘kalshi’ key rows from the matched Kalshi fights.

Args: matched: one row per Kalshi winner event matched to a bout: event_ticker, fighter_a / fighter_b (Kalshi’s names), uid_a / uid_b (the fighters the matcher found them to be). markets: the winner markets (event_ticker, yes_sub_title, custom_strike): each market’s fighter is the event’s side whose name it carries exactly (names.canon_name; Kalshi’s own spelling on both).