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
anchor_late
anchor_late(r: int, at: dt.datetime, now: dt.datetime) -> boolAnchor round r, whose start this run did not see (the feed first showed the
fight mid-way, or after a relaunch), at at: the session’s estimate from the
market’s bell of round r - 1 (session._late_anchor). Believed like any anchor.
feed_age_seconds
feed_age_seconds(now: dt.datetime) -> floaton_feed
on_feed(feed: FeedSnapshot, now: dt.datetime) -> ClockPosition | NoneAdvance 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) -> FightTrackerA tracker resumed from the database after a relaunch.