developers:websocket:quotes

This is an old revision of the document!


Quote Feed

The Quote Feed provides real-time market data in two formats: Market by Price (MBP) and Market by Order (MBO).

  • Market by Price (MBP) – Aggregates orders at each price level, showing the best bid/offer (BBO) or a depth of market (DOM) view, typically up to 10 levels.
  • Market by Order (MBO) – Provides a full order book, showing each individual order at its exact price level.

The available depth and data type depend on the subscription request and the user’s market data setup.

MBP provides an aggregated view of the market. It groups orders at each price level, showing either:

  • Top of Book (BBO) – The best bid and offer.
  • Depth of Market (DOM) – Typically the 10 best bid/offer levels.

A MBP subscription is configured with DepthBuffer and DepthLevel options.

DepthBuffer

Value Description
NoSubscription Used to unsubscribe the market quote feed.
Slow A buffered feed that provides a reduced rate of updates.
SlowTrade Same as Slow, but will deliver every trade.
Smart A minimally buffered feed that is guaranteed to provide every change to best bid/offer.
SmartTrade Same as Smart, but will deliver every trade.

Note: *Smart* is typically what a trading client front end would use.

Note: The “Trade” buffers are needed when displaying a trade ticker or Time and Sales display, or updating a chart.

Depth Levels

Value Description
Undefined Used during unsubscription.
BestOnly Only the best bid and offer will be provided. (Also called Top of Book, TOB.)
Normal The full depth (as provided by the exchange) will be provided (typically top 10 bids and offers.)

To receive MBP data, clients send a MarketDepthSubscribe message.

MarketDepthSubscribe {
   ExchangeId = "CME",
   ContractId = "ESM25",
   MarketId = "XCME_C ES (M25)",
   Buffer = DepthBuffer.Smart,
   DepthLevels = DepthLevels.Normal
}

To stop receiving MBP data, clients send a MarketDepthSubscribe message.

MarketDepthSubscribe {
   ExchangeId = "CME",
   ContractId = "ESM25",
   MarketId = "XCME_C ES (M25)",
   Buffer = DepthBuffer.NoSubscription,
   DepthLevels = DepthLevels.Undefined
}

After subscribing, the following messages are received:

  • MarketDefinition – Sent once per market, unless already received via another feed.
  • MarketSnapshot – Provides a full market state on initial subscription.
  • MarketDepthUpdate – Sends incremental changes to depth.

Example MBP message handling:

private void HandleMarketMessage(ServerMessage serverMessage)
{
    switch (serverMessage.PayloadCase)
    {
        case ServerMessage.PayloadOneofCase.MarketDefinition:
            ProcessMarketDefinition(serverMessage.MarketDefinition);
            _logger.LogInformation("Received market definition: {MarketId}", serverMessage.MarketDefinition.MarketId);
            break;

        case ServerMessage.PayloadOneofCase.MarketSnapshot:
            ProcessMarketSnapshot(serverMessage.MarketSnapshot);
            _logger.LogInformation("Received market snapshot: {MarketId}", serverMessage.MarketSnapshot.MarketId);
            break;

        case ServerMessage.PayloadOneofCase.MarketDepthUpdate:
            ProcessMarketDepthUpdate(serverMessage.MarketDepthUpdate);
            _logger.LogInformation("Received depth update for market: {MarketId}", serverMessage.MarketDepthUpdate.MarketId);
            break;

        default:
            _logger.LogWarning("Unhandled Market Message: {PayloadCase}", serverMessage.PayloadCase);
            break;
    }
}

MBO provides a detailed view of the market by reporting every individual order in the book. Unlike MBP, which aggregates orders at price levels, MBO allows clients to track order-level movements.

MBO data includes:

  • Full Order Book Snapshot – Sent when first subscribing.
  • Incremental Updates – Sent in real-time as new orders enter or exit the book.

Example MarketDepthSubscribe message for MBO:

MarketDepthSubscribe {
   MarketId = "XCME_C ES (M25)",
   SubscriptionType = MarketDepthSubscriptionType.ByOrder
}

Example MarketDepthUnsubscribe message:

MarketDepthUnsubscribe {
   MarketId = "XCME_C ES (M25)"
}

After subscribing, the following messages are received:

  • MarketDefinition – Sent once per market, unless already received.
  • MarketSnapshot – A full order book snapshot.
  • MarketOrderUpdate – Incremental order updates.

Example MBO message handling:

private void HandleMBOMessage(ServerMessage serverMessage)
{
    switch (serverMessage.PayloadCase)
    {
        case ServerMessage.PayloadOneofCase.MarketDefinition:
            ProcessMarketDefinition(serverMessage.MarketDefinition);
            _logger.LogInformation("Received market definition: {MarketId}", serverMessage.MarketDefinition.MarketId);
            break;

        case ServerMessage.PayloadOneofCase.MarketSnapshot:
            ProcessMarketSnapshot(serverMessage.MarketSnapshot);
            _logger.LogInformation("Received MBO snapshot: {MarketId}", serverMessage.MarketSnapshot.MarketId);
            break;

        case ServerMessage.PayloadOneofCase.MarketOrderUpdate:
            ProcessMarketOrderUpdate(serverMessage.MarketOrderUpdate);
            _logger.LogInformation("Received MBO order update: {MarketId}", serverMessage.MarketOrderUpdate.MarketId);
            break;

        default:
            _logger.LogWarning("Unhandled MBO Message: {PayloadCase}", serverMessage.PayloadCase);
            break;
    }
}

Clients may receive delayed market data if:

  • They have an expired simulator account.
  • Their market data entitlements do not allow real-time access.

A flag on the messages indicates whether the data is delayed. Clients should check this flag before displaying market data.

Example MarketDefinition field:

Field Description
IsDelayed `true` if the market data is delayed, `false` if real-time.

If delayed data is received, clients should notify users that the feed is not real-time.

  • developers/websocket/quotes.1742048767.txt.gz
  • Last modified: 2025/03/15 14:26
  • by chad