- 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.| Tag | FieldName | Type | Required | Notes |
|---|---|---|---|---|
| 8 | BeginString | String | Y | Must be FIXT.1.1 |
| 49 | SenderCompID | String | Y | Client API key (on messages from the client) |
| 56 | TargetCompID | String | Y | Must be Coinbase (on messages from client) |
| 52 | SendingTime | UTCTimestamp | Y | UTC time down to millisecond resolution in the format YYYYMMDD-HH:MM:SS.sss |
Logon (35=A)
| Tag | FieldName | Type | Required | Notes |
|---|---|---|---|---|
| 34 | MsgSeqNum | Int | Y | Must be 1 |
| 98 | EncryptMethod | Int | Y | Must be 0 (None) |
| 108 | HeartBtInt | Int | Y | Heartbeat interval is capped at 300s, defaults to 10s |
| 141 | ResetSeqNumFlag | Boolean | Y | Resets the sequence number. Can be Y/N |
| 553 | Username | String | Y | Client API Key |
| 554 | Password | String | Y | Client API passphrase |
| 95 | RawDataLength | Int | Y | Number of bytes in RawData field |
| 96 | RawData | String | Y | Client message signature |
| 1137 | DefaultApplVerID | String | Y | Must be 9 (FIX 5.0 SP2) |
Market Data Request (35=V)
Clients should use this message to subscribe to or unsubscribe from market data for one or more symbols.| Tag | FieldName | Type | Required | Notes |
|---|---|---|---|---|
| 262 | MDReqID | String | Y | Client identifier for the market data request |
| 263 | SubscriptionRequestType | Int | Y | 1=Subscribe 2=Unsubscribe |
| 264 | MarketDepth | Int | N | Omitted or 0=L3 order-by-order 10=L2 aggregated top-10 price levels per side 1=L1 top-of-book |
| 146 | NoRelatedSym | Int | Y | How many symbols are in the request |
| =>55 | Symbol | String | Y | Repeating group of symbols for which the client requests market data |
Market Data Request Reject (35=Y)
This message is sent to clients to reject an invalid market data request.| Tag | FieldName | Type | Required | Notes |
|---|---|---|---|---|
| 262 | MDReqID | String | Y | Client identifier for the market data request |
| 281 | MDReqRejReason | Char | Y | 0=Unknown symbol 1=Duplicate MDReqID 3=Unsupported MarketDepth 7=Other |
| 58 | Text | String | N | Error description |
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.| Tag | FieldName | Type | Required | Notes |
|---|---|---|---|---|
| 262 | MDReqID | String | Y | Client identifier for the market data request |
| 83 | RptSeq | Long | Y | Public sequence number by symbol |
| 55 | Symbol | String | Y | Repeating group of symbols for which the client requests market data |
| 1682 | MDSecurityTradingStatus | String | Y | trading_disabledcancel_onlypost_onlylimit_onlyfull_tradingauction_mode |
| 969 | MinPriceIncrement | Decimal | Y | Minimum increment for quote currency (e.g., 0.01 USD for BTC-USD) |
| 29003 | MinSizeIncrement | Decimal | Y | Minimum increment for base currency (e.g., 0.00000001 BTC for BTC-USD) |
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.
| Tag | FieldName | Type | Required | Notes |
|---|---|---|---|---|
| 262 | MDReqID | String | Y | Client identifier for the market data request |
| 268 | NoMDEntries | Int | Y | Always 1 |
| =>279 | MDUpdateAction | Char | Y | 0=New 1=Change 2=Delete |
| =>269 | MDEntryType | Char | Y | 0=Bid 1=Offer 2=Trade |
| =>278 | MDEntryID | String | N | If present, this ID is the order ID that should be used for book-building If not present, this message is the initial ack and should not be used to build the book Omitted for L2/L1. |
| =>83 | RptSeq | Long | N | Public sequence number by symbol Omitted for L2/L1. |
| =>55 | Symbol | String | Y | Repeating group of symbols for which the client requests market data |
| =>270 | MDEntryPx | Decimal | Y | The price of the order or price level |
| =>271 | MDEntrySize | Decimal | Y | The quantity remaining of the order or aggregate quantity at the price level. Omitted on Delete messages. |
| =>60 | TransactTime | UTCTimestamp | N | The engine timestamp of the order in microseconds Omitted for L2/L1. |
| =>40 | OrdType | Char | N | Sent only if the message represents the initial ack of an order: 1=Market 2=Limit Omitted for L2/L1. |
| =>11 | ClOrdID | String | N | The client order ID on the initial ack of an order Omitted for L2/L1. |
| =>37 | OrderID | String | N | The exchange order ID on the initial ack of an order OR If MDEntryType=2, then this is the aggressive Order ID Omitted for L2/L1. |
| =>58 | Text | String | N | If MDUpdateAction=1, then the possible values are:CHANGE_REASON_STPCHANGE_REASON_MODIFY_ORDERCHANGE_REASON_REMAINDER_AFTER_MODIFICATIONIf MDUpdateAction=2, then the possible values are: CANCELEDFILLEDOmitted for L2/L1. |
| =>5797 | AggressorSide | Int | N | Sent only on trades MDEntryType=2 1=Buy 2=Sell Omitted for L2/L1. |
| =>29004 | Funds | Decimal | N | Market orders may have an optional funds field which indicates how much quote currency is used to buy or sell Omitted for L2/L1. |
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.
L2 aggregated top-10 price-level snapshots
L2 snapshots contain up to 10 price levels per side. Incremental updates are guaranteed to be sent after the snapshot and guaranteed to be newer than the snapshot.L1 top-of-book snapshots
L1 snapshots contain the current best bid and best offer. Incremental updates are guaranteed to be sent after the snapshot and guaranteed to be newer than the snapshot. If clients are already subscribed to a symbol and send another Market Data Request to subscribe, they will not receive a new snapshot for that symbol. Clients must unsubscribe and subscribe to the market data again for a given symbol to receive a new snapshot.| Tag | FieldName | Type | Required | Notes |
|---|---|---|---|---|
| 262 | MDReqID | String | Y | Client identifier for the market data request |
| 83 | RptSeq | Long | N | Public sequence number for the final update in the snapshot by symbol Omitted for L2/L1. |
| 893 | LastFragment | Char | Y | Is this the last message in the snapshot for a given symbol Y=Yes N=No |
| 55 | Symbol | String | Y | Repeating group of symbols for which the client requests market data |
| 268 | NoMDEntries | Int | Y | Number of market data entries in this snapshot message |
| 1682 | MDSecurityTradingStatus | String | N | trading_disabledcancel_onlypost_onlylimit_onlyfull_tradingauction_modeOmitted for L2/L1. |
| =>269 | MDEntryType | Char | Y | 0=Bid 1=Offer |
| =>278 | MDEntryID | String | N | The order ID that should be added to the book Omitted for L2/L1. |
| =>270 | MDEntryPx | Decimal | Y | The price of the order or price level |
| =>271 | MDEntrySize | Decimal | Y | The quantity remaining of the order or aggregate quantity at the price level |
Security List Request (35=x)
This message is sent by clients to request a full list of instruments that Coinbase Exchange supports together with each instrument’s trading status, tick size, minimum order quantity, and any other descriptive fields.| Tag | FieldName | Type | Required | Notes |
|---|---|---|---|---|
| 320 | SecurityReqID | String | Y | Client identifier for the request |
| 559 | SecurityListRequestType | Int | Y | Always 4=All Securities |
Security List (35=y)
Instrument definition messages are returned in response to a client’s Security List Request.| Tag | FieldName | Type | Required | Notes |
|---|---|---|---|---|
| 320 | SecurityReqID | String | Y | Client identifier for the request |
| 322 | SecurityResponseID | String | Y | Response ID for the Security List Request |
| 560 | SecurityRequestResult | Int | Y | 0=Valid Request 1=Invalid Request |
| 893 | LastFragment | Char | Y | Is this the last instrument definition message in response to the original request Y=Yes N=No |
| 393 | TotNoRelatedSym | Int | Y | Total number of symbols that will be sent cumulatively |
| 146 | NoRelatedSym | Int | Y | How many symbols are in this FIX message |
| 1682 | MDSecurityTradingStatus | String | Y | trading_disabledcancel_onlypost_onlylimit_onlyfull_tradingauction_mode |
| =>55 | Symbol | String | Y | Repeating group of symbols for which the client requests market data |
| =>15 | Currency | String | Y | The quote currency for the symbol (e.g., USD if 55=BTC-USD) |
| =>562 | MinTradeVol | Decimal | Y | The minimum notional amount in quote currency terms for an order |
| =>969 | MinPriceIncrement | Decimal | Y | Minimum increment for quote currency (e.g., 0.01 USD for BTC-USD) |
| =>29003 | MinSizeIncrement | Decimal | Y | Minimum increment for base currency (e.g., 0.00000001 BTC for BTC-USD) |