- TypeScript
- Python
- API
The TypeScript examples on this page use a
PublicClient. The same market-data
methods are also available on SecureClient instances.Fetch Instruments
Fetch instruments before your integration lets users choose or submit orders for a Perps market. Instrument data gives you the constraints needed to validate that workflow.- TypeScript
- Python
- API
Fetch instruments with where Use A retired instrument has a
client.fetchPerpsInstruments().PerpsInstrument is:displaySymbol ?? symbol for a label and keep id for trading and storage.
displaySymbol is optional and does not change the canonical symbol.
closeOnly: true requires reduce-only orders. closeOnly defaults to false when absent from an older response.To inspect a retired instrument, filter by its known ID; retired instruments are
omitted from the unfiltered collection.settlement record. This is an illustrative record:Output: PerpsInstrumentSettlement
Output: PerpsInstrumentSettlement
PerpsInstrumentSettlement Example
settlement.timestamp is Unix milliseconds. sequence is the accepted engine
sequence and must be a safe integer, at most Number.MAX_SAFE_INTEGER; the SDK
rejects larger values. price and insuranceDebit remain exact decimal strings.
insuranceDebit is the total quote amount debited from the insurance fund.
An instrument without a record has settlement: undefined.PerpsInstrument includes the market metadata and trading constraints your app
needs before submitting orders.Fetch Tickers
Use tickers when you need a lightweight view of where one or more markets are trading now.- TypeScript
- Python
- API
Fetch one ticker when you already know which instrument your integration is
tracking.Fetch all tickers to build a market list or refresh a dashboard.where
PerpsTicker is:503 Service Unavailable rather
than stale prices. Treat a 503 as transient and retry with backoff.
Fetch the Order Book
Use the order book before choosing an order price or size. It shows available liquidity at the requested depth.- TypeScript
- Python
- API
Choose how many price levels to request. Supported depths are Fetch the book for the selected instrument. Bids and asks are returned as price
levels with decimal string prices and quantities.where
10, 100,
500, and 1000. When omitted, the SDK requests 100 levels.PerpsBook and PerpsBookLevel are:List Candles
Use candles when your workflow needs time-bucketed price history for charts, backtests, or trading signals.- TypeScript
- Python
- API
The SDK paginates candle history. When where
start is omitted, it starts from the
past 24 hours.PerpsCandle is:Fetch Mark Price History
Mark price history shows how an instrument’s mark price changed over time. Each data point contains the last mark price recorded for an interval, independent of whether trades occurred during that interval.- API
Fetch bucketed mark prices for an instrument and interval. The response returns mark price points in Each point is
start_timestamp is
required; end_timestamp is optional. The API returns at most 1000 points per
request.data and a more flag for
continuation. Only buckets that contain at least one mark update are included.[bucket_open_time_ms, last_mark_price_in_bucket].List Trades
Use public trades when recent executions matter more than aggregated candles. This is useful for trade tape views and execution analysis.- TypeScript
- Python
- API
The SDK paginates trade history, including cursor handling and boundary
deduplication.where
PerpsPublicTrade is:settlement is true for an instrument-settlement close and defaults to false
on older responses.List Funding History
Use funding-rate history when estimating carry costs or explaining why Perps prices differ from the index over time.- TypeScript
- Python
- API
The SDK paginates funding-rate history.where
PerpsFundingRate is: