# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://faq.finerymarkets.com/api-reference/websocket-api/qs-for-takers/qs-market-data-feed.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
