Polymarket 5 Minute Backtest: Tick-Level Up/Down Data
Five-minute Up/Down windows are a speed test — 288 markets per day where the last 60 seconds dominate. Tick clocks matter more here than on any longer interval.
A 5m window lives briefly: opening quotes, a sprint of trades into the close, then settlement. Backtests here are mostly tests of how fast your model reprices when spot ticks through the strike.
Start with btc-updown-5m. Platform total ~207.0M Polymarket messages since 2025-06-01.
Inputs
What you need for a 5-minute Polymarket backtest
What a serious backtest needs beyond candles.
Millisecond-aware timestamps
Use exchange timestamps for economic features. Receive-time lag is a first-class signal on 5m windows.
Final-minute path
Consider /v1/book/deltas if you need the path of mid into the close, not a single snapshot.
Strict fill rules
One-sided books are common late in the window — skip rather than inventing a mid.
Coverage
Live 5-minute coverage
Per-coin 5m counts live on /data/polymarket/*-updown-5m.
Windows / day / coin
288
5-minute family
BTC 5m data page
Event rates
/data/polymarket/btc-updown-5m
Polymarket total
~207.0M
As of
2026-10-25
Code
End-to-end 5-minute backtest (REST + requests)
Family btc-updown-5m — same threshold skeleton as 15m, tighter windows.
import os
import requests
API = "https://api.aymardata.com/v1"
KEY = os.environ["AYMARDATA_API_KEY"] # export AYMARDATA_API_KEY=ad_live_…
H = {"Authorization": f"Bearer {KEY}", "User-Agent": "aymardata-backtest/1.0"}
def list_windows(q: str, interval: str, limit: int = 40):
r = requests.get(
f"{API}/markets",
headers=H,
params={"source": "polymarket", "q": q, "interval": interval, "limit": limit},
timeout=30,
)
r.raise_for_status()
# De-dupe Up/Down rows that share the same window slug
seen, out = set(), []
for row in r.json()["data"]:
m = row["market"]
if m in seen:
continue
seen.add(m)
out.append(row)
return out
def book(market: str, outcome: str, at: str, depth: int = 5):
r = requests.get(
f"{API}/book",
headers=H,
params={
"source": "polymarket",
"market": market,
"outcome": outcome,
"at": at,
"depth": depth,
},
timeout=30,
)
r.raise_for_status()
return r.json()
def settlement(market: str):
r = requests.get(
f"{API}/settlement",
headers=H,
params={"source": "polymarket", "market": market},
timeout=30,
)
if r.status_code == 404:
return None
r.raise_for_status()
return r.json()
def mid(snap):
bids, asks = snap.get("bids") or [], snap.get("asks") or []
if not bids or not asks:
return None
return (bids[0]["price"] + asks[0]["price"]) / 2
THRESHOLD = 0.45
rows = []
for w in list_windows("btc-updown-5m", "5m"):
market = w["market"]
hist = w.get("history_from")
if not hist:
continue
# Sample ~60s after history starts
at = hist.replace("+00:00", "Z")
if at.endswith("Z") is False and "T" in at:
at = at + ("Z" if "+" not in at else "")
snap = book(market, "up", at if "T" in at else hist)
m = mid(snap)
if m is None or m >= THRESHOLD:
continue
# Buy Up at the ask; score later against settlement when resolved
entry = (snap["asks"] or [{}])[0].get("price")
sett = settlement(market)
won = None
if sett:
outcome = str(sett.get("outcome") or sett.get("winner") or "").lower()
won = outcome in ("up", "yes", "1")
rows.append({"market": market, "mid": m, "entry": entry, "won": won})
# Counts only — label any P&L/win-rate/edge you add:
# "Illustrative output — not a real result"
print(f"signals={len(rows)} sample={rows[:3]}")
API base https://api.aymardata.com. Set AYMARDATA_API_KEY from your dashboard. Examples use requests. Any P&L, win-rate, or edge figure derived from these snippets is illustrative output — not a real result.
Free samples
Download sample CSV / Parquet
No key required — small files for schema and local smoke tests.
FAQ
Common questions
Should I start on 5m or 15m?
Start on 15m for strategy logic, then move to 5m when you are ready to stress latency and final-minute collapse.
Related
Data pages and guides
Catalog leaves for schema and samples; guides for longer walkthroughs.
Run your first backtest with real ticks
Get a key, paste the snippet above, then expand to the full catalog.
Educational content, not trading or investment advice. Past data doesn't predict future results.