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

# Trade

> Subscribe to information about executed trades

<div className="api-banner">
  <span className="api-protocol ws">WSS</span>
  <span className="api-detail">futures.kraken.com/ws/v1</span>
  <span className="api-tag">trade</span>
</div>

The `trade` feed returns information about executed trades.

***

## Request

<ResponseField name="event" type="string" required>
  `subscribe` or `unsubscribe`
</ResponseField>

<ResponseField name="feed" type="string" required>
  The requested subscription feed. Value: `trade`
</ResponseField>

<ResponseField name="product_ids" type="list of strings" required>
  A list of strings which represent the products that user will receive information upon.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "subscribe",
    "feed": "trade",
    "product_ids": ["PF_XBTUSD"]
  }
  ```
</CodeGroup>

***

## Response Success

<ResponseField name="event" type="string">
  <span className="field-attr">One of:</span> `subscribed`, `subscribed_failed`, `unsubscribed`, `unsubscribed_failed`

  The result.
</ResponseField>

<ResponseField name="feed" type="string">
  The requested subscription feed. Value: `trade`
</ResponseField>

<ResponseField name="product_ids" type="list of strings" required>
  A list of strings which represent the products that user will receive information upon.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "subscribed",
    "feed": "trade",
    "product_ids": ["PF_XBTUSD"]
  }
  ```
</CodeGroup>

***

## Response Snapshot

<ResponseField name="feed" type="string">
  The subscribed feed.
</ResponseField>

<ResponseField name="product_id" type="string">
  The subscribed product (referred also as instrument or symbol).
</ResponseField>

<ResponseField name="trades" type="list of structures">
  <Expandable title="properties">
    <ResponseField name="feed" type="string">Always `trade`.</ResponseField>
    <ResponseField name="product_id" type="string">The product symbol.</ResponseField>
    <ResponseField name="uid" type="string">Unique identifier for the matched trade.</ResponseField>
    <ResponseField name="side" type="string">The classification of the taker side in the matched trade: `buy` if the taker is a buyer, `sell` if the taker is a seller.</ResponseField>
    <ResponseField name="type" type="string">The classification of the matched trade in an orderbook: `fill` if it is a normal buyer and seller, `liquidation` if it is a result of a user being liquidated from their position, `termination` if it is a result of a user being terminated, or `block` if it is a component of a block trade.</ResponseField>
    <ResponseField name="seq" type="positive integer">The subscription message sequence number.</ResponseField>
    <ResponseField name="time" type="positive integer">The UTC or GMT time of the trade in milliseconds.</ResponseField>
    <ResponseField name="qty" type="positive float">The quantity of the traded product.</ResponseField>
    <ResponseField name="price" type="positive float">The price that the product got traded.</ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "feed": "trade_snapshot",
    "product_id": "PF_XBTUSD",
    "trades": [
      {
        "feed": "trade",
        "product_id": "PF_XBTUSD",
        "uid": "caa9c653-420b-4c24-a9f1-462a054d86f1",
        "side": "sell",
        "type": "fill",
        "seq": 655508,
        "time": 1612269657781,
        "qty": 440,
        "price": 34893
      },
      {
        "feed": "trade",
        "product_id": "PF_XBTUSD",
        "uid": "45ee9737-1877-4682-bc68-e4ef818ef88a",
        "side": "sell",
        "type": "fill",
        "seq": 655507,
        "time": 1612269656839,
        "qty": 9643,
        "price": 34891
      }
    ]
  }
  ```
</CodeGroup>

***

## Response Delta

<ResponseField name="feed" type="string">
  The subscribed feed.
</ResponseField>

<ResponseField name="product_id" type="string">
  The subscribed product (referred also as instrument or symbol).
</ResponseField>

<ResponseField name="uid" type="string">
  Unique identifier for the matched trade.
</ResponseField>

<ResponseField name="side" type="string">
  The classification of the taker side in the matched trade: `buy` if the taker is a buyer, `sell` if the taker is a seller.
</ResponseField>

<ResponseField name="type" type="string">
  The classification of the matched trade in an orderbook: `fill` if it is a normal buyer and seller, `liquidation` if it is a result of a user being liquidated from their position, `termination` if it is a result of a user being terminated, or `block` if it is a component of a block trade.
</ResponseField>

<ResponseField name="seq" type="positive integer">
  The subscription message sequence number.
</ResponseField>

<ResponseField name="time" type="positive integer">
  The UTC or GMT time of the trade in milliseconds.
</ResponseField>

<ResponseField name="qty" type="positive float">
  The quantity of the traded product.
</ResponseField>

<ResponseField name="price" type="positive float">
  The price that the product got traded.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "feed": "trade",
    "product_id": "PF_XBTUSD",
    "uid": "05af78ac-a774-478c-a50c-8b9c234e071e",
    "side": "sell",
    "type": "fill",
    "seq": 653355,
    "time": 1612266317519,
    "qty": 15000,
    "price": 34969.5
  }
  ```
</CodeGroup>

***

## Response Error

<ResponseField name="event" type="string">
  Value: `error`
</ResponseField>

<ResponseField name="message" type="string">
  <span className="field-attr">One of:</span> `Invalid product id`, `Invalid feed`, `Json Error`

  An error message.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "error",
    "message": "Invalid product id"
  }
  ```
</CodeGroup>
