> 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/feed-b-global-order-book.md).

# Feed 'B' - Global order book

**Requests**

{% tabs %}
{% tab title="Subscribe" %}

```json
{"event": "bind", "feed": "B", "feedId": "BTC-EUR"}
```

{% hint style="info" %}
Use`instrument name` as `"feedId"` value to subscribe on instrument book
{% endhint %}
{% endtab %}

{% tab title="Unsubscribe" %}

```json
{"event": "unbind", "feed": "B", "feedId": "BTC-USD"}
```

{% endtab %}
{% endtabs %}

**Feed handling**

{% tabs %}
{% tab title="Definitions" %}

```json
bookLevel = [
  0: price (Efx::Price)
  1: size (Efx::Size)
]
```

{% hint style="warning" %}
Global book feed sends full snapshot updates.
{% endhint %}

For a detailed book description

{% content-ref url="/pages/KGixTxfDw51J82MQ1xrB" %}
[book](/api-reference/rest-api/trading/orders-and-order-book/book.md)
{% endcontent-ref %}
{% endtab %}

{% tab title="Possible updates" %}

```json
// snapshot
['B', feed_id, 'S', [
  array of bid bookLevel,
  array of ask boolLevel
]]

// failed to subscribe
['B', feed_id, 'Z', 2]

// unsubscribed
['B', feed_id, 'U', 0]
```

{% endtab %}

{% tab title="Feed update example" %}

```javascript
applyToSnapshot(prevSnapshot, feed, action, data) {
    switch (feed) {
        case 'B': {
            switch (action) {
                case 'S': {
                    return [[...data[0]], [...data[1]]]
                }
            }
            break
        }
    }
    return prevSnapshot
}
```

{% endtab %}
{% endtabs %}
