Overview
Whether you’re building an aggregator, a copy-trading platform, or a fully custom trading UI, Struct gives you the data layer so you can focus on the experience. Most platforms combine the REST API for on-demand data, websocket rooms for live streams, and webhooks for event-driven alerts, all wrapped by the TypeScript SDK.What You Can Build
Custom Trading UIs
Build your own interface on top of Polymarket with full market data, order books, and TradingView charts.
Aggregators
Combine Polymarket with other prediction markets for a unified view, with trending events and markets up front.
Copy Trading
Track top traders and mirror their pending or confirmed trades in real time.
Portfolio Trackers
Show users their open positions, live PnL, and trade history.
Discovery and trending
Power homepage rails, “what’s hot” widgets, and category browsers with rankings that re-order themselves in real time.- Seed, then stream. Pull initial lists from the events and markets REST endpoints, then keep them warm with the events stream and markets stream rooms, which push full rows for whatever changed since the last tick. The live trending feed guide walks through the whole loop.
- Rank by any window. Every row carries a
metricsmap keyed by timeframe (1mthrough30d) with volume, fees, transactions, and unique traders, so one rail can sort by 24h volume while a “rising now” widget sorts by 5m trades. - Search and filter. Add typeahead search and filter by category, rewards, or activity thresholds to build focused discover pages.
- Surface the movers. Rank the biggest gainers and losers with the finding market movers guide, and highlight markets paying CLOB rewards to draw liquidity providers.
Crypto Up/Down markets
Polymarket’s Crypto Up/Down markets resolve over fixed windows: a window locks an open price when it starts and resolves UP or DOWN when it closes. They are a popular standalone trading surface, and Struct provides every layer to build one.- Live spot and window state. Stream sub-second prices from the asset prices room and window open/close events from the asset window updates room to show whether spot is above or below the current window’s open.
- Resolution alerts. Notify users the moment a window opens or closes with the
asset_price_window_updateandasset_price_tickwebhooks, also available as alerts.
Leaderboards, holders, and live PnL
Trader profiles, top-trader boards, and holder lists are first-class surfaces, and every figure is computed live as trades settle, never refreshed on a periodic cycle or served stale from a cache. A leaderboard re-ranks the moment a position changes, and a holder list reflects balances on the current block.- Leaderboards and top traders. Rank traders by realized PnL at global, market, position, or category scope, kept current as trades settle rather than on a refresh cycle.
- Live PnL. Push mark-to-market PnL over the trader PnL room at global, market, event, and category scope, and follow open positions through the trader positions room. The live trader PnL dashboard and real-time positions guides show the full wiring.
- Top holders. Live top-holder lists for any market or position, plus holder-count time series, covered in the holder metrics guide and pushed over the holder metrics room.
Real-time alerts for your users
Let users follow the markets they care about and notify them the moment something happens:- Price thresholds: fire when a market crosses a price, ideal for mobile push notifications. Add fire-and-delete for one-time alerts.
- Spikes: surface fast price moves, scoped by tags or series.
- Bond zone: catch outcomes that go near-certain before the oracle settles, walked through in the bond-zone alerts guide.
- Market lifecycle: react when markets resolve, get disputed, or launch.
Relevant Struct Features
- REST API: Fetch markets, events, and trades, candlesticks, and trader positions on demand, with pagination for large result sets.
- Websockets: Stream real-time trades, order books, and prices directly to your frontend.
- Webhooks: Get notified when markets resolve, new markets launch, or prices cross a threshold.
- TypeScript SDK: A typed client for the REST API, websockets, alerts, and webhooks.
- Indexing & Backfilling: Mirror the full Polymarket dataset into your own database for custom queries and fast lookups.
Guides to get started
TradingView charts
Wire Polymarket candles into a TradingView chart.
Real-time positions
Keep a user’s open positions live as trades confirm.
Copy trading
Surface another trader’s activity as it happens.
Mobile price alerts
Push a notification when a market crosses a price.