Check Timestamp Units Before Comparing Market Data
Most bad prediction-market backtests do not fail loudly. They fail by lining up two timestamps that look comparable and are not. One is in seconds, the other in milliseconds. One is the moment the exchange recorded an event, the other is the moment your process received the message. Join on those without checking, and your P&L is measuring a lag you never modeled.
This post walks through the timestamp units you will actually meet in Kalshi data, why a mismatch is invisible until it is expensive, and a small reconciliation record you can keep to catch it early.
The units you will actually encounter
A single venue often ships several timestamp conventions across its REST and streaming surfaces. Kalshi is a concrete example, and its documentation spells the formats out field by field.
Unix seconds show up in the historical endpoints. The candlestick query parameters are integers: start_ts and end_ts are Unix timestamps in seconds, and the docs note candlesticks will include those ending on or after the start time and on or before the end time.
Unix milliseconds show up elsewhere. The KALSHI-ACCESS-TIMESTAMP request-signing header must be in milliseconds, and getting that wrong is a classic integration bug. The official docs put it plainly: the timestamp must be milliseconds, not seconds, and the signed path excludes query parameters.
RFC3339 strings show up on object fields. A trade's created_time is an RFC3339 timestamp of execution such as "2023-11-07T05:31:56Z", and a market's expiration_time is an RFC3339 timestamp marking when it closes to new orders.
Split-field UTC date and time show up in the FIX market-data feed. A snapshot carries MDEntryDate as a UTC date in YYYYMMDD and MDEntryTime as a UTC time in HH:MM:SS.sss, so the full instant is two fields you must reassemble, not one epoch number.
And the same logical field name can differ by product. The Kalshi Predictions and Margin APIs do not share a single timestamp convention across all channels. Assuming a shared type across products is exactly the kind of guess that breaks silently. Re-read the field docs per endpoint and per product before writing a join.
Event time is not receipt time
Units are only half the problem. The other half is which clock you are reading.
- Event time: when the exchange says something happened. A fill's execution time or a book update's source-event time.
- Send time: when the server emitted the message. As of October 1, 2026, Kalshi Predictions WebSocket messages include sending_ts_ms, the server-side send timestamp in milliseconds.
- Receipt time: when your client read the bytes. This is your own clock, subject to network latency and local clock skew, and it is not in the payload at all.
These can differ by milliseconds on a calm market and by much more during a spike, which is exactly when your strategy logic matters most. If your backtest treats receipt time as event time, you are implicitly assuming zero latency. That is usually optimistic, and it inflates how early your model appears to react.
A hypothetical reconciliation record
Below is a clearly hypothetical row, with invented numbers, to show the shape of the problem. It is not a real market observation and not a recommendation. Treat every value as made up for illustration.
# HYPOTHETICAL. Invented values for illustration only.
# Same logical instant, four representations:
field raw_value parsed_as utc_instant
----------------- -------------------------- ------------------ --------------------------
candle start_ts 1790000000 Unix seconds 2026-10-27 00:53:20Z
sign timestamp 1790000000000 Unix milliseconds 2026-10-27 00:53:20Z
created_time 2026-10-27T00:53:20Z RFC3339 (UTC) 2026-10-27 00:53:20Z
fix date+time 20261027 + 00:53:20.000 YYYYMMDD+HH:MM:SS 2026-10-27 00:53:20Z
# The trap: feed the seconds value (1790000000) into a parser
# expecting milliseconds and you get 1970-01-21, not 2026.
# Feed the ms value into a seconds parser and you land ~56000 years out.Notice the failure mode. A seconds value misread as milliseconds lands in January 1970, which is at least obviously wrong. The reverse, a milliseconds value misread as seconds, lands tens of thousands of years in the future, also obviously wrong. The dangerous case is subtler: two feeds that are both plausible but offset, for example event time versus receipt time, where every row still looks like a sane 2026 date and the only symptom is a strategy that backtests better than it has any right to.
How a mismatch corrupts a backtest or quote comparison
Three concrete ways it bites:
- Lookahead. If one series is event time and the other is receipt time, a naive as-of join can let your signal 'see' a quote before it could have arrived, manufacturing edge that does not exist live.
- Misaligned bars. Mixing seconds and milliseconds when bucketing into candles can scatter trades into the wrong intervals, so a one-minute bar is built from the wrong set of prints.
- Phantom spreads. Comparing a bid from one feed against an ask from another when their timestamps are not actually contemporaneous produces crossed or inverted books that are artifacts, not opportunities.
None of these throw an exception. They just quietly shift your numbers, and the shift is often in the flattering direction, which is the worst kind.
A short checklist
- Record the raw value and the assumed unit for every timestamp, not just the parsed datetime. Keep the units in the schema.
- Normalize everything to a single UTC instant type at ingestion, and sanity-check the year after parsing. Anything in 1970 or the year 50000 is a unit bug.
- Label event time, send time, and receipt time as separate columns. Never overwrite one with another.
- When you join two feeds, join on the same clock, and document which clock that is.
- Re-read the field docs per endpoint and per product. The same name can mean a different type on a different channel.
Where this fits with paper research
If you are iterating on a strategy in a paper-research tool such as Banger, which runs code-first paper strategies and whose hosted historical backtesting currently supports Kalshi binary markets, the same discipline applies. A paper fill is evidence under a specific data, fill, fee, and valuation model, not proof of live execution, and that evidence is only as trustworthy as the timestamps underneath it. Pin an exact current market ticker, keep raw timestamps alongside parsed ones in whatever record you inspect, and confirm which clock your comparison is using before you read a result as signal. The cheapest bug to fix is the one you catch at ingestion, not the one you discover after you have drawn a conclusion from it.
Sources
- Get Market Candlesticks - Kalshi API Documentation
- Quick Start: Authenticated Requests - Kalshi API Documentation
- API Keys - Kalshi API Documentation
- WebSocket Connection - Kalshi API Documentation
- API Changelog - Kalshi API Documentation (sending_ts_ms)
- Market Data - Kalshi API Documentation (FIX)
- Kalshi Market Data Endpoints and Response Structure
- Kalshi API Guide 2026: Auth, WebSocket, Candlesticks & SDKs
- Banger - Kalshi Paper Strategies