> For the complete documentation index, see [llms.txt](https://faq.finerymarkets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faq.finerymarkets.com/api-reference/websocket-api/qs-for-takers/qs-market-data-feed.md).

# QS Market Data Feed

## Bind Event

Subscribes to quote streams from Makers for a given instrument. This event doesn't subscribe to firm book updates. Only one subscription per instrument is allowed in a single connection.

{% tabs %}
{% tab title="Event Schema" %}

```json
{
  "event": "bind",
  "reqId": <string>,
  "instrument": <string>,
  "makers": [<Efx::ClientId>]
}
```

| Field        | Type           | Description                                                            |
| ------------ | -------------- | ---------------------------------------------------------------------- |
| event        | string         | Event type, required                                                   |
| reqId        | string         | Subscription request ID, required                                      |
| instrument   | string         | Instrument name to subscribe to, required                              |
| makers       | array\[uint32] | List of makers to receive quotes from, optional. Default is all makers |
| {% endtab %} |                |                                                                        |

{% tab title="Event Example" %}

```json
{
  "event": "bind",
  "reqId": "1",
  "instrument": "BTC-USD",
  "makers": [1, 2, 3]
}
```

{% endtab %}

{% tab title="Response - Error" %}

```json
{
  "event": "bind",
  "reqId": "1",
  "error": 300
}
```

An error event will be sent in case of failure.
{% endtab %}
{% endtabs %}

## Unbind Event

The Unbind Event is sent by a Taker to unsubscribe from the quote streams.

{% tabs %}
{% tab title="Event Schema" %}

```json
{
  "event": "unbind",
  "reqId": "<string>"
}
```

| Field        | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| event        | string | Event type, required              |
| reqId        | string | Subscription request ID, required |
| {% endtab %} |        |                                   |

{% tab title="Event Example" %}

```json
{
  "event": "unbind",
  "reqId": "1"
}
```

{% endtab %}

{% tab title="Response - Error" %}

```json
{
  "event": "unbind",
  "reqId": "1",
  "error": 101
}
```

{% endtab %}
{% endtabs %}

## Market Data Update (FM to Taker)

This event is sent by FM to a Taker to provide market data updates as a snapshot of the order book.

{% tabs %}
{% tab title="Event Schema" %}

```json
{
  "event": "marketDataUpdate",
  "reqId": "<string>",
  "instrument": "<string>",
  "makerId": "<ClientID>",
  "levels": {
    "asks": [[<uint64>, <int64>]],
    "bids": [[<uint64>, <int64>]]
  }
}
```

| Field        | Type                     | Description                                    |
| ------------ | ------------------------ | ---------------------------------------------- |
| event        | string                   | Event type, required                           |
| reqId        | string                   | ID of the corresponding bind event, required   |
| instrument   | string                   | Instrument name, required                      |
| makerId      | ClientID                 | ID of the maker providing the quotes, required |
| levels.asks  | array\[\[uint64, int64]] | Price and size for asks                        |
| levels.bids  | array\[\[uint64, int64]] | Price and size for bids                        |
| {% endtab %} |                          |                                                |

{% tab title="Event Example" %}

```json
{
  "event": "marketDataUpdate",
  "reqId": "1",
  "makerId": 1,
  "instrument": "BTC-USD",
  "levels": {
    "asks": [],
    "bids": []
  }
}
```

{% endtab %}
{% endtabs %}
