New realtime endpoint: Ohio (AWS us-east-2, next to Kalshi) — Binance from Tokyo at ~65.0 ms one-way to your clientNew endpoint: Ohio · ~65.0 ms one-way

Configure
Low-Latency Trading Solutions
CART
Market data

Inside a Series-Day Bundle: the Tick File Format

What is inside a prediction-market series-day bundle: zstd JSON-lines tick files with L2 order books, nanosecond timestamps and a parser that reads every venue.

9 min readPublished Aug 12, 2026Updated Sep 17, 2026
Compression
zstd
Timestamps
ns, UTC
Schema
1 for all venues
Reader
free, Python stdlib

A series-day bundle is the unit our archive sells prediction-market data in: all contract files of one series — say, every Kalshi BTC 15m market — for one UTC day. This guide walks through exactly what is inside those files, byte by byte, so you can decide whether to write your own parser (it is easy) or use the free tooling (it is easier). Everything shown below comes verbatim from the free Kalshi sample day you can download right now. The Deribit option-chain day bundles in the shop use the identical file format — one file per call or put, plus mark-price lines (type 7) that carry delta, gamma, vega, theta and implied vols.

Everything below runs on the CryptoStruct archive: every message Kalshi, Polymarket and 35+ crypto venues publish — every Level-2 snapshot and update at full depth, every trade, every contract, every day since we added the venue — captured co-located with nanosecond venue and receive timestamps and a gap-audited event-id chain, in one normalized schema. It is the same capture our own trading engine and enterprise feeds run on, sold as €1 day bundles you buy as a guest in the Data Shop with instant download — no subscription, no minimum, no sales call. Free full-day samples let you run every command in this guide before paying.

File anatomy: one contract, one day, JSON lines

Each file is named {instrument_id}_{date}.txt.zst and is zstd-compressed text. The first line is a JSON object with the instrument's masterdata; every following line is one event encoded as a JSON array. The first line of the Kalshi sample looks like this (truncated):

466528_2026-07-29.txt — line 1 (masterdata)
{"instrument":{"id":466528,"code":"KXBTCMINY-27JAN01-55000.00",
  "native_code":{"default":"KXBTCMINY-27JAN01-55000.00"},
  "type":"perpetual","state":"open",
  "exchange_id":46,"exchange_code":"kalshi",
  "ticksize":0.01,"lot_size":0.01,"min_order":0.01, …}}
Recorder vocabulary

Raw files carry "type":"perpetual" even for event contracts — that is the recorder's internal vocabulary, kept stable for parser compatibility. The shop and analytics classify these venues as the prediction class.

Every event line shares one envelope, regardless of venue: [msgType, instrumentId, prevEventId, eventId, adapterTs, exchangeTs, data, …]. adapterTs is when our co-located recorder received the message; exchangeTs is the venue's own timestamp — both integer nanoseconds since epoch, UTC. The prevEventId/eventId chain lets you verify you have every message. A real trade from the sample:

a real trade event (msgType 2)
[2,466528,"8454531473485012705","5466866425187754076",
 1785283123014075654,          ← adapterTs (ns, capture)
 1785283123000000000,          ← exchangeTs (ns, venue)
 [[1,"0.6","2.88","e463494f-…",1785283123000000000]]]
   ↑side  ↑price ↑qty  ↑trade id      ↑per-fill ts

Message types

msgTypeMeaningNotes
0Order-book snapshotFull L2 state; a new snapshot resets the book
1Order-book updateIncremental L2 change: [side, price, quantity, count] — quantity 0 removes the level
2TradesOne or more fills: side, price, quantity, trade id
5Instrument stateTrading-status changes (different envelope shape)
6Top-of-book (BBO)Not present in the recorded Kalshi and Polymarket files — top-of-book comes from the L2 replay
7Mark priceDerivatives; carries options greeks on options venues
8Index priceUnderlying reference
9FundingPerpetuals only
17LiquidationsDerivatives only, files from 2026 on

Prediction-market files consist almost entirely of types 0, 1, 2 and 5 — order-book life plus trades.

In the CryptoStruct prediction-market archive, Kalshi and Polymarket files do not carry a separate type-6 BBO stream — the top-of-book at any moment is reconstructed by replaying types 0/1, and the free reader does this for you with a Book class. Prices on event contracts live in 0..1: in the sample files shown here, the recorded tick size is 0.01 for the Kalshi contract (USD) and 0.001 for the Polymarket contract (USDC) — tick sizes are market-specific and may change over time. Turnover in our analytics is USD-normalized.

Parsing: three lines to first trades

The free AI toolkit ships cryptostruct_reader.py — a streaming parser with a CLI. The reader itself uses only the Python standard library; decompression requires either the zstd CLI or the optional zstandard package, whichever is available:

quickstart
# summary of a day file (counts per message type, time span)
python3 cryptostruct_reader.py info 466528_2026-07-29.txt.zst

# all trades as CSV / Parquet
python3 cryptostruct_reader.py trades 466528_2026-07-29.txt.zst --out trades.csv

# order book sampled every second, top 5 levels
python3 cryptostruct_reader.py book 466528_2026-07-29.txt.zst --every 1s --depth 5

Writing your own parser instead is deliberately easy — iterate lines, json.loads, switch on msgType — but three properties of the format bite people who skim:

Pitfall 1 — multi-frame zstd

Day files are concatenations of multiple zstd frames. Some stream decoders stop silently after the first frame (Node's built-in zstd stream does). Use zstd -dc or a library that reads all frames — and sanity-check that your last event is near 24:00 UTC.

Pitfall 2 — decimal strings

Prices and quantities are strings ("0.6", not 0.6) so no precision is lost in transit. Parse them with a decimal type if you aggregate money; casting to float is fine for features, wrong for accounting.

Pitfall 3 — nanosecond integers

Timestamps like 1785283123014075654 exceed the 53-bit float mantissa — JavaScript's plain JSON.parse silently corrupts them. Use BigInt-aware parsing in JS; Python ints are fine.

No parser at all: CSV and Parquet exports

Every sample and purchased day also serves flat exports via ?format= on its download link: trades.csv.gz, bbo.csv.gz, liquidations.csv.gz and Parquet variants — columns per our docs convention with microsecond UTC timestamps (the native files stay nanoseconds). Note the BBO export does not exist for files that carry no type-6 BBO stream (in this archive: Kalshi, Polymarket, BitMEX, Coinbase, Kraken spot) — there the L2 replay above is the way to top-of-book.

What you can buy today

SeriesVenueDaysCoverageSize
BTC Up/Down 15mKalshi220February 2026 – present89.0 GBBrowse days
Bitcoin price Above/belowKalshi220February 2026 – present177 GBBrowse days
BTC Up/Down 5mPolymarket234February 2026 – present244 GBBrowse days
BTC Up/Down 15mPolymarket360October 2025 – present118 GBBrowse days
BTC Above (price strikes)Polymarket506May 2025 – present62.6 GBBrowse days

Live coverage of some flagship series (updates daily). Each day is €1 and downloads per file or as one ZIP.

Limitations

This walkthrough covers the fields relevant for prediction-market work; the complete field-by-field specification (options greeks, funding, schema-version tails) lives in the shipped format reference and the official protocol docs. Sample lines are from July 2026 files; the schema is versioned and additive, so older files can lack newer trailing fields — parse positionally and tolerate unknown tails. Not investment advice; this is a file-format guide.

Why CryptoStruct

Why buy the data in this guide here

Four things every page on this site is built on — and the reason the numbers above exist at all.

We record everything

The complete public feed of each venue as it was published: every Level-2 snapshot and update at the venue's full book depth, every trade with its aggressor side, every quote, funding, mark-price and liquidation event — for every instrument the venue lists, every UTC day since we added the venue. Nothing sampled, no top-N cut, no on-demand capture.

Institutional grade

Captured co-located at the venue with the exchange timestamp and our receive timestamp in integer nanoseconds, an event-id chain that makes any gap visible, and one normalized schema across 35+ venues — the same capture our own high-frequency trading engine and enterprise feeds run on.

€1 per instrument-day

Any instrument-day is €1, series-day bundles start at €1 — no subscription, no minimum order, no tiers to unlock. Credit packs lower the effective price and never expire, and every venue has free full-day samples to test against first.

Self-service for everyone

Pick the days in the Data Shop, pay by card as a guest and download immediately — no sales call, no enterprise contract, no KYC. Coding agents buy the same files through the MCP server, and the free Agent Skill teaches them the format.

FAQ

Frequently asked questions

What format is Kalshi and Polymarket historical data in?

zstd-compressed JSON lines: line 1 is instrument masterdata, every other line one event (trade, L2 book update, snapshot) with nanosecond UTC timestamps. The schema is identical across all venues in the archive.

Do I get the full order book or just trades?

Both: every trade print and the complete L2 order-book evolution (snapshots + incremental updates). Top-of-book is derived by replaying the book — the free Python reader does that out of the box.

Can I get the data as CSV or Parquet instead?

Yes — every sample and purchased day exports as gzipped CSV or Parquet via ?format= on its download link, no extra cost. Timestamps in the exports are microseconds; the native tick files keep nanoseconds.

Is there a free sample to test my parser against?

Yes: complete free sample days — including one Kalshi and one Polymarket contract — are on the downloads page, in exactly the shop format, next to the free reader and format reference.

CryptoStruct Research Team · Market data & trading infrastructure

The team that records tick data co-located at 36+ venues and runs the low-latency trading stack behind it, as part of the SSW Group.

Topic hubs

Browse the topics behind this guide