> ## 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 trade feed for currency pairs

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

Trade feed for a currency pair. On subscription, the last 50 trades are sent as a snapshot, followed by real-time trade updates.

## Subscribe

<Tabs>
  <Tab title="Request">
    <ResponseField name="event" type="string" required>
      Value: `subscribe`
    </ResponseField>

    <ResponseField name="pair" type="string[]" required>
      <span className="field-attr">Example:</span> `["BTC/USD", "MATIC/GBP"]`

      The currency pairs for this request.
    </ResponseField>

    <ResponseField name="subscription" type="object">
      <Expandable title="properties" defaultOpen>
        <ResponseField name="name" type="string" required>
          Value: `trade`
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="reqid" type="string">
      Optional client originated request identifier sent as acknowledgment in the response.
    </ResponseField>
  </Tab>

  <Tab title="Response">
    The subscription status is returned via the [subscriptionStatus](/exchange/api-reference/spot-websocket-v1/subscriptionstatus) message.
  </Tab>
</Tabs>

## Snapshot / Update

<ResponseField name="" type="array">
  <Expandable title="elements" defaultOpen>
    <ResponseField name="[0] channel_id" type="integer" deprecated>
      <span className="field-attr">Deprecated:</span> use `channelName` and `pair`

      Channel identifier.
    </ResponseField>

    <ResponseField name="[1] trades" type="array">
      A list of trades.

      <Expandable title="elements">
        <ResponseField name="trade" type="array">
          <Expandable title="elements">
            <ResponseField name="[0] price" type="string">Price.</ResponseField>
            <ResponseField name="[1] volume" type="string">Volume.</ResponseField>
            <ResponseField name="[2] time" type="string">Time, seconds since epoch.</ResponseField>

            <ResponseField name="[3] side" type="string">
              <span className="field-attr">One of:</span> `buy`, `sell`

              Taker side.
            </ResponseField>

            <ResponseField name="[4] order_type" type="string">
              <span className="field-attr">One of:</span> `market`, `limit`

              Taker order type.
            </ResponseField>

            <ResponseField name="[5] misc" type="string">Miscellaneous.</ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="[2] pair" type="string">
      <span className="field-attr">Example:</span> `"BTC/USD"`

      The symbol of the currency pair.
    </ResponseField>

    <ResponseField name="[3] channel_name" type="string">
      Value: `trade`
    </ResponseField>
  </Expandable>
</ResponseField>

## Unsubscribe

<Tabs>
  <Tab title="Request">
    <ResponseField name="event" type="string" required>
      Value: `unsubscribe`
    </ResponseField>

    <ResponseField name="pair" type="string[]">
      <span className="field-attr">Example:</span> `["BTC/USD", "MATIC/GBP"]`<br />
      <span className="field-attr">Condition:</span> All channels which support pair subscriptions

      The currency pairs to unsubscribe.
    </ResponseField>

    <ResponseField name="reqid" type="string">
      Optional client originated request identifier sent as acknowledgment in the response.
    </ResponseField>

    <ResponseField name="subscription" type="object">
      <Expandable title="properties" defaultOpen>
        <ResponseField name="name" type="string" required>
          Value: `trade`
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Tab>

  <Tab title="Response">
    The unsubscription status is returned via the [subscriptionStatus](/exchange/api-reference/spot-websocket-v1/subscriptionstatus) message.
  </Tab>
</Tabs>

<Panel>
  <CodeGroup>
    ```json Subscribe theme={null}
    {
      "event": "subscribe",
      "pair": [
        "XBT/EUR"
      ],
      "subscription": {
        "name": "trade"
      }
    }
    ```
  </CodeGroup>

  <CodeGroup>
    ```json Snapshot / Update theme={null}
    [
      0,
      [
        [
          "5541.20000",
          "0.15850568",
          "1534614057.321597",
          "s",
          "l",
          ""
        ],
        [
          "6060.00000",
          "0.02455000",
          "1534614057.324998",
          "b",
          "l",
          ""
        ]
      ],
      "trade",
      "XBT/USD"
    ]
    ```
  </CodeGroup>

  <CodeGroup>
    ```json Unsubscribe theme={null}
    {
      "event": "unsubscribe",
      "pair": [
        "XBT/EUR"
      ],
      "subscription": {
        "name": "trade"
      }
    }
    ```
  </CodeGroup>
</Panel>
