> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dune.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Prediction Markets

> Curated prediction market datasets for Polymarket and Kalshi on Dune

Prediction markets turn event outcomes into tradable instruments. Dune provides curated prediction market data combining onchain activity from **Polymarket** (the largest onchain prediction market) with regulated event-contract reporting from **Kalshi**.

<Info>
  **Maintained by:** Dune (Polymarket = project spell, Kalshi = partner data) · **Refresh:** \~24 hours · **Chains:** Polygon (Polymarket), Off-chain (Kalshi)
</Info>

<CardGroup cols={2}>
  <Card title="Explore on Dune" icon="arrow-up-right-from-square" href="https://dune.com/collection/prediction-markets/overview">
    Browse the curated Prediction Markets collection on dune.com: live dashboards, top markets, and example queries.
  </Card>

  <Card title="Get This Data" icon="database" href="https://dune.com/enterprise?dataset=prediction-markets">
    Access prediction market data via API, Datashare, or the Dune App.
  </Card>
</CardGroup>

## Available Protocols

<CardGroup cols={2}>
  <Card title="Cross-venue" icon="database" href="/data-catalog/curated/prediction-markets/prediction_markets/overview">
    Unified markets, trades, and hourly OHLCV across Polymarket and Kalshi on one schema
  </Card>

  <Card title="Polymarket (Polygon)" icon="database" href="/data-catalog/curated/prediction-markets/polymarket/overview">
    Onchain markets, trades, positions, and pricing across multiple granularities
  </Card>

  <Card title="Kalshi" icon="database" href="/data-catalog/curated/prediction-markets/kalshi/overview">
    Regulated event contracts: market details, per-fill trades, hourly OHLCV, and legacy reports
  </Card>

  <Card title="All Tables" icon="table" href="/data-catalog/curated/prediction-markets/all-tables-overview">
    Complete inventory of all prediction market tables
  </Card>
</CardGroup>

## When to Use These Tables

Use prediction market tables when you need to:

* Track trading volumes, market activity, and implied probabilities on Polymarket
* Analyze event-contract pricing and settlement on Kalshi
* Monitor user positions and portfolio composition across prediction markets
* Research market resolution outcomes and pricing efficiency
* Compare prediction market activity across venues

## Query Performance

Polymarket tables are views. Always filter on `block_time` ranges for `market_trades`, and use `condition_id` or `question` for market-specific queries.

```sql theme={null}
-- ✅ Good: time-bounded with market filter
SELECT * FROM polymarket_polygon.market_trades
WHERE block_time >= NOW() - INTERVAL '7' DAY
  AND question LIKE '%election%'
```

## Methodology

**Polymarket** tables are maintained by Dune ([source code](https://github.com/duneanalytics/spellbook)). They combine decoded on-chain events from Polymarket's CTF Exchange and NegRisk contracts on Polygon with market metadata from the Polymarket API (stored in `dune.polymarket_markets`). Trading data includes three matching types: complementary (buyer matches seller), MINT (system mints new outcome tokens), and MERGE (system redeems YES+NO tokens for collateral).

**Kalshi** data is sourced from Kalshi's public reporting. `market_report` contains market-level metadata; `trade_report` contains daily aggregated trade data (not individual fills — a single date and ticker can have multiple rows at different price points).

## Example Queries

**Top Polymarket markets by volume (last 7 days):**

```sql theme={null}
SELECT
  event_market_name,
  question,
  SUM(amount) AS total_volume_usd,
  COUNT(*) AS num_trades
FROM polymarket_polygon.market_trades
WHERE block_time >= NOW() - INTERVAL '7' DAY
GROUP BY 1, 2
ORDER BY 3 DESC
LIMIT 20
```

**Price history for a specific Polymarket outcome:**

```sql theme={null}
SELECT
  d.day,
  d.token_outcome,
  d.price
FROM polymarket_polygon.market_prices_daily d
JOIN polymarket_polygon.market_details m
  ON d.condition_id = m.condition_id
  AND d.token_id = m.token_id
WHERE m.question = 'Will Trump win the 2024 US Presidential Election?'
ORDER BY d.day
```

## Related Tables

* `dex.trades` — DEX trading data (Polymarket uses Polygon DEX infrastructure)
* `prices.day` / `prices.hour` — Token pricing feeds

<CardGroup cols={2}>
  <Card title="Enterprise Data Solutions" icon="building" href="https://dune.com/enterprise">
    Need custom prediction market datasets or dedicated support? Talk to our enterprise team.
  </Card>

  <Card title="Build Custom Models" icon="code" href="/api-reference/connectors/overview">
    Build private prediction market analytics pipelines with the dbt Connector.
  </Card>
</CardGroup>
