Serving ~1 Billion On-Chain Events at Sub-10ms
Every Polymarket trade. Every position split. Every merge. Every redemption. Every conversion. From November 2022 to right now, updated in real-time, queryable in under 10 milliseconds. We replaced our entire third-party subgraph dependency with our own on-chain trade index. The result: 10-100x faster responses across every query type, zero external data dependencies, and complete coverage of Polymarket’s on-chain history.Why We Built This
Subgraph-based indexing served us well early on, but as Polymarket’s volume grew, the cracks showed. Daily candle queries took over 10 seconds. Position P&L calculations stalled during peak traffic. Data freshness lagged behind the chain. We had no control over uptime or performance, and our users felt it. We needed something that could handle the scale of Polymarket today, nearly a billion on-chain events and growing, while delivering the kind of response times that make real-time trading tools actually feel real-time.The Results
| Query | Response Time |
|---|---|
| Wallet trade history | 9-30ms |
| Market trades by token | 9ms |
| Portfolio positions with P&L | 25ms |
| Hourly OHLCV candles | 14ms |
| Daily OHLCV candles | 98ms |
| Market volume stats | 17ms |
| Wallet activity (splits, merges, redeems) | 8ms |
| Query | Before | After | Improvement |
|---|---|---|---|
| Wallet trades | 340ms | 30ms | 11x |
| Market trades | 500ms | 9ms | 55x |
| Positions | 1,330ms | 25ms | 53x |
| Daily candles | 10,300ms | 98ms | 105x |
Subgraph Indexers Can’t Keep Up
As of April 2026, the most widely used Polymarket subgraph has its positions index nearly a week behind the chain:| Data Source | Block | Lag |
|---|---|---|
| polynode trade index | 85,634,892 | 0 blocks |
| Subgraph orderbook | 85,634,889 | 2 blocks |
| Subgraph positions | 85,344,742 | 290,149 blocks (6.7 days) |
Complete On-Chain Coverage
The index covers every event type that matters for trade history and position reconstruction on Polymarket:- OrderFilled events across all exchange contracts (V1 and V2)
- PositionSplit, collateral minted into outcome tokens
- PositionsMerge, outcome tokens burned back to collateral
- PayoutRedemption, winning positions claimed after resolution
- PositionsConverted, multi-outcome NegRisk swaps
Real-Time, Not Cached
New trades and position events stream into the index via WebSocket as they confirm on-chain. There’s no batch delay, no hourly refresh, no stale cache sitting between users and the latest data. When a trade confirms, it’s queryable. Position P&L, average entry prices, and realized gains are computed live from the raw event history. No pre-aggregated snapshots that drift out of sync. Every query reflects the actual current state of the chain.What This Means for Developers
If you’re building on Polymarket data, this changes what’s possible:- Portfolio dashboards that load instantly, even for the heaviest wallets
- OHLCV candles at any resolution, 1m, 5m, 15m, 1h, 4h, 1d, computed from real trade data, not sampled price feeds
- Complete trade history for any wallet or market in a single API call
- Live P&L tracking that updates as trades confirm, not on a polling interval
- Settlement and redemption history for compliance, accounting, or analytics

