> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Coinbase Derivatives: Predictions FIX Market Data Messages

The Coinbase Derivatives: Predictions FIX Market Data API lets you subscribe to order books, public trades, trade volume, open interest, and instrument status changes over FIX 5.0 SP2.

## Market Data Message Types

The Coinbase Derivatives: Predictions Market Data FIX API supports the following message types. For Logon, heartbeats, and sequence recovery, see [Session](/derivatives-predictions/fix/session).

> **Client Message Types**
>
> * [MarketDataRequest (35=V)](#marketdatarequest-35v): Subscribes to or unsubscribes from market data.

> **System Message Types**
>
> * [MarketDataSnapshotFullRefresh (35=W)](#marketdatasnapshotfullrefresh-35w): Initial order book snapshot.
> * [MarketDataIncrementalRefresh (35=X)](#marketdataincrementalrefresh-35x): Order book changes, trades, trade volume, and open interest.
> * [MarketDataRequestReject (35=Y)](#marketdatarequestreject-35y): Rejection of a `MarketDataRequest`.
> * [SecurityStatus (35=f)](#securitystatus-35f): Instrument trading status changes.
> * [BusinessMessageReject (35=j)](#businessmessagereject-35j): Rejection of a malformed or unsupported application message.

> **Session Message Types**
>
> Logon (35=A), Logout (35=5), Heartbeat (35=0), TestRequest (35=1), ResendRequest (35=2), Reject (35=3), and SequenceReset (35=4). See [Session](/derivatives-predictions/fix/session).

## Connection

Connect with `TargetCompID (56) = CPMMD` and your API key in `SenderCompID (49)`. The API key must have the `MARKET_DATA` permission. You can open several sessions with one API key; see [Multiple sessions per API key](/derivatives-predictions/fix/session#multiple-sessions-per-api-key). Host and port are listed on the [Coinbase Derivatives: Predictions Connectivity](/derivatives-predictions/connectivity) page. Header fields are on [Header/Trailer](/derivatives-predictions/fix/header-trailer). Logon, the Logon signature, heartbeats, and sequence recovery are on [Session](/derivatives-predictions/fix/session).

SendingTime (52) and TransactTime (60) on messages you receive are UTC timestamps with microsecond precision.

## MarketDataRequest (35=V)

Subscribes to or unsubscribes from market data for one or more instruments, or for all instruments.

| Tag | Name | FIX Type | Req | Description |
| :- | :- | :- | :- | :- |
| 262 | MDReqID | String | Y | Unique client ID for the request. Echoed on every response for the subscription and used to unsubscribe. Must be unique among active subscriptions on the session. |
| 263 | SubscriptionRequestType | Char | Y | `1` = Snapshot plus updates (subscribe). `2` = Disable previous snapshot plus updates (unsubscribe the `MDReqID`). Other values are rejected. |
| 264 | MarketDepth | Int | C | Order book depth. `0` = Full book. `1` = Top of book (best bid and best offer). `10` = Top 10 levels per side. Required when MDEntryType (269) includes `0` or `1`. Not allowed otherwise. |
| 267 | NoMDEntryTypes | NumInGroup | Y | Number of entry types requested. Must be at least `1`. |
| → 269 | MDEntryType | Char | Y | Data to subscribe to. `0` = Bid (YES bids). `1` = Offer (NO bids). `2` = Trade. `B` = Trade volume. `C` = Open interest. `L` = Instrument lifecycle (specific to Coinbase Derivatives: Predictions). See [Entry types](#entry-types). |
| 146 | NoRelatedSym | NumInGroup | Y | Number of instruments. `0` = All instruments (send no Symbol entries). A value greater than `0` must equal the number of distinct `Symbol (55)` entries. `0` is not allowed when MDEntryType (269) includes `0` or `1`. |
| → 55 | Symbol | String | C | Instrument ticker or numeric instrument ID. Required when `146` is greater than `0`. |

### Entry types

| MDEntryType (269) | Data | Scope | Response messages |
| :- | :- | :- | :- |
| `0` = Bid | Order book, YES bids | Per instrument only | One 35=W snapshot, then 35=X updates |
| `1` = Offer | Order book, NO bids, priced as the NO price | Per instrument only | One 35=W snapshot, then 35=X updates |
| `2` = Trade | Public trades | Per instrument or all instruments | 35=X only |
| `B` = Trade volume | Total contracts traded | Per instrument or all instruments | 35=X only |
| `C` = Open interest | Number of open contracts | Per instrument or all instruments | 35=X only |
| `L` = Instrument lifecycle | Instrument trading status | Per instrument or all instruments | 35=f only |

> [!NOTE]
>
> Request instrument lifecycle (`269=L`) on its own `MDReqID`. A request that combines `269=L` with any other entry type is rejected with `281=8`.

> [!NOTE]
>
> Only order book requests (`269=0` or `1`) receive an initial 35=W snapshot. Trade, trade volume, open interest, and lifecycle subscriptions deliver only changes that occur after you subscribe.

* A multi-instrument request is all-or-nothing: if any Symbol (55) does not resolve, or a snapshot cannot be delivered, the whole request is rejected and no subscription is created.
* To unsubscribe, send `263=2` with the `MDReqID` of the subscription. All instruments subscribed under that `MDReqID` are removed.

## MarketDataSnapshotFullRefresh (35=W)

Sent once per instrument when you subscribe to the order book (`269=0` or `1`). The snapshot contains only the requested sides, up to the requested MarketDepth (264).

| Tag | Name | FIX Type | Req | Description |
| :- | :- | :- | :- | :- |
| 262 | MDReqID | String | Y | `MDReqID` of the subscription. |
| 55 | Symbol | String | Y | Instrument ticker. If the instrument has no ticker, the numeric instrument ID. |
| 48 | SecurityID | String | Y | Numeric instrument ID. |
| 268 | NoMDEntries | NumInGroup | Y | Number of price levels in the snapshot. `0` when the requested sides are empty. |
| → 269 | MDEntryType | Char | Y | `0` = Bid (YES bid). `1` = Offer (NO bid). |
| → 1023 | MDPriceLevel | Int | Y | Rank of the level within its side. `1` = Best price. |
| → 270 | MDEntryPx | Price | Y | Price of the level, 3 decimal places. Offer (`269=1`) levels are expressed as the NO price, `1.000` minus the YES ask price. |
| → 271 | MDEntrySize | Qty | Y | Quantity resting at the level, 2 decimal places. |
| 60 | TransactTime | UTCTimestamp | Y | UTC time of the last event that changed the book, in microseconds. Sent once per message, not per entry. |

## MarketDataIncrementalRefresh (35=X)

Carries order book level changes, trades, trade volume, and open interest. Each message carries one kind of update: order book levels, one trade, or trade volume and open interest.

| Tag | Name | FIX Type | Req | Description |
| :- | :- | :- | :- | :- |
| 262 | MDReqID | String | Y | `MDReqID` of the subscription. |
| 268 | NoMDEntries | NumInGroup | Y | Number of entries in the message. |
| → 279 | MDUpdateAction | Char | Y | `0` = New. `1` = Change. `2` = Delete. Trade, trade volume, and open interest entries are always `0`. |
| → 269 | MDEntryType | Char | Y | `0` = Bid (YES bid). `1` = Offer (NO bid). `2` = Trade. `B` = Trade volume. `C` = Open interest. |
| → 55 | Symbol | String | Y | Instrument ticker. If the instrument has no ticker, the numeric instrument ID. |
| → 48 | SecurityID | String | Y | Numeric instrument ID. |
| → 1023 | MDPriceLevel | Int | C | Rank of the level within its side. `1` = Best price. Sent on order book entries with `279=0` or `279=1`. Not sent on `279=2`. |
| → 270 | MDEntryPx | Price | C | Price, 3 decimal places. Sent on order book and trade entries. Offer (`269=1`) levels are expressed as the NO price. Trade (`269=2`) prices are the YES price. Not sent on trade volume (`269=B`) or open interest (`269=C`). |
| → 271 | MDEntrySize | Qty | Y | 2 decimal places. <ul><li>Order book: absolute quantity now resting at the level. `0.00` on `279=2`.</li><li>Trade: contracts traded.</li><li>Trade volume: cumulative contracts traded.</li><li>Open interest: number of open contracts.</li></ul> |
| → 278 | MDEntryID | String | C | Trade ID. Sent on trade entries (`269=2`). Unique per execution; use it to deduplicate. |
| → 2446 | AggressorSide | Int | C | Side of the aggressor on trade entries (`269=2`). `0` = No aggressor (opening fill). `1` = Buy. `2` = Sell. Not sent when the side is unknown. |
| 60 | TransactTime | UTCTimestamp | Y | UTC time of the event, in microseconds. Sent once per message, not per entry. |

> [!NOTE]
>
> Order book entries carry the absolute quantity at the price level. Replace your local level with `MDEntrySize (271)`; do not add or subtract. `279=2` removes the level.

> [!NOTE]
>
> The gateway sends `279=2` only when a level's resting quantity drops to zero. When better prices push a level out of your requested depth, no Delete is sent; truncate your local book to the requested depth.

> [!NOTE]
>
> Trade volume (`269=B`) and open interest (`269=C`) are sent with `279=0`. At settlement, the message may carry only open interest (`269=C`), without trade volume.

## MarketDataRequestReject (35=Y)

Sent when a `MarketDataRequest` is well-formed but cannot be accepted. No subscription is created.

| Tag | Name | FIX Type | Req | Description |
| :- | :- | :- | :- | :- |
| 262 | MDReqID | String | Y | `MDReqID` of the rejected request. |
| 281 | MDReqRejReason | Char | N | Reason for the rejection. See the values below. |
| 58 | Text | String | N | Human-readable reason. Distinguishes conditions that share one `281` value. |

| MDReqRejReason (281) | Sent when |
| :- | :- |
| `0` = Unknown symbol | A Symbol (55) does not resolve to an instrument, an unsubscribe (`263=2`) names an `MDReqID` with no active subscription, or the request could not be processed. |
| `1` = Duplicate MDReqID | The `MDReqID` is already active on this session. |
| `2` = Insufficient bandwidth | An order book snapshot could not be delivered. No subscription is created; retry the request. |
| `4` = Unsupported SubscriptionRequestType | SubscriptionRequestType (263) is not `1` or `2`. |
| `5` = Unsupported MarketDepth | MarketDepth (264) is missing or has an unsupported value on an order book request, or is present on a request without `269=0` or `269=1`. |
| `8` = Unsupported MDEntryType | An MDEntryType (269) is unknown or not supported, NoMDEntryTypes (267) is `0`, or `269=L` is combined with other entry types. |
| `9` = Unsupported scoping | NoRelatedSym (146) is missing or negative, the number of distinct Symbol (55) values does not equal `146`, or `146=0` is sent with `269=0` or `269=1`. |

## SecurityStatus (35=f)

Sent to instrument lifecycle subscriptions (`269=L`) when an instrument is created or its trading status or symbol changes. No snapshot is sent on subscribe.

| Tag | Name | FIX Type | Req | Description |
| :- | :- | :- | :- | :- |
| 55 | Symbol | String | Y | Instrument ticker. If the instrument has no ticker, the numeric instrument ID. |
| 48 | SecurityID | String | Y | Numeric instrument ID. |
| 326 | SecurityTradingStatus | Int | Y | Instrument trading status. See [SecurityTradingStatus values](#securitytradingstatus-values). |
| 60 | TransactTime | UTCTimestamp | Y | UTC time of the status change, in microseconds. |

### SecurityTradingStatus values

Coinbase Derivatives: Predictions assigns its own meanings to SecurityTradingStatus (326). Interpret the values by this table, not by the standard FIX descriptions.

| Value | Status | Description |
| :- | :- | :- |
| `21` | Listed | Instrument is listed and not yet open for trading. |
| `17` | Open | Instrument is open for trading. |
| `2` | Pause | Trading is paused. |
| `18` | Closed | Trading is closed. |
| `27` | Determined | The outcome is determined. |
| `28` | Settled | The instrument is settled. |
| `26` | Amended | The instrument was amended. |
| `29` | Delisted | The instrument is delisted. |

## BusinessMessageReject (35=j)

Sent when an application message cannot be processed:

* A `MarketDataRequest` that is structurally malformed, for example a missing required tag or an invalid value format.
* Any application message type other than `MarketDataRequest (35=V)`.

| Tag | Name | FIX Type | Req | Description |
| :- | :- | :- | :- | :- |
| 45 | RefSeqNum | SeqNum | N | MsgSeqNum (34) of the rejected message. |
| 372 | RefMsgType | String | Y | MsgType (35) of the rejected message. |
| 379 | BusinessRejectRefID | String | C | `MDReqID (262)` of a rejected `MarketDataRequest`, when it could be read. |
| 380 | BusinessRejectReason | Int | Y | `0` = Other. Sent for every BusinessMessageReject. |
| 58 | Text | String | N | Human-readable reason, for example the invalid tag, or `unsupported message type`. |

## Values specific to Coinbase Derivatives: Predictions

The gateway uses standard FIX 5.0 SP2 tags. The following values are specific to Coinbase Derivatives: Predictions.

| Tag | Value | Description |
| :- | :- | :- |
| MDEntryType (269) | `L` = Instrument lifecycle | Subscribes to instrument status changes, delivered as [SecurityStatus (35=f)](#securitystatus-35f). |
| SecurityTradingStatus (326) | `2`, `17`, `18`, `21`, `26`, `27`, `28`, `29` | Instrument trading statuses with meanings specific to Coinbase Derivatives: Predictions. See [SecurityTradingStatus values](#securitytradingstatus-values). |
