PolymarketClickHouse Workshops
Polymarket track

Polymarket real-time analytics

Stream public prediction-market data, model it in ClickHouse Cloud, and publish a market pulse dashboard.

Your computer
macOS terminal: Run workshop commands in Terminal using zsh or bash.

Watch a public market move, see the update land in your own ClickHouse Cloud service, and explain whether the move came with a wider spread or faster trading.

This is a market-data workshop, not a trading tutorial. It uses only public Gamma, CLOB, and Data APIs. You do not create a wallet, deposit funds, place an order, or provide a Polymarket secret.

Choose your role

What you build

Gamma market discovery ─┐
                        ├─ stateless collector ─ ClickHouse Cloud ─ saved queries
CLOB WebSocket + REST ──┤                         │
Data API trades ────────┘                         └─ 1-minute midpoint MV ─ dashboard
  • polymarket.markets: the watched markets and their Yes/No token metadata.
  • polymarket.price_ticks: live quote, price-change, and top-of-book observations.
  • polymarket.trades: reconciled public trades with deterministic IDs.
  • polymarket.market_midpoints_1m: quote-midpoint OHLC maintained on insert.
  • A Cloud dashboard for current probability, movers, spread/freshness, volume velocity, and one-minute midpoint movement.

Reliability is part of the lesson

The WebSocket is fast but is not treated as a durable log. The collector detects a quiet or stalled socket, reconnects, and polls the public CLOB book while degraded. A separate Data API loop reconciles trades with a five-second overlap and deterministic deduplication. If the classroom network blocks Polymarket, fixture mode produces the same schema and dashboard flow without pretending the feed is live.

Time

About 2 hours 30 minutes hands-on:

ModuleOutcomeTime
00Prepare the laptop, Cloud service, and environment15 min
01Discover active markets and token IDs10 min
02Create query-driven ClickHouse tables and MV20 min
03Start and verify the resilient live collector15 min
04Understand and query the one-minute aggregate20 min
05Investigate probability, spread, freshness, and volume20 min
06Publish the Cloud market pulse dashboard20 min
07Run an AI agent over the live tables and referee its answer20 min
08Prove completion, clean up, and map the production path10 min

Start with Module 00.

On this page

EN