curl alone. Market data describes what is trading on a venue; to place orders, read the matching host market instead (see Venues for the model).
Each venue lists what it supports in its capabilities, and each market says which reads it offers in marketData. Check them before calling; Venue capabilities explains both levels.
Discover venues and markets
List venues returns every venue with its capabilities:base and quote assets, by instrument types, or with search, a fuzzy, case-insensitive match on the canonical symbol:
nextCursor until it is null. Each market gives:
Order book
Get order book returns the current book at the depth the venue feed provides. Both sides list the best price first.asOf is the time the book is current as of. From a live feed it can be the time of your read, even when the last change arrived earlier. An unknown or unsupported market returns 422 NotSupported.
Recent trades
Get recent trades returns the venue’s recent public trades, oldest first. The venue decides how many; it is not a complete history.takerSide is the aggressor’s side, or null when the venue does not report it. Trades carry no ID, so do not try to deduplicate them by identity across reads.
Prices, quotes and statistics in batches
Five reads take a batch of 1 to 50 distinct instruments on one venue and return one result per instrument, in request order:
An instrument without a value does not fail the batch. It comes back as
Unavailable with the code a single read would have returned: NotSupported when the market does not offer this read, NotFound when the venue reported no value, and UpstreamFailure when the venue read failed.
instrument, and handle each Unavailable result on its own. Price kinds are never relabelled: a market without a mark price returns Unavailable for Mark, not its traded price.
Judge freshness
EachObserved result carries three times:
Judge freshness by
confirmedAt, falling back to observedAt. A value can be old but still current: an unchanged price on a quiet market keeps an early observedAt while confirmedAt moves forward. A value the venue stops reporting is cleared rather than kept: price or amount becomes null.
Read the terms of each value
- Statistics windows differ by venue. Read
marketData.statistics.window:Rollingwith an ISO 8601lengthsuch asPT24H, orCalendarDayin a namedtimeZone. Two venues’ 24-hour figures need not cover the same period. Fields outsidesupportedFieldsare alwaysnull. - Indicative funding is an estimate. The rate that settles can differ from the one you read.
- Open interest has a unit.
unitisContracts,BaseAssetorQuoteAsset, and is also listed inmarketData.openInterest.unit. Convert before comparing venues. - Best quote sizes are
nullwhen the market’ssupportsSizesisfalse.
Candles
List candles returns closed candles for one market, price kind and interval, newest first across every page. The candle still forming is never included, and a page has no gaps: there is one candle for every interval it spans. Before you call, read the market’smarketData.candles entry for the price kind (traded, mark or index):
- The interval must be in
supportedIntervals. Intervals are aligned to whole multiples from the Unix epoch, in UTC. listallowsByInstrument, which starts from the latest closed candle.listBeforeallowsByInstrumentBefore, which starts from candles that end at or beforebefore, and is needed to page past the first page with either variant.maxHistoryAgeByIntervalgives how far back history reaches per interval, as an ISO 8601 duration. An interval without an entry has no declared limit. These values are examples; read them from the market.
[startAt, endAt). volume and turnover name their asset, because the asset depends on the market, and are null when the venue does not report them.
To start at a point in the past, use ByInstrumentBefore:
Page back in time
Send eachnextCursor with the same venue, price kind, interval and query until it is null or you reach the start time you need:
listBefore, and how far back you can go is bounded by maxHistoryAgeByInterval. Stop when nextCursor is null.
Related
- Venues: venues, venue markets and how they relate to hosts.
- Venue capabilities: reading venue and market support before you call.
- Instruments: instrument types, canonical symbols and native contract sizes.
- API conventions: paging, decimals and timestamps.