Base URL: https://api.predmktdata.com
Get data flowing in 3 steps:
curl -H "x-api-key: YOUR_KEY" https://api.predmktdata.com/status
# List available files curl -H "x-api-key: YOUR_KEY" https://api.predmktdata.com/dumps # Download a Parquet file curl -L -H "x-api-key: YOUR_KEY" -o fills.parquet \ https://api.predmktdata.com/dumps/order_filled_events/20260405.parquet # Or query remotely with DuckDB (no download needed) # Get the presigned URL, then: SELECT * FROM read_parquet('URL')
That's it. You have Polymarket data. For full sync patterns, see Sync patterns below.
Polymarket is a prediction market where people bet on real-world outcomes. Every market is a yes/no question (e.g. "Will Bitcoin hit $100k by July 2026?"). Each side has a token that trades between $0 and $1 — if the event happens, "Yes" tokens pay out $1; otherwise, they're worth $0.
All trading happens on the Polygon blockchain — a public, permanent ledger where every transaction is recorded and verifiable. A wallet is a user's identity on the blockchain, represented by an address like 0xed86.... Every trade, deposit, and withdrawal is tied to a wallet address.
When a user buys an outcome, they receive outcome tokens — ERC-1155 tokens on Polygon, each identified by a large numeric token_id. On its own, a token_id is just a number — the included markets lookup table maps each one to its human-readable question and outcome (e.g. token 123... → "Will Bitcoin hit $100k?" / "Yes"). A user's position is their current holding of a specific outcome token: how many they hold, what they paid on average, and their realized profit/loss from any tokens they've already sold or redeemed.
predmktdata reads every relevant transaction from Polygon and delivers it as Parquet dumps and CSV API responses. You get two types of data:
You don't need to understand Solidity, ABIs, or how to talk to a blockchain node. The API handles all of that and gives you clean, structured data you can load into any database or spreadsheet.
All endpoints require an API key via the x-api-key header. Get your key by signing in with Google at predmktdata.com.
curl -H "x-api-key: YOUR_API_KEY" https://api.predmktdata.com/status
Current indexer state and table row counts. Returns JSON.
{
"last_block": 84570000,
"head_block": 84570000,
"tables": {
"order_filled_events": 854000000,
"order_filled_events_v2": 1500000,
"positions": 150000000,
"payout_redemptions": 93000000, ...
}
}
Fetch events as CSV. One table per request. Supports gzip and zstd compression.
| Param | Default | Description |
|---|---|---|
after_block | required | Return events after this block number |
limit | 5000 | Max blocks to include (1 - 5,000) |
tables | required | Single table name |
Block metadata is returned in response headers:
x-after-block — your requested after_blockx-last-block — last block in this chunk (use as next after_block)x-head-block — current chain headx-reorg — present if you're ahead of the indexer (rollback to this block)# Fetch fills for 500 blocks curl --compressed -H "x-api-key: YOUR_KEY" \ "https://api.predmktdata.com/events?after_block=84420000&limit=500&tables=order_filled_events" # Response: CSV with header row transaction_hash,log_index,block_number,exchange,maker,taker,... 0x7fe2...,210,84420001,ctf,0xed86...,0x9ce4...,...
Available tables: order_filled_events, order_filled_events_v2, position_splits, position_merges, payout_redemptions, position_conversions, positions.
order_filled_events covers the legacy CTF and NegRisk exchanges (active since Aug 2022). order_filled_events_v2 covers the new CTF v2 (0xE111…996B) and NegRisk v2 (0xe222…0F59) exchanges and has a different schema: a unified token_id, side as integer (0=buy, 1=sell), plus order_hash, builder, and metadata. Both tables continue to receive new fills — query each independently to capture all activity. See the schema sections below for full column details.All current positions for a wallet address. Returns CSV. Includes unrealized_pnl and total_pnl columns computed from live market prices (updated every minute).
All fills where address is maker or taker, across both v1 (order_filled_events) and v2 (order_filled_events_v2) exchange contracts. v2 fills are normalized to the v1 column shape (maker_asset_id/taker_asset_id, side as buy/sell) so a single client can consume both. The exchange column (ctf/neg_risk/ctf_v2/neg_risk_v2) tells you which contract emitted the fill. Returns CSV.
| Param | Default | Description |
|---|---|---|
after_block | 0 | Only fills after this block |
limit | 50000 | Max rows (up to 500,000) |
Current PnL summary for a wallet. Realized from closed trades, unrealized mark-to-market on open positions using live prices (updated every minute). All values in USD. Returns JSON.
{
"realized_pnl": -52.34,
"unrealized_pnl": 184.21,
"total_pnl": 131.87,
"portfolio_value": 1250.00,
"total_volume": 8340.50,
"active_positions": 12,
"markets_traded": 47
}
Real-time WebSocket feed of fills and position changes. Subscribe by wallet address or amount/price thresholds. Data pushes to you the moment the indexer commits — no polling needed.
Connect:
wscat -c "wss://api.predmktdata.com/ws/feed?x_api_key=YOUR_KEY"
Subscribe messages (send as JSON after connecting):
# Watch a specific wallet's fills and position changes {"action": "subscribe", "type": "user", "address": "0xabc..."} # Watch large fills (raw units, divide by 1e6 for USDC) {"action": "subscribe", "type": "threshold", "min_fill_amount": 10000000000} # Watch positions with low avg_price (cheap bets) {"action": "subscribe", "type": "threshold", "max_avg_price": 50000} # Unsubscribe {"action": "unsubscribe", "type": "user", "address": "0xabc..."} # Keepalive {"action": "ping"}
Messages you receive:
{
"fills": [{"transaction_hash": "0x...", "maker": "0x...", ...}],
"positions": [{"user_address": "0x...", "amount": 5000000, ...}]
}
Limits: 100 total connections, 5 per API key, 20 user subscriptions per connection. Values are raw i64 (same as REST API — divide by 1e6).
Firehose WebSocket for keeping your own database in sync. Catches up from a recent block, then streams all new events and positions as the indexer commits them. No subscriptions needed — you get everything.
| Param | Default | Description |
|---|---|---|
x_api_key | required | API key (query string) |
start_block | required | Block to start from (max ~900 blocks / 30 min behind head) |
tables | all | Comma-separated tables to stream (optional filter) |
Connect:
wscat -c "wss://api.predmktdata.com/ws/stream?x_api_key=YOUR_KEY&start_block=84650000" # Or stream only specific tables: wscat -c "wss://api.predmktdata.com/ws/stream?x_api_key=YOUR_KEY&start_block=84650000&tables=order_filled_events,positions"
Messages you receive:
# Catchup batches (sent rapidly until caught up) {"type": "batch", "from_block": 84650000, "to_block": 84650100, "order_filled_events": [{...}], "positions": [{...}], ...} # Catchup complete signal {"type": "caught_up", "block": 84651400} # Live batches (every few seconds as indexer commits) {"type": "batch", "from_block": 84651400, "to_block": 84651410, ...}
Limits: 10 concurrent stream connections (shared pool: 100 total, 5 per key). Slow consumers are disconnected (code 4008) — reconnect with a newer start_block.
List available Parquet dump files. Returns JSON with file paths and sizes.
Download a dump file (.parquet). Returns 302 redirect to a time-limited URL (20 min). Parquet files support remote querying with DuckDB via HTTP range requests.
| Table | Rows | Parquet | Type |
|---|---|---|---|
| order_filled_events | ~865M | ~18 GB | Append-only (v1 exchanges) |
| order_filled_events_v2 | growing | growing | Append-only (v2 exchanges, Apr 2026+) |
| payout_redemptions | ~93M | ~1.8 GB | Append-only |
| position_splits | ~7.7M | ~240 MB | Append-only |
| position_merges | ~7.8M | ~240 MB | Append-only |
| position_conversions | ~1.8M | ~30 MB | Append-only |
| positions | ~150M | ~4 GB | Mutable (UPSERT) |
| markets | ~15K | ~1 MB | Lookup (overwritten daily) |
Sizes are approximate and grow over time. With Parquet, you can query remotely with DuckDB without downloading — only the columns and rows you need are transferred.
| Column | Type | Notes |
|---|---|---|
| timestamp | timestamp | Block timestamp |
| transaction_hash | text | |
| block_number | bigint | |
| maker | text | Maker wallet address |
| taker | text | Taker wallet address |
| maker_asset_id | text | Usually "0" (USDC side) |
| taker_asset_id | text | Outcome token ID |
| maker_amount_filled | bigint | Raw units (divide by 1e6 for USDC) |
| taker_amount_filled | bigint | Raw units (divide by 1e6) |
| fee | bigint | Raw units |
| side | text | buy or sell |
The /events API returns additional columns: log_index, exchange. The timestamp column is named block_timestamp in API responses.
| Column | Type | Notes |
|---|---|---|
| timestamp | timestamp | Block timestamp |
| transaction_hash | text | |
| block_number | bigint | |
| exchange | text | ctf_v2 or neg_risk_v2 |
| order_hash | text | Order identifier emitted by the contract |
| maker | text | Maker wallet address |
| taker | text | Taker wallet address |
| side | integer | 0 = buy, 1 = sell (int, not text — different from v1) |
| token_id | text | Outcome token ID (unified — replaces maker_asset_id/taker_asset_id) |
| maker_amount_filled | bigint | Raw units (divide by 1e6 for USDC) |
| taker_amount_filled | bigint | Raw units (divide by 1e6) |
| fee | bigint | Raw units |
| builder | text | Address that built the order (often 0x0…0) |
| metadata | text | Order-level metadata emitted by the contract |
Cash-flow semantics match v1: for side=0 (buy), maker pays maker_amount_filled USDC and receives taker_amount_filled outcome tokens. For side=1 (sell), maker delivers tokens and receives USDC. To capture all Polymarket trading activity you must query both order_filled_events and order_filled_events_v2 — they are separate tables with different schemas.
| Column | Type | Notes |
|---|---|---|
| user_address | text | Wallet address |
| token_id | text | Outcome token ID |
| amount | bigint | Current position size (raw) |
| avg_price | bigint | Average entry price (divide by 1e6) |
| realized_pnl | bigint | Realized PnL (raw units) |
| total_bought | bigint | Total tokens bought (raw) |
| last_block | bigint | Last block this position was updated |
The /events API and /user endpoints add block_timestamp. The /user/*/positions endpoint also adds unrealized_pnl and total_pnl (computed from live market prices).
Lookup table that maps token IDs to human-readable market info. Join with event or position tables on yes_token_id / no_token_id to see which question and outcome a trade or position belongs to. Overwritten daily.
| Column | Type | Notes |
|---|---|---|
| condition_id | text | Unique identifier for the market condition |
| question | text | The market question (e.g. "Will Bitcoin hit $100k?") |
| outcome_yes | text | Label for the Yes side (e.g. "Yes", "Bitcoin") |
| outcome_no | text | Label for the No side (e.g. "No", "Ethereum") |
| yes_token_id | text | Token ID for the "Yes" outcome |
| no_token_id | text | Token ID for the "No" outcome |
| market_slug | text | URL slug on polymarket.com |
| end_date_iso | text | Market end date (ISO 8601) |
| neg_risk | boolean | Uses NegRisk exchange (multi-outcome markets) |
token_id (or taker_asset_id for fills) against yes_token_id or no_token_id in the markets table.
Who proposed the outcome of each market. Indexed from UMA OptimisticOracleV2, filtered to Polymarket adapters only. Full snapshot updated daily in uma/ folder.
| Column | Type | Notes |
|---|---|---|
| transaction_hash | text | On-chain transaction |
| block_number | bigint | Polygon block number |
| requester | text | Adapter contract address (V1/V2/V3) |
| proposer | text | Address that proposed the outcome |
| proposed_price | text | 1e18 = Yes, 0 = No, 0.5e18 = Unknown |
| ancillary_data | text | Question text (human-readable) |
| request_timestamp | bigint | UMA request timestamp (unix) |
| expiration_timestamp | bigint | Challenge window end (unix) |
When someone challenges a proposed outcome. ~2% of proposals are disputed.
| Column | Type | Notes |
|---|---|---|
| transaction_hash | text | On-chain transaction |
| block_number | bigint | Polygon block number |
| disputer | text | Address that disputed |
| proposer | text | Original proposer being disputed |
| proposed_price | text | The price being challenged |
| ancillary_data | text | Question text |
Final resolved outcome and bond payouts.
| Column | Type | Notes |
|---|---|---|
| transaction_hash | text | On-chain transaction |
| block_number | bigint | Polygon block number |
| proposer | text | Original proposer |
| disputer | text | Disputer (0x0 if undisputed) |
| settled_price | text | Final outcome (1e18=Yes, 0=No) |
| payout | text | Bond payout to winner |
| ancillary_data | text | Question text |
All errors return JSON with a detail field:
| Status | Meaning | Example |
|---|---|---|
| 401 | Missing or invalid API key | {"detail": "Unauthorized"} |
| 403 | Plan doesn't include this endpoint | {"detail": "Pro plan required"} |
| 400 | Bad request | {"detail": "Specify exactly one table per request."} |
| 422 | Missing required parameter | {"detail": [{"type": "missing", ...}]} |
| 429 | Rate limit exceeded | {"detail": "Rate limit exceeded"} |
Want your own complete, always-updated Polymarket database?
We wrote a step-by-step guide: create the schema, backfill the full history from dumps, and keep it synced in real time. Read the full guide ↗
positions/positions_current.parquet) and markets lookuppositions_current.parquet (overwritten daily)positions/positions_current.parquet that always represents the current state of every position. We update it daily (incremental merge Mon–Sat, full regen Sunday). The URL is stable — point your job at it and re-download once a day.
The API supports two compression algorithms via Accept-Encoding header:
gzip — universally supported, use curl --compressedzstd — ~30% smaller, faster. Send Accept-Encoding: zstd<table>/YYYYMMDD.parquet)| Feature | Lite ($49/mo) | Pro ($149/mo) |
|---|---|---|
| Full history of trades (since 2022) | ✓ | ✓ |
| Daily position snapshot (05:00 UTC) | ✓ | ✓ |
| Markets lookup table | ✓ | ✓ |
| UMA resolution data (proposals, disputes, settlements) | ✓ | ✓ |
| Updates | End-of-day | Real-time (<1s) |
| Real-time API (/events) | — | ✓ |
| Per-wallet queries (/user/*, /user/*/pnl) | — | ✓ |
| WebSocket real-time feed (/ws/feed) | — | ✓ |
| Firehose stream (/ws/stream) | — | ✓ |
| Rate limit (API) | Dumps only | 5 req/s |
| Dump downloads/day | 20,000 | 30,000 |
If you've signed up but haven't subscribed yet, you can preview the data shape before paying. Samples live under samples/ and are exposed by GET /dumps like any other dump file. Cap: 50 downloads/day.
All samples are CSV.gz (paid plans get Parquet for the full history) and cover one busy day — 2025-01-20, US inauguration day — plus a 10k slice of open positions and the markets lookup. Schema matches the paid dumps.
| File | Size | Contents |
|---|---|---|
samples/order_filled_events_sample.csv.gz | ~38 MB | All trades on 2025-01-20 |
samples/payout_redemptions_sample.csv.gz | ~2.7 MB | Redemptions on 2025-01-20 |
samples/position_merges_sample.csv.gz | ~448 KB | Merges on 2025-01-20 |
samples/markets_sample.csv.gz | ~281 KB | Markets lookup snapshot |
samples/position_conversions_sample.csv.gz | ~88 KB | NegRisk conversions on 2025-01-20 |
samples/positions_sample.csv.gz | ~812 KB | Random slice of 10k open positions |
samples/position_splits_sample.csv.gz | ~59 KB | Splits on 2025-01-20 |
Example:
curl -H "x-api-key: $KEY" -L \
https://api.predmktdata.com/dumps/samples/order_filled_events_sample.csv.gz \
-o trades.csv.gz