Use this file to discover all available pages before exploring further.
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
{ "coin": "btc", "slug": "btc-updown-15m-1774072800", "title": "Bitcoin Up or Down - March 21, 2:00AM-2:15AM ET", "conditionId": "0x037ad8cf0b1d7dc7febd2a46c400398838163dc3...", "clobTokenIds": ["11496172...", "66255671..."], "upOdds": 0.845, "downOdds": 0.155, "priceToBeat": 70694.18, "liquidity": 9833.25, "volume24h": 51679.05}
ETH Market
{ "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
{ "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
{ "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.
Pick a coin and interval to see the current market slug. Updates live with a countdown to the next window.The slug pattern is deterministic: {coin}-updown-{interval}-{windowTimestamp}. Compute it yourself:
const now = Math.floor(Date.now() / 1000);const window5m = Math.floor(now / 300) * 300;const window15m = Math.floor(now / 900) * 900;console.log(`btc-updown-5m-${window5m}`); // current BTC 5m slugconsole.log(`eth-updown-15m-${window15m}`); // current ETH 15m slug
You don’t need to compute slugs manually. The SDK’s shortForm() handles discovery automatically and gives you the slug, conditionId, and clobTokenIds on every rotation event.
The two CLOB token IDs (Up and Down outcomes). Pass these directly to OrderbookEngine.subscribe() to get real-time orderbook data for this market. See Orderbook + Short-Form below.
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
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.
Want depth data for crypto markets? Every ShortFormMarket in the rotation event includes clobTokenIds — the token IDs for both Up and Down outcomes. Pass them straight to OrderbookEngine and you get live orderbook depth, bid/ask spreads, and price moves alongside your settlement stream. One setup, three real-time feeds.
Here’s the full pattern: short-form discovers markets, hands the token IDs to the orderbook engine, and both streams run in parallel.
TypeScript
Rust
import { PolyNodeWS, OrderbookEngine } from 'polynode-sdk';const KEY = 'pn_live_...';const ws = new PolyNodeWS(KEY, 'wss://ws.polynode.dev/ws');const engine = new OrderbookEngine({ apiKey: KEY, compress: true });// 1. Start the short-form streamconst stream = ws.shortForm('5m', { coins: ['btc', 'eth'] });// 2. On each rotation, subscribe the orderbook to the new marketsstream.on('rotation', async (r) => { const tokenIds = r.markets.flatMap(m => m.clobTokenIds); await engine.subscribe(tokenIds); for (const m of r.markets) { console.log(`${m.coin}: beat $${m.priceToBeat} | ${(m.upOdds * 100).toFixed(0)}% up`); }});// 3. Orderbook eventsengine.on('ready', () => console.log(`${engine.size} books loaded`));engine.on('price', (p) => { for (const a of p.assets) { console.log(`Book: ${a.outcome} = ${a.price}`); }});// 4. Settlement events (trades happening on these markets)stream.on('settlement', (e) => { console.log(`Trade: ${e.outcome} $${e.taker_size} on ${e.event_slug}`);});
use polynode::{PolyNodeClient, ShortFormInterval, ShortFormMessage, OrderbookEngine, Coin};let client = PolyNodeClient::new("pn_live_...")?;let mut engine = OrderbookEngine::new("pn_live_...", true)?;let mut stream = client .short_form(ShortFormInterval::FiveMin) .coins(&[Coin::Btc, Coin::Eth]) .start() .await?;while let Some(msg) = stream.next().await { match msg { ShortFormMessage::Rotation(r) => { // Pass token IDs from the rotation to the orderbook engine let token_ids: Vec<&str> = r.markets.iter() .flat_map(|m| m.clob_token_ids.iter().map(|s| s.as_str())) .collect(); engine.subscribe(&token_ids).await?; for m in &r.markets { println!("{}: beat ${:?} | {:.0}% up", m.coin.id(), m.price_to_beat, m.up_odds * 100.0); } } ShortFormMessage::Event(e) => { /* handle settlements */ } ShortFormMessage::Error(e) => eprintln!("{}", e), }}
This gives you three real-time feeds from one setup: settlements (trade flow), orderbook (depth and price moves), and rotation enrichments (odds, liquidity, price-to-beat). Add a chainlink subscription on the same WebSocket connection for the underlying asset price too.