Skip to main content
You’re building a product on prediction-market data. Could be a market-discovery app, a wallet tracker, a copy-trading signal product, an analytics terminal, or a media property with live odds. This guide is about the architecture decisions — Predexon handles the indexing, normalization, and streaming so you don’t have to. You’ll be ready to:
  • Split reads correctly between REST and WebSocket
  • Serve market pages, wallet pages, and leaderboards from the right endpoints
  • Keep your quota bill near zero using free historical endpoints
  • Handle errors, caching, and latency expectations realistically

The core architecture

Almost every data product ends up with the same shape:
  • REST for state, WebSocket for change. Load a market page from REST once, then keep it live with the orderbook and trades channels. Don’t poll.
  • Cache reads you’ll repeat. Market metadata changes rarely — cache it hours. Prices and books change constantly — stream them instead of re-fetching.
  • Historical endpoints are free and unlimited on every plan (trades, orderbooks, wallet activity). Backfill as much as you want; it never touches your quota.

Serving the classic pages

Code skeleton for a live market page:

Differentiate with the hard datasets

The pages above are table stakes. The datasets that make a product stand out:
  • Pending trades (mempool) — show fills before they confirm. Your users see flow up to 5 seconds before apps built on Polymarket’s RTDS. WebSocket pending-trades →
  • Tick-level orderbook history — power “book at any moment” scrubbers, spread-history charts, and execution-quality analytics from the raw tick stream. Tick downloads →
  • Smart-money analytics — profitable-wallet flow per market, computed from full chain history. Nobody can fork your UI and get this from the venue API. Smart money →

Latency, errors, and operational realism

What to expect in production: Error patterns you’ll see most:
  • 429 — you outran your plan’s rate limit. Back off exponentially; consider caching or a higher tier.
  • 401 / 403 — wrong or missing x-api-key.
  • 503 rarely — surface as “temporarily unavailable” and let users retry; don’t hot-loop yourself.
See Best Practices for retry/backoff patterns, caching, and connection pooling.

Common builder recipes

Copy-trade signals

Stream a wallet’s fills in real time and surface them to your users.

Portfolio monitor

Positions + P&L + live updates for any wallet. Same patterns power most prediction-market UIs.

Smart-money entries

Alert when profitable wallets pile into a market.

Mempool signal feed

The 5-seconds-early tape, productized.

Data & Signals overview

Full map of every endpoint, organized by utility.

WebSocket overview

Channels, subscriptions, and plan limits for live data.

Best Practices

Retries, caching, rate limits, error handling.

Rate limits & free endpoints

What’s free and unlimited vs. what counts toward quota.