betting_combat.features.market_blocks
market_blocks — features.market_blocks: fight x round x 30-second block x market, WHAT HAPPENED IN THE MARKET
IN THE BLOCK - the trades printed in it and the quote at its start and its end - on the same grid as the stats’
blocks (fight_blocks), so a fight’s stats, prices and outcomes meet block by block. Separate from the stats:
every fight with prices, as far back as each market’s tape goes (Kalshi’s winner from 2025-05, its other markets
from 2026-01), not only the fights Cito read. The venues: Kalshi (its prints and its recorded book), Polymarket
(its prints; its minute bars carry no bid / ask, their last price in minute_last_end) and Polymarket US (its
minute bars’ bid / ask).
MarketBlocksTable NAME market_blocks, KEY (bout_id, round, block, market_id), DATE dateThe grid: each round of a fight with a clock - Cito’s round start where Cito read the fight (the stats’ blocks’
own), else the market clock’s (features.market.read_clock: Cito told / the rounds tape / derived from the settle,
its teller in clock_source) - two blocks in the break before the bell (-2 = 60-30 s before, -1 = the last 30 s),
then a block every 30 s OF THE FIGHT CLOCK while the round is on (the last round to its official finish second):
where Cito read the round, each block’s wall times are the stats’ blocks’ (when the fight clock reached its start /
end: a stop of the clock - a foul, a doctor - in the block it happened in, the blocks after it moved by it; a round’s
last block ends LATE_S after the round, as its stats take Cito’s readings to then); the market clock’s rounds know no
stops (their blocks run on the wall clock from the bell). A minute bar is stored only when it changes: each market’s
last bar before the card’s window is read with the window’s. The markets: each
fight’s Kalshi winner (both fighters’), distance, ‘ends before round k’ and method-of-finish KO markets, on the
venue’s YES side as listed (our side is the feature layer’s).
A row:
bout_id, round, block, market_id the key; block_s (-60 / -30 / 0 / 30 …), fight_s, block_at, block_end_at
event_id, date, venue, kind, method, market_round, fighter_id the market (market_round: an ‘ends before’ line)
clock_source ‘cito’ / ‘told’ / ‘tape’ / ‘derived’
trades, contracts, yes_taker, no_taker, notional the prints in the block: how many, contracts, those a YES
buyer / a NO buyer took, dollars (contracts x YES price)
first_p, last_p, high_p, low_p, vwap their YES prices
bid_start, ask_start, bid_end, ask_end the YES bid / ask at the block’s start and end
bid_size_start, ask_size_start, bid_size_end, ask_size_end their sizes (the book only)
quote_source ‘book’ (the top of the recorded book, book_tops) or ‘minute’ (the last minute bar known by
then: a minute’s close, known a minute after its stamp); blank: no quote yet
minute_last_end the last price of the last minute bar known at the block’s end (Polymarket’s only quote)
quote_age_start_s, quote_age_end_s how old that quote was (the book: since its last change)
quote_changes the book’s top moves in the block (the book only)
Nothing thus far, nothing on our side: what happened in the block, as the venue printed and quoted it.
Classes
MarketBlocksTable
Bases: FeatureTable
features.market_blocks: fight x round x 30-second block x market, what the market did (module doc).
blocks
blocks(day: _Day) -> pd.DataFrameOne card day’s market blocks: every block of the grid x every market of its fight.
build
build(db: DBClient, base: Base | None = None) -> dict[str, int]compute
compute(base: Base) -> pd.DataFrameupdate
update(db: DBClient, since: dt.date, base: Base | None = None) -> dict[str, int]write
write(db: DBClient, rows: pd.DataFrame) -> dict[str, int]Functions
grid
grid(base: Base, clock: pd.DataFrame, cito: pd.DataFrame) -> pd.DataFrameEvery block of every clocked round (module doc): bout_id, round, block, block_s, fight_s, block_at, block_end_at, clock_source, event_id, date.