API · Build
Polymarket runs 5- and 15-minute crypto up/down markets — "Bitcoin Up or Down, 4:30-4:35PM ET" — that open and resolve every few minutes, hundreds a day. They're the most popular target for API bots because they're frequent, liquid, and purely mechanical. This page is the API mechanics: how to find them, read them, and wire a (paper-first) bot — not a magic edge. Most short-timeframe bots lose to latency and fees; we say so up front.
Find the live 5-minute markets (Gamma)
They follow a predictable slug pattern — btc-updown-5m-<unix-window-start> — and surface
in search and the Gamma feed. Pull the active ones, newest first:
curl -s "https://gamma-api.polymarket.com/public-search?q=bitcoin%20up%20or%20down&limit_per_type=10"
Each market gives you its conditionId and the two clobTokenIds (Up = index 0,
Down = index 1 — read the outcomes array to be sure). Those token IDs are what you trade.
The bot loop
Every short-TF crypto bot is the same shape — only the signal differs:
- Read the underlying — BTC price/velocity from an exchange feed (Binance, Coinbase) or
Polymarket's RTDS (
crypto_prices/crypto_prices_chainlink). - Read the market — the CLOB order book for the Up/Down token; compute mid and the cost to take size.
- Decide — your signal says "Up cheap vs my estimate." Gate on time-to-expiry (don't enter in the last seconds) and on the spread (skip when illiquid).
- Execute — a
FOK/FAKorder to take immediately, or a restingGTCto be the maker (and earn rebates). - Exit — take-profit, stop-loss, or just hold to resolution (it's binary; it settles 1 or 0).
Estimate your entry before you trade it
Walk the live book to see what your size actually costs (this is paper — places no order):
Why fees & latency dominate
- Fees: takers pay on-chain at match; makers pay 0. On a market that moves a cent or two, the taker fee can eat the whole edge — prefer maker orders or a real mispricing.
- Latency: by the time your HTTP order signs and lands, the move may be priced in. Measure your event→fill time honestly (it's often 0.5-1.5s on Python). Rust is faster; for deposit wallets it's the only working client today.
Paper first — always
Simulate fills against the live book before risking a cent. The read-only MCP
has a paper_quote tool, and the paper-trading engine
chapter shows a realistic fill simulator. Prove a positive expectancy on paper across hundreds of windows
before you ever flip to live.
Next: The 5-minute crypto bot chapter (strategy) · CLOB API · WebSocket & RTDS.
Educational only. Automated trading risks real money; most short-timeframe bots lose. Not financial advice.





