Skip to content

betting_combat.services.cards

When a card is due: the rule the card_ready sensor applies, kept pure.

A card is due once its first fight is within the lead window, and stays due while any of its fights is still to come or under way. Cards are read from Kalshi’s live-feed milestones (mma_match), grouped by the date in their winner event tickers.

Classes

CardPlan

Functions

next_card

next_card(milestones: Iterable[Milestone], now: dt.datetime, lead: dt.timedelta) -> CardPlan | None

run_key

run_key(card_date: dt.date, failed_runs: int) -> str

One run per card; a failed run is relaunched once per failure, under a new key.