- L3 order-by-order updates
- L2 aggregated top-10 price-level updates
- L1 top-of-book updates
- Baseline: FIX 5.0 SP2 specification.
- Environments: Production, Sandbox
Environment URLs
- Production Snapshot Enabled Gateway:
tcp+ssl://fix-md.exchange.coinbase.com:6121 - Production Snapshot Disabled Gateway:
tcp+ssl://fix-md.exchange.coinbase.com:6122 - Sandbox Snapshot Enabled Gateway:
tcp+ssl://fix-md.sandbox.exchange.coinbase.com:6121 - Sandbox Snapshot Disabled Gateway:
tcp+ssl://fix-md.sandbox.exchange.coinbase.com:6122
Header
A standard header must be present at the start of every message in both directions.Logon (35=A)
Market Data Request (35=V)
Clients should use this message to subscribe to or unsubscribe from market data for one or more symbols.Market Data Request Reject (35=Y)
This message is sent to clients to reject an invalid market data request.Security Status (35=f)
This message is streamed to clients together with the incremental updates for subscribed symbols and reflects changes in the trading status, tick size, or other attributes of an instrument.Market Data Incremental Refresh (35=X)
L3 order-by-order updates
Coinbase Exchange sends L3 order-by-order updates so clients can build a full book of all open orders, plus acknowledgements of orders by the matching engine with the order’s client order ID (ClOrdID) before matching. This helps clients immediately identify which orders and trades in the book (both aggressive and passive) are theirs, as well as gain advance knowledge of orders that are pending processing by the matching engine. These acks correspond to theReceived message in the web-socket feed.
- When
MDEntryIDis not present, the message is the acknowledgement of an order prior to matching. - When
MDEntryIDis present, the message should be used for book-building. You can ignore Change messages with an MDEntryID for which you never received a New message.
L2 aggregated top-10 price-level updates
L2 updates represent aggregated top-10 price levels per side.L1 top-of-book updates
L1 updates represent the current best bid or best offer.When book-building, Change messages received before a corresponding New message can be ignored. Users may occasionally receive Change messages with
MDUpdateAction=1 and an MDEntryID with Text=CHANGE_REASON_STP when the quantity on the original received order was reduced due to Self-trade Prevention (prior to the order being placed on the order book).To maintain an up-to-date L3 order book when subscribing to the Snapshot Disabled Gateway:
- Send a
SubscriptionRequestType=1Market Data Request (35=V) message for the product(s) of interest. - Queue any Market Data Incremental Refresh (35=X) messages received over the FIX session.
- Make a REST request for the order book snapshot from the REST API.
- Playback queued messages, discarding sequence numbers before or equal to the snapshot sequence number.
- Apply playback messages to the snapshot as needed.
- After playback is complete, apply real-time Market Data Incremental Refresh (35=X) messages as they arrive.
Market Data Snapshot Full Refresh (35=W)
This message provides a snapshot for the feed level requested byMarketDepth, including entries that existed before the client subscribed to incremental market data.
A snapshot is requested automatically when a successful Market Data Request from the client is processed for a given symbol.
L3 order-by-order snapshots
For L3, clients should queue up incremental updates and process only the incremental updates with sequence numberRptSeq greater than the RptSeq in the initial Market Data Snapshot Full Refresh (35=W) message.