Skip to content

betting_combat.execution.card

card.py — the card run’s trading (Sam 2026-11-16): the one execution on the card’s session, every strategy with a config row on, each break’s plans.

STRATEGIES the strategies the card run can trade, by their config name; each has ``load_db``
(its saved fit), ``prepare_card(db, bouts)`` (once a card, before the first bell) and
``plan(bout_id, k, clock, lines, now=, settings=)`` (a break's plans, or why none)
CardTrading ``attach(session, …)``: nothing when no row is on; else the venues (Kalshi, Polymarket
US: the client and the session's live books), the executor, the card's books refreshed
(``refresh_card_odds``: Cito's and BestFightOdds' lines now - the pre-card update's are two
days old), each strategy loaded and prepared, and the session's hooks (``on_break``,
``on_trade``, ``on_tick``: the strategies' ``tick`` then the executor's) pointed at them; ``close()`` at
the card's end (every strategy's ``close`` too)

Classes

CardTrading

The card’s trading on its session (module doc).

attach

attach(session: CardSession, db: DBClient, providers: Providers, configs: Databases) -> CardTrading | None

The trading on session (its hooks set), or None when no strategy has a row on (the session only records).

close

close() -> dict[str, Any]

on_break

on_break(bout: Bout, k: int, clock: FightClock, lines: BreakLines | None) -> None

Round k’s bell: each strategy’s plans (on the venues its rows switch on), or its decision not to trade.

on_trade

on_trade(market: Any, trade: Any) -> None

A print of the card: to every strategy that reads prints (on_trade), then the executor.

tick

tick(now: Any) -> None

Each session tick: every strategy’s own (the rounds strategy’s live blocks re-read on the session’s clock), then the executor’s.