This is an old revision of the document!
Market Data
One message — MarketSubscribe — subscribes to a market. A single quotes level picks how much order-book detail you want, and a ticker flag adds the trade feed. Market-data volumes are integers (int32); prices are decimal strings (see Prices & Data Types).
Finding market ids
Subscriptions are keyed by exchange_id, contract_id and market_id (all strings). Retrieve them from the REST Instruments API (Swagger: https://api-sim.t4login.com/markets/swagger/index.html). A MarketDetails message with the full instrument definition is also delivered on subscribe.
Subscribe
market_subscribe {
exchange_id: "CME"
contract_id: "..."
market_id: "..."
quotes: QUOTES_FULL_ORDER_BOOK // detail level (see below)
ticker: true // also stream trade prints
}
quotes (Quotes enum) selects the feed:
| Value | You receive |
|---|---|
QUOTES_NONE | Nothing — unsubscribes the market. |
QUOTES_TOP_OF_BOOK | Best bid / best offer only, as MarketDepth. |
QUOTES_FULL_ORDER_BOOK | Full depth ladder (volume aggregated per price), as MarketDepth. |
QUOTES_MARKET_BY_ORDER | Every individual resting order, as MarketByOrder*. |
ticker — when true, trade prints stream as MarketTrade messages.
Unsubscribe — resend MarketSubscribe for the same market with quotes: QUOTES_NONE.
What you receive
Price feeds (TOP_OF_BOOK / FULL_ORDER_BOOK):
MarketSnapshot— full current state on subscribe (bundles depth, trades, high/low, price limits, settlement).MarketDepth— incremental bid/offer/implied updates thereafter.
Order feed (MARKET_BY_ORDER):
MarketByOrderSnapshot— all resting orders pluslast_sequence.MarketByOrderUpdate— per-order changes; each has asequenceandupdates[]of typeADD_OR_UPDATE,DELETEorCLEAR. Apply in order; on a gap, resubscribe.
Always:
MarketDetails— the instrument definition.MarketHighLow,MarketPriceLimits,MarketSettlement— as they occur.MarketTrade— whentickeris set. For an MBO subscription it also carries the tradesequenceand the participating resting orders.MarketSubscribeReject— subscription refused; checkmode.
Every message carries a mode (MarketMode: open, closed, halted, …) and a delayed flag.
Reference
Messages and every field: proto/t4/v2/market/market.proto. Enums (Quotes, MarketMode, BidOffer): proto/t4/v2/common/enums.proto. See the Message Catalog.