Skip to main content
Resolve a market’s trading pair UUID, store it, and pass it to every market, order, and WebSocket call. REST returns snapshots and history; WebSockets stream live state. Public market data needs no authentication.

Surface Map

Trading Pairs

Spot and perps are separate active rows (marketType SPOT or MARGIN); derive product support from them. Show perps controls (leverage, margin, funding, positions, liquidation, reduce-only) only for MARGIN rows.

Query Map

Screener and Stats

The screener feeds market lists and tickers; getMarketStats() returns lifetime totals (totalQuoteVolumeLtd, totalTradeCountLtd). OI surge (24h vs 7d average), kept exact with decimal.js:

Candles

Backfill over REST, then subscribe to ohlcv.
  • Intervals: 1m, 5m, 15m, 1h, 4h, 1d.
  • ≤500 bars per request (default 350), oldest first; flat bars fill buckets without trades.
  • A live candle is re-sent with its full state until the period closes; upsert by period start T.
Page longer ranges forward:
See getCandlesticks for query rules and the OHLCV channel for price-series and snapshot options.

Orderbooks

The subscription sends the current book, then every update; REST serves one-off reads. magnitude sets price grouping; denomination picks base or quote quantities.

Full depth

orderbook groups the book into at most 20 buckets per side and restates it at most every 100 ms, for display. For the exact book, subscribe to depth: up to 1000 levels per side, then only changed levels, each frame linked to the last by book_seq. sdk.ws.depth keeps the local book; bbo / sdk.ws.bbo carry only best bid and ask. Raw clients follow Keeping a local book.
TypeScript SDK
REST and gRPC reads take up to 1000 levels per side. Above 100 levels the snapshot carries bookSeq (a point-in-time read and staleness check, not a base for applying depth frames), counts toward the deep orderbook read budget, and returns 503 while the market-data service is unavailable.

Trades

REST history is cursor-paged newest first: omit pageToken, then follow nextPageToken until empty. Sending page returns 400.
  • REST trades carry both wallets, the raw taker fee, quote volume, and the taker’s application; WebSocket frames do not. The maker’s application is not public.
  • GET /api/v1/trades (every market) has a per-client-IP read budget; over it the API returns 429 with Retry-After.
  • Live trades can carry seq and match_index, linking each trade to the previous so a missed trade shows as a gap; see Sequenced trades.

Mark and Oracle Prices

Read trading availability from the mark/index price and market_status, not the oracle provider.
  • Pyth-primary markets stream prices, falling back to HTTP polling when the stream stalls.
  • SEDA markets use a Pyth Pro feed with a Hyperliquid on-close fallback when the upstream market is shut or the Pyth request fails. The fallback’s asset identity is operator-configured, not automatically verified.
  • While upstream is closed, the mark follows the book within a wider basis cap (narrower in session). A book beyond the divergence limit reports DIVERGED in last_regime. Markets stay tradable, liquidations included; market orders stay banded on the mark.
  • A mark valuing an open position outside the supported notional, margin, or unrealized-PnL range is rejected and the last accepted mark kept, so not every tick changes valuation.