Skip to content
Outcome
Open the app
All research guides

Data foundations · 6 min read

How to work with historical prediction market data

A current market price tells you what traders are paying now. Historical prediction market data lets you ask what they expected before an announcement, how quickly prices changed, and how much trading accompanied the move. Start by deciding which observation answers your question.

Choose the observation before the chart

Outcome exposes market metadata, current market state, individual trades, and settled results through SQL. The markets table is useful for finding a question and examining its current state. Use trades when you need prices observed at earlier times; a current yes_price cannot reconstruct a historical series.

Keep venue and ticker together as the market identifier. Similar titles on Kalshi and Polymarket are not proof that two contracts resolve the same way. Compare the rules, cutoff times, and exact YES outcome before treating their prices as comparable.

  • Use markets to discover titles, identifiers, rules, and current prices.
  • Use trades for timestamped transactions, YES/NO prices, and contract counts.
  • Use resolved_markets to inspect final result labels before defining an outcome variable.
  • Check GET /v1/schema for the tables and column types currently available to your query.

Check coverage for the market you are studying

Pick a venue and ticker from markets, then inspect the available time range. Replace YOUR_VENUE and YOUR_TICKER in these examples with that pair. The first and last observed trade are dataset observations, not a promise that every intervening trade is present.

A quiet period can mean that nobody traded, that collection has a gap, or that your filters exclude the observations you expected. Check the market's open and close times, inspect smaller windows, and record missing periods before drawing a continuous line through them.

Available observations for one market
SELECT
  venue,
  ticker,
  min(created_time) AS first_observed_trade,
  max(created_time) AS last_observed_trade,
  count() AS observed_trades
FROM trades
WHERE venue = 'YOUR_VENUE'
  AND ticker = 'YOUR_TICKER'
  AND is_deleted = 0
GROUP BY venue, ticker

Build an hourly price series with an explicit rule

For a simple line chart, select the last observed YES trade in each UTC hour. This example uses an illustrative one-day window; change it to dates within the market's available history. The upper bound is exclusive, so adjacent windows do not overlap.

argMax selects the price associated with the largest timestamp and trade ID tuple. The ID breaks ties consistently; it does not establish the true ordering of trades with the same timestamp. The output includes only hours with observations. A missing hour is not a zero-probability forecast.

Hourly last-trade prices, with observation counts
SELECT
  toStartOfHour(created_time, 'UTC') AS hour_utc,
  argMax(yes_price, tuple(created_time, trade_id)) AS last_yes_price,
  count() AS observed_trades,
  sum(count) AS contracts_traded
FROM trades
WHERE venue = 'YOUR_VENUE'
  AND ticker = 'YOUR_TICKER'
  AND is_deleted = 0
  AND created_time >= toDateTime('2026-10-01 00:00:00', 'UTC')
  AND created_time < toDateTime('2026-10-02 00:00:00', 'UTC')
GROUP BY hour_utc
ORDER BY hour_utc

Explain what the price series measures

An hourly last-trade price, an average trade price, and a volume-weighted price answer different questions. A last-trade series follows the most recent transaction in each bucket. A volume-weighted series gives larger trades more influence. Neither is automatically the price at which you could have traded a particular size.

For binary contracts, researchers often interpret a YES price on the 0–1 scale as an implied probability. That interpretation does not remove fees, spread, stale observations, or differences in contract rules. Keep the raw price and units available alongside any percentage display.

Make the analysis reproducible

A useful public notebook explains the research question before showing the chart. Include the venue and ticker, UTC date range, price-selection rule, SQL, and treatment of empty periods. Describe the finding separately from the method so readers can tell an observed change from your explanation of it.

When comparing a price move with a news event, record the event timestamp and source. The fact that two things occurred close together does not, by itself, show that one caused the other. Preserve the query and refresh time so later readers can understand changes in the underlying data.