Skip to content

betting_combat.trading.tracker

Per-fight live state: feed phase, the fight clock, fired minutes.

The session feeds every feed poll through a tracker; the tracker says when a new decision minute is due. Replays of recorded sessions drive the same class, so a replay test exercises exactly the live logic. What the tracker could not believe (an unknown feed status, an impossible round) is counted in findings.

Classes

FeedSnapshot

One poll of Kalshi’s live fight feed for one fight.

FightTracker

feed_age_seconds

feed_age_seconds(now: dt.datetime) -> float

on_feed

on_feed(feed: FeedSnapshot, now: dt.datetime) -> ClockPosition | None

Advance on one feed poll. Returns the decision point when a NEW minute is due.

restored

restored(fight_id: str, rounds: int, anchors: dict[int, dt.datetime], fired: set[int], last_status: str | None, finished_at: dt.datetime | None) -> FightTracker

A tracker resumed from the database after a relaunch.