> 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-d-deals.md).

# Feed 'D' - Deals

**Requests**

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

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

{% hint style="info" %}
Use `instrument name` or `instrument id` as `feedId` value to subscribe to updates for particular instrument. If `feedId` field is absent, no filter is applied.
{% endhint %}
{% endtab %}

{% tab title="Unsubscribe" %}

```json
{"event": "unbind", "feed": "D"}
```

{% endtab %}
{% endtabs %}

**Feed handling**

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

```json

deal = [
  0: instrumentName (string)
  1: orderType (unsigned int16)
  2: orderSide (Efx::Side)
  3: orderCancelReason (Efx::CancelReason)
  4: orderId (Efx::OrderId)
  5: clientOrderId (Efx::ClientOrderId)
  6: orderPrice (Efx::Price)
  7: initialSize (Efx::Size)
  8: sizeOrVolumeLeft (Efx::Size)
  9: createdAt (Efx::Timestamp)
  10: dealMoment (Efx::Timestamp)
  11: dealId (Efx::DealId)
  12: dealAggressorSide (Efx::Side)
  13: dealPrice (Efx::Price)
  14: dealSize (Efx::Size)
  15: dealVolume (Efx::Size)
  16: dealDelta (Efx::Size)
  17: counterpartyId (Efx::ClientId)
  18: isOrderByVolume (unsigned int16)
  19: takerOrderOwnerId (Efx::ClientId)
  20: linkedTo (Efx::DealId)
  21: dealType (DealType)
  22: makerOrderOwnerId (Efx::ClientId)
  23: liquiditySource (Efx::LiquiditySource)
  24: balanceCurrencyUSDPrice (Efx::Price)
]
```

{% endtab %}

{% tab title="Possible Updates" %}

```
// subscribed
['D', feed_id, 'B', 0]

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

// new deal
['D', feed_id, 'D', deal]

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

{% hint style="info" %}
`feed_id` is copied from subscription request and 0 if not provided
{% endhint %}
{% endtab %}
{% endtabs %}
