Skip to main content

Market Data

The Web Market Data endpoint provides real-time market data through snapshots and incremental updates. Two forms of market data are available:

  • Market data by order ("AggregatedBook": "N")
  • Market data by price ("AggregatedBook": "Y")

Endpoints​

  • /market-data

Sequence Examples​

Market Data Subscription​

Sequence of operations to subscribe to market data and receive snapshots and incremental updates.

Only a single subscription is allowed at a given time. Subsequent subscriptions will replace any existing subscriptions.

Instrument List Request​

Sequence of operations to request and receive a list of instruments.

Security Status Subscription​

Sequence of operations to subscribe to security status and receive current status and subsequent updates.

Connectivity​

In the absence of other messages, the server will send a Heartbeat message to the client at an interval of up to 20 seconds.

API Reference​

MarketDataRequest​

Example​

{
"MsgType": "MarketDataRequest",
"AggregatedBook": "Y",
"MDReqID": "123",
"SubscriptionRequestType": "SNAPSHOT_PLUS_UPDATES",
"NoRelatedSym": [
{
"Symbol": "BTC/USD"
},
{
"Symbol": "ETH/USD"
}
]
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: MarketDataRequest
$.AggregatedBook​
  • Type: string
  • Required: Yes
  • Values:
    • "N": Request for market data by order
    • "Y": Request for market data by price (aggregated)
$.MDReqID​
  • Type: string
  • Required: Yes
  • Description: An ID for the request that will be echoed back on the market data response. Max length of 32.
$.SubscriptionRequestType​
  • Type: string
  • Required: Yes
  • Values:
    • "SNAPSHOT_PLUS_UPDATES": Request book snapshot and subsequent incremental updates.
    • "PERIODIC_SNAPSHOT": Request book snapshots sent at a given interval (see SnapshotInterval). Incremental updates to the order book will not be send. Trades and trading metrics are still sent as incremental messages.
$.SnapshotInterval​
  • Type: int
  • Required: No
  • Description: The minimum number of milliseconds between snapshots. Must be specified if and only if SubscriptionRequestType is PERIODIC_SNAPSHOT. Must be no less than 500.
$.NoRelatedSym​
  • Type: array
  • Required: Yes
  • Description: Array of NoRelatedSym
$.NoRelatedSym[*].Symbol​
  • Type: string
  • Required: Yes
  • Description: The requested instrument symbol.

MarketDataSnapshotFullRefresh​

A snapshot of the order book for the indicated instrument.

Example​

{
"MsgType": "MarketDataSnapshotFullRefresh",
"Symbol": "ETH/USD",
"MDReqID": "123",
"NoMDEntries": [
{
"MDEntryType": "BID",
"MDEntryID": "3292196992117112839",
"MDEntryPx": "2999.0",
"MDEntrySize": "1.0"
},
{
"MDEntryType": "OFFER",
"MDEntryID": "3292196992117112840",
"MDEntryPx": "3001.0",
"MDEntrySize": "1.0"
},
{
"MDEntryType": "OFFER",
"MDEntryID": "3292196992117112841",
"MDEntryPx": "3001.0",
"MDEntrySize": "0.7"
}
]
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: MarketDataSnapshotFullRefresh
$.Symbol​
  • Type: string
  • Required: Yes
  • Description: The instrument symbol.
$.MDReqID​
  • Type: string
  • Required: Yes
  • Description: The ID of the request to which this message is responding.
$.NoMDEntries​
  • Type: array
  • Required: Yes
  • Description: Array of NoMDEntries order book entries.
$.NoMDEntries[*].MDEntryType​
  • Type: string
  • Required: Yes
  • Description: The type of market data entry.
  • Values: Yes
    • "BID"
    • "OFFER"
$.NoMDEntries[*].MDEntryID​
  • Type: string
  • Required: No
  • Description: The market data entry ID. When subscribing to non-aggregated market data, this will uniquely identify an order. When subscribing to aggregated market data, this will identify a price level. Value not present for trade entries.
$.NoMDEntries[*].MDEntryPx​
  • Type: string
  • Required: Yes
  • Description: The market data entry price.
$.NoMDEntries[*].MDEntrySize​
  • Type: string
  • Required: Yes
  • Description: The market data entry size. When subscribing to non-aggregated market data, this represents the order quantity. When subscribing to aggregated market data, this will represent the quantity at the given price level.

MarketDataIncrementalRefresh​

An incremental update to the order book.

The nature of the update will depend on the type of market data subscription (market data by price or by order).

Both types of subscriptions will also receive trade entries.

Example​

{
"MsgType": "MarketDataIncrementalRefresh",
"TransactTime": "20241114-19:33:13.988008419",
"MDReqID": "123",
"NoMDEntries": [
{
"MDUpdateAction": "NEW",
"MDEntryType": "BID",
"MDEntryID": "3292196992117112839",
"Symbol": "BTC/USD",
"MDEntryPx": "90123.45",
"MDEntrySize": "1.32"
},
{
"MDUpdateAction": "NEW",
"MDEntryType": "OFFER",
"MDEntryID": "3292196992117112840",
"Symbol": "BTC/USD",
"MDEntryPx": "90000.45",
"MDEntrySize": "0.43"
}
]
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: MarketDataIncrementalRefresh
$.TransactTime​
  • Type: string
  • Required: Yes
  • Description: The timestamp of the order book update
$.MDReqID​
  • Type: string
  • Required: Yes
  • Description: The ID of the request to which this message is responding.
$.NoMDEntries​
  • Type: array
  • Required: Yes
  • Description: Array of NoMDEntries order book updates.
$.NoMDEntries[*].MDUpdateAction​
  • Type: string
  • Required: Yes
  • Description: The type of market data action.
  • Values: Yes
    • "NEW"
    • "DELETE"
    • "CHANGE"
$.NoMDEntries[*].MDEntryType​
  • Type: string
  • Required: Yes
  • Description: The type of market data entry.
  • Values: Yes
    • "BID"
    • "OFFER"
    • "TRADE"
    • "INDEX_VALUE"
    • "OPEN_INTEREST"
    • "FINAL_FUNDING_RATE"
    • "PRELIMINARY_MARK_PRICE"
    • "PRELIMINARY_FUNDING_RATE"
$.NoMDEntries[*].MDEntryID​
  • Type: string
  • Required: No
  • Description: The market data entry ID. When subscribing to non-aggregated market data, this will uniquely identify an order. When subscribing to aggregated market data, this will identify a price level. Value not present for trade entries or perpetual future trade metric entries.
$.NoMDEntries[*].Symbol​
  • Type: string
  • Required: Yes
  • Description: The instrument symbol.
$.NoMDEntries[*].MDEntryPx​
  • Type: string
  • Required: Yes
  • Description: The market data entry price.
$.NoMDEntries[*].MDEntrySize​
  • Type: string
  • Required: No
  • Description: The market data entry size. When subscribing to non-aggregated market data, this represents the order quantity. When subscribing to aggregated market data, this will represent the quantity at the given price level. When received on a CHANGE entry, this value represents the new total quantity for the entry. Not present for perpetual future trade metric CHANGE entries.
$.NoMDEntries[*].TradeID​
  • Type: string
  • Required: No
  • Description: Required when MDEntryType is "TRADE". Uniquely identifies a trade.

SecurityListRequest​

Request a list of instruments

Example​

{
"MsgType": "SecurityListRequest",
"SecurityReqID": "321",
"SecurityListRequestType": "ALL_SECURITIES"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: "SecurityListRequest"
$.SecurityReqID​
  • Type: string
  • Required: Yes
  • Description: An ID for the request that will be echoed back on the SecurityList response. TODO max length
$.SecurityListRequestType​
  • Type: string
  • Required: Yes
  • Description: Type of request
  • Values:
    • "ALL_SECURITIES": Returns all instruments

SecurityList​

A list of instruments.

Example​

{
"MsgType": "SecurityList",
"NoRelatedSym": [
{
"Symbol": "BTC/USD",
"MinPriceIncrement": "0.01",
"UnitOfMeasure": "CURRENCY",
"UnitOfMeasureCurrency": "BTC",
"MinTradeVol": "0.00000001",
"RoundLot": "0.00000001",
"Currency": "USD",
"SecurityType": "SPOT"
},
{
"Symbol": "ETH/USD",
"MinPriceIncrement": "0.01",
"UnitOfMeasure": "CURRENCY",
"UnitOfMeasureCurrency": "BTC",
"MinTradeVol": "0.00000001",
"RoundLot": "0.00000001",
"Currency": "USD",
"SecurityType": "SPOT"
}
],
"SecurityReqID": "321",
"SecurityRequestResult": "VALID_REQUEST"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: "SecurityList"
$.NoRelatedSym​
  • Type: array
  • Required: Yes
  • Description: Array of NoRelatedSym
$.NoRelatedSym[*].Symbol​
  • Type: string
  • Required: Yes
  • Description: The instrument symbol.
$.NoRelatedSym[*].MinPriceIncrement​
  • Type: string
  • Required: Yes
  • Description: The minimum price increment.
$.NoRelatedSym[*].UnitOfMeasure​
  • Type: string
  • Required: Yes
  • Description: The unit of measure of the underlying asset. Always "CURRENCY".
  • Value: CURRENCY
$.NoRelatedSym[*].UnitOfMeasureCurrency​
  • Type: string
  • Required: Yes
  • Description: The underlying base asset currency.
$.NoRelatedSym[*].MinTradeVol​
  • Type: string
  • Required: Yes
  • Description: The minimum order quantity.
$.NoRelatedSym[*].RoundLot​
  • Type: string
  • Required: Yes
  • Description: The price quantity increment.
$.NoRelatedSym[*].Currency​
  • Type: string
  • Required: Yes
  • Description: The quote currency of the instrument.
$.SecurityReqID​
  • Type: string
  • Required: Yes
  • Description: The ID of the request to which this message is responding.
$.SecurityRequestResult​
  • Type: string
  • Required: Yes
  • Description: The result of the request
  • Values:
    • "VALID_REQUEST": Indicates a valid request. Instruments are returned in this response
    • "INSTRUMENT_DATA_TEMPORARILY_UNAVAILABLE": Indicates unavailability of the requested data.

SecurityStatusRequest​

Request a security status subscription.

Example​

{
"MsgType": "SecurityStatusRequest",
"SecurityStatusReqID": "123",
"Symbol": "ETH/USD",
"SubscriptionRequestType": "SNAPSHOT_PLUS_UPDATES"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: "SecurityStatusRequest"
$.SecurityStatusReqID​
  • Type: string
  • Required: Yes
  • Description: An ID for the request that will be echoed back on the SecurityStatus response. Max length of 32.
$.Symbol​
  • Type: string
  • Required: Yes
  • Description: The instrument symbol.
$.SubscriptionRequestType​
  • Type: string
  • Required: Yes
  • Description: The subscription type.
  • Values:
    • "SNAPSHOT_PLUS_UPDATES": Returns current instrument status and any subsequent updates.

SecurityStatus​

The status of the instrument.

Example​

{
"MsgType": "SecurityStatus",
"SecurityStatusReqID": "123",
"Symbol": "ETH/USD",
"SecurityTradingStatus": "READY_TO_TRADE_START_OF_SESSION"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: "SecurityStatus"
$.SecurityStatusReqID​
  • Type: string
  • Required: Yes
  • Description: The ID of the request to which this message is responding.
$.Symbol​
  • Type: string
  • Required: Yes
  • Description: The instrument symbol.
$.SecurityTradingStatus​
  • Type: string
  • Required: Yes
  • Description: The instrument trading status.
  • Values:
    • "TRADING_HALT": Trading halted.
    • "RESUME": Trading has resumed.
    • "ITS_PRE_OPENING": Post-only order book.
    • "READY_TO_TRADE_START_OF_SESSION": Trading is active.
$.HaltReason​
  • Type: string
  • Required: No
  • Description: The reason for a trading halt. Required when SecurityTradingStatus is "TRADING_HALT".
  • Values:
    • "ORDER_BOOK_IN_SUSPENDED_STATE": Order book suspended.
    • "ORDER_BOOK_IN_HALT_STATE": Order book halted.

Heartbeat​

A message sent in the absence of other messages at an interval of up to 20 seconds.

Example​

{
"MsgType": "Heartbeat"
}

Fields​

$.MsgType​
  • Type: string
  • Required: Yes
  • Value: Heartbeat