Auto-rotating streams for 5-minute, 15-minute, and hourly crypto prediction markets
Short-form markets are Polymarket’s Chainlink-based crypto prediction markets that rotate on fixed intervals. Bitcoin, Ethereum, Solana, XRP, Dogecoin, Hyperliquid, and BNB each have active 5-minute, 15-minute, and 1-hour “Up or Down” markets running continuously.The SDK handles everything: discovering the current window’s markets, subscribing for real-time events, and automatically rotating to the next window when the current one expires. You get enriched market data including the price-to-beat (Chainlink opening price), live odds, liquidity, and volume with zero additional latency.
Each market in the rotation includes enrichment data at zero cost:
BTC Market
Copy
{ "coin": "btc", "slug": "btc-updown-15m-1774072800", "title": "Bitcoin Up or Down - March 21, 2:00AM-2:15AM ET", "upOdds": 0.845, "downOdds": 0.155, "priceToBeat": 70694.18, "liquidity": 9833.25, "volume24h": 51679.05}
ETH Market
Copy
{ "coin": "eth", "slug": "eth-updown-15m-1774072800", "title": "Ethereum Up or Down - March 21, 2:00AM-2:15AM ET", "upOdds": 0.365, "downOdds": 0.635, "priceToBeat": 2152.93, "liquidity": 2289.0, "volume24h": 14602.61}
SOL Market
Copy
{ "coin": "sol", "slug": "sol-updown-15m-1774072800", "title": "Solana Up or Down - March 21, 2:00AM-2:15AM ET", "upOdds": 0.955, "downOdds": 0.045, "priceToBeat": 89.97, "liquidity": 3004.32, "volume24h": 4953.08}
Settlement events flow in real-time as trades happen. Here’s a real settlement captured from the live stream:
Settlement Event
Copy
{ "event_type": "settlement", "status": "pending", "event_slug": "btc-updown-15m-1774073700", "event_title": "Bitcoin Up or Down - March 21, 2:15AM-2:30AM ET", "market_slug": "btc-updown-15m-1774073700", "market_title": "Bitcoin Up or Down - March 21, 2:15AM-2:30AM ET", "outcome": "Down", "taker_side": "SELL", "taker_size": 7.58, "taker_price": 0.33, "taker_wallet": "0xe49b2c1ca08c4aef70c061ef9cfcabbcea638973", "taker_base_fee": 1000, "tick_size": 0.01, "neg_risk": false, "condition_id": "0x037ad8cf0b1d7dc7febd2a46c400398838163dc3...", "detected_at": 1774074055797, "tx_hash": "0x726b5ba5d7c48d277f7923a9482a3f7f1fcfac36...", "outcomes": ["Up", "Down"], "trades": [ { "maker": "0xd44e29936409019f93993de8bd603ef6cb1bb15e", "taker": "0xe49b2c1ca08c4aef70c061ef9cfcabbcea638973", "outcome": "Down", "side": "BUY", "price": 0.37, "size": 5, "maker_amount": "1850000", "taker_amount": "5000000" } ]}
In a 25-second test, the 15-minute stream received 157 settlement events across 3 coins. The 5-minute stream received 323 events across 2 coins in 20 seconds. These markets are very active.
The Chainlink opening price for this window. For “Up” to win, the closing price must exceed this value. Fetched once per rotation via the Polymarket crypto-price API.
Seconds remaining in the current window. Computed client-side (zero cost). Available on the rotation event and as a live getter on the stream.
None of these enrichments touch the event hot path. priceToBeat is one HTTP call per coin per rotation (e.g., 7 calls every 15 minutes). Everything else is parsed from data already fetched during discovery or computed locally.
The primary event. Fired when a trade is detected on any subscribed short-form market. Includes the full settlement payload with market metadata, wallet addresses, trade size, and outcome.
TypeScript
Rust
Copy
stream.on('settlement', (event) => { console.log(event.market_slug); // 'btc-updown-15m-1774072800' console.log(event.outcome); // 'Up' or 'Down' console.log(event.taker_size); // 12.5 console.log(event.status); // 'pending' or 'confirmed'});
On start and at each rotation, the SDK fetches market data from the Gamma API proxy. For 5m and 15m markets, it constructs deterministic slugs like btc-updown-15m-{timestamp}. For hourly markets, it queries by series. All 7 coins are fetched in parallel.
2
Enrichment
In parallel with discovery, the SDK fetches the Chainlink opening price (price-to-beat) for each coin. Odds, liquidity, and volume are parsed from the existing Gamma response. No extra network calls for these.
3
Subscribe
The SDK subscribes to settlements with slug filters for all discovered markets on the existing WebSocket connection. Events start flowing immediately.
4
Rotate
A timer fires at windowEnd + 3 seconds. The SDK unsubscribes, re-discovers the next window’s markets, and resubscribes. A rotation event is emitted with the new market data.