> ## Documentation Index
> Fetch the complete documentation index at: https://docs.struct.to/llms.txt
> Use this file to discover all available pages before exploring further.

# Trading Platforms

> Build prediction market trading interfaces powered by real-time Polymarket data.

## 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](/api-reference/getting-started) for on-demand data, [websocket rooms](/websockets/getting-started) for live streams, and [webhooks](/webhooks/getting-started) for event-driven alerts, all wrapped by the [TypeScript SDK](/sdk/overview).

## What You Can Build

<CardGroup cols={2}>
  <Card title="Custom Trading UIs" icon="browser" href="/guides/tradingview-charts">
    Build your own interface on top of Polymarket with full market data, order books, and TradingView charts.
  </Card>

  <Card title="Aggregators" icon="layer-group" href="/guides/real-time-trending-events-and-markets">
    Combine Polymarket with other prediction markets for a unified view, with trending events and markets up front.
  </Card>

  <Card title="Copy Trading" icon="users" href="/guides/copy-trading-pending-or-confirmed-trades">
    Track top traders and mirror their pending or confirmed trades in real time.
  </Card>

  <Card title="Portfolio Trackers" icon="chart-pie" href="/guides/real-time-positions-tracking">
    Show users their open positions, live PnL, and trade history.
  </Card>
</CardGroup>

## 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](/api-reference/events/get-events) and [markets](/api-reference/market/list-markets) REST endpoints, then keep them warm with the [events stream](/websockets/rooms/events-stream) and [markets stream](/websockets/rooms/markets-stream) rooms, which push full rows for whatever changed since the last tick. The [live trending feed guide](/guides/real-time-trending-events-and-markets) walks through the whole loop.
* **Rank by any window.** Every row carries a `metrics` map keyed by timeframe (`1m` through `30d`) 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](/guides/adding-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](/guides/finding-market-movers), and highlight markets paying [CLOB rewards](/websockets/rooms/clob-rewards) to draw liquidity providers.

Both streams accept the same filters as their REST list counterparts, so a discover page and its live updates share a single definition.

## 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](/websockets/rooms/asset-prices) and window open/close events from the [asset window updates room](/websockets/rooms/asset-window-updates) 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_update`](/webhooks/asset-price-window-update) and [`asset_price_tick`](/webhooks/asset-price-tick) webhooks, also available as [alerts](/websockets/alerts/asset-price-window-update).

The [Crypto Up/Down feed guide](/guides/crypto-up-down-feed) walks through the full build: backfilling past window outcomes, OHLC charts for the underlying asset, the live spot stream, and resolving each window.

## 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](/api-reference/trader/get-global-pnl), [market](/api-reference/market/get-market-top-traders), [position](/api-reference/market/get-position-top-traders), or [category](/api-reference/tags/get-category-top-traders) scope, kept current as trades settle rather than on a refresh cycle.
* **Live PnL.** Push [mark-to-market PnL](/introduction/concepts#pnl) over the [trader PnL room](/websockets/rooms/trader-pnl) at global, market, event, and category scope, and follow open positions through the [trader positions room](/websockets/rooms/trader-positions). The [live trader PnL dashboard](/guides/live-trader-pnl-dashboard) and [real-time positions](/guides/real-time-positions-tracking) guides show the full wiring.
* **Top holders.** Live top-holder lists for any [market](/api-reference/holders/get-market-holders) or [position](/api-reference/holders/get-position-holders), plus holder-count time series, covered in the [holder metrics guide](/guides/holder-metrics-tracking) and pushed over the [holder metrics room](/websockets/rooms/holder-metrics).

## Real-time alerts for your users

Let users follow the markets they care about and notify them the moment something happens:

* **[Price thresholds](/webhooks/price-threshold)**: fire when a market crosses a price, ideal for [mobile push notifications](/guides/mobile-price-alerts). Add [fire-and-delete](/webhooks/fire-and-delete) for one-time alerts.
* **Spikes**: surface fast [price moves](/webhooks/price-spike), scoped by tags or series.
* **Bond zone**: catch outcomes that go [near-certain](/webhooks/close-to-bond) before the oracle settles, walked through in the [bond-zone alerts guide](/guides/bond-zone-alerts).
* **Market lifecycle**: react when markets [resolve](/webhooks/market-resolved), get [disputed](/webhooks/market-disputed), or [launch](/webhooks/market-created).

The same events arrive as [webhooks](/webhooks/getting-started) (HTTP) or [websocket alerts](/websockets/alerts/getting-started) (push over a live socket), so pick whichever transport fits your stack.

## Relevant Struct Features

* **[REST API](/api-reference/getting-started)**: Fetch [markets, events, and trades](/guides/fetching-all-data), candlesticks, and [trader positions](/guides/trader-open-and-closed-positions) on demand, with [pagination](/api-reference/pagination) for large result sets.
* **[Websockets](/websockets/getting-started)**: Stream real-time [trades](/websockets/rooms/trades), [order books](/websockets/rooms/order-book), and [prices](/websockets/rooms/asset-prices) directly to your frontend.
* **[Webhooks](/webhooks/getting-started)**: Get notified when markets [resolve](/webhooks/market-resolved), [new markets launch](/webhooks/market-created), or [prices cross a threshold](/webhooks/price-threshold).
* **[TypeScript SDK](/sdk/overview)**: A typed client for the [REST API](/sdk/rest-api), [websockets](/sdk/websockets), [alerts](/sdk/alerts), and [webhooks](/sdk/webhooks).
* **[Indexing & Backfilling](/indexing/getting-started)**: Mirror the full Polymarket dataset into your own database for custom queries and fast lookups.

## Guides to get started

<CardGroup cols={2}>
  <Card title="TradingView charts" icon="chart-line" href="/guides/tradingview-charts">
    Wire Polymarket candles into a TradingView chart.
  </Card>

  <Card title="Real-time positions" icon="chart-simple" href="/guides/real-time-positions-tracking">
    Keep a user's open positions live as trades confirm.
  </Card>

  <Card title="Copy trading" icon="users" href="/guides/copy-trading-pending-or-confirmed-trades">
    Surface another trader's activity as it happens.
  </Card>

  <Card title="Mobile price alerts" icon="bell" href="/guides/mobile-price-alerts">
    Push a notification when a market crosses a price.
  </Card>
</CardGroup>
