Skip to main content

Documentation Index

Fetch the complete documentation index at: https://polynode.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

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

QueryResponse Time
Wallet trade history9-30ms
Market trades by token9ms
Portfolio positions with P&L25ms
Hourly OHLCV candles14ms
Daily OHLCV candles98ms
Market volume stats17ms
Wallet activity (splits, merges, redeems)8ms
~1 billion rows. Real-time chain tip. Every query under 100ms. For context, here’s what the same queries looked like before:
QueryBeforeAfterImprovement
Wallet trades340ms30ms11x
Market trades500ms9ms55x
Positions1,330ms25ms53x
Daily candles10,300ms98ms105x
Daily candles went from 10 seconds to under 100 milliseconds. That’s the difference between a chart that feels broken and one that feels instant.

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 SourceBlockLag
polynode trade index85,634,8920 blocks
Subgraph orderbook85,634,8892 blocks
Subgraph positions85,344,742290,149 blocks (6.7 days)
If you’re querying positions from a subgraph, you’re getting portfolio data that’s almost a week old. Any trade, any entry, any exit that happened in the last 6.7 days simply doesn’t exist in those results. This isn’t a one-time outage. Positions require computing VWAP across every trade a wallet has ever made, and subgraph indexers struggle with that at scale. The heaviest Polymarket wallets have millions of trades. A subgraph that re-indexes positions from raw events falls further behind every day as volume grows. polynode’s trade index pre-computes positions for all 2.5 million wallets and maintains them in real-time as new trades confirm. There is no lag. When a trade confirms on-chain, positions update within seconds.

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
Everything is decoded directly from on-chain logs. The blockchain is the source of truth. We don’t rely on any third-party data pipeline, hosted subgraph, or external API to serve this data.

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
Every polynode on-chain endpoint is powered by this system.

Try It

# Wallet trades
curl "https://api.polynode.dev/v2/onchain/trades?wallet=0x...&key=YOUR_KEY"

# Positions with P&L
curl "https://api.polynode.dev/v2/onchain/positions?wallet=0x...&key=YOUR_KEY"

# OHLCV candles at any resolution
curl "https://api.polynode.dev/v2/onchain/candles/{token_id}?resolution=1h&key=YOUR_KEY"

# Market volume
curl "https://api.polynode.dev/v2/onchain/markets/{token_id}/volume?key=YOUR_KEY"

# Wallet redemptions
curl "https://api.polynode.dev/v2/onchain/wallets/{wallet}/redemptions?key=YOUR_KEY"
Full endpoint documentation is available in the API Reference.