Skip to content

betting_combat.trading.records

What one decision produces: its record (DecisionRecord: a trade, a shadow trade or a named no-trade) and its orders (OrderIntent), with the deterministic ids that make a retry harmless.

Classes

DecisionRecord

OrderIntent

Functions

book_json

book_json(quotes: dict[tuple[str, str], Quote]) -> dict[str, Any]

client_order_id

client_order_id(decision: str, venue: str, market_id: str, slice_no: int = 0, tag: str | None = None) -> str

Deterministic per decision, venue, market and working-order slice: a retry or a relaunch can never submit twice (a decision may buy several markets on one venue, and a working order one order per market each slice). Slice 0 keeps the id a decision’s order always had. tag: the joint execution’s trade (sell_DY, buy_DN, …), as two of its trades may send to one market in one slice.

decision_id

decision_id(card_date: dt.date, fight_id: str, strategy: str, clock_min: int) -> str