Documentation Index
Fetch the complete documentation index at: https://docs.predictiondata.dev/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Onchain order fills from Polymarket’s smart contracts. This data history goes back until 2022.
This is generated from the OrderFilled event, since OrdersMatched loses information about all the parties the orders are matched with. Data is scraped from the CTFExchange contract as well as the NegRiskCTFExchange contract.
Columns
Column | Type | Description |
|---|
block_number | integer | Polygon block number |
block_timestamp | integer | Block timestamp in milliseconds |
side | string | Trade side: BUY or SELL |
size | decimal | Number of contracts filled |
price | decimal | Price |
maker | string | Maker address |
taker | string | Taker address |
Fetching Data
Using Market Slug + Outcome
import requests
def download_onchain_fills(market_slug, outcome, date_str, api_key):
url = f"https://datasets.predictiondata.dev/polymarket/onchain/fills/{market_slug}/{outcome}/{date_str}.csv.gz"
params = {'slug': 'true', 'apikey': api_key}
response = requests.get(url, params=params)
response.raise_for_status()
with open(f'{market_slug}_{outcome}_{date_str}_fills.csv.gz', 'wb') as f:
f.write(response.content)
print(f"Downloaded to {market_slug}_{outcome}_{date_str}_fills.csv.gz")
if __name__ == "__main__":
api_key = "YOUR_API_KEY"
market_slug = "ramp-ipo-in-2025"
outcome = "YES"
date_str = "2025-11-16"
download_onchain_fills(market_slug, outcome, date_str, api_key)
Using Token ID
import requests
def download_onchain_fills_by_token(token_id, date_str, api_key):
url = f"https://datasets.predictiondata.dev/polymarket/onchain/fills/{token_id}/{date_str}.csv.gz"
params = {'apikey': api_key}
response = requests.get(url, params=params)
response.raise_for_status()
with open(f'{token_id}_{date_str}_fills.csv.gz', 'wb') as f:
f.write(response.content)
print(f"Downloaded to {token_id}_{date_str}_fills.csv.gz")
if __name__ == "__main__":
api_key = "YOUR_API_KEY"
token_id = "6535996220481600525438454491949371553057652243233032166205012948847090204871"
date_str = "2025-11-16"
download_onchain_fills_by_token(token_id, date_str, api_key)
Notes
- Date format:
YYYY-MM-DD
- No need to manage Polymarket’s frontend models (gamma) vs onchain CLOB token IDs
- Prices automatically calculated for both USDC trades and outcome-outcome trades (YES vs NO)