> ## 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.

# Own Trades

> Subscribe to real-time trade execution updates for the authenticated user

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

The `ownTrades` channel streams executions for the authenticated user. A snapshot of the last 50 trades is sent on subscription, followed by real-time updates for any new trades.

## Subscribe

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

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

        <ResponseField name="token" type="string" required>
          Session token from the GetWebSocketsToken REST endpoint.
        </ResponseField>

        <ResponseField name="snapshot" type="boolean">
          <span className="field-attr">One of:</span> `false`, `true`<br />
          <span className="field-attr">Default:</span> `true`

          Includes initial snapshot of historical data.
        </ResponseField>

        <ResponseField name="consolidate_taker" type="boolean">
          <span className="field-attr">One of:</span> `false`, `true`<br />
          <span className="field-attr">Default:</span> `true`

          If true, fills are consolidated by taker, otherwise all fills are shown.
        </ResponseField>

        <ResponseField name="rebased" type="boolean">
          <span className="field-attr">One of:</span> `true`, `false`<br />
          <span className="field-attr">Default:</span> `true`<br />
          <span className="field-attr">Condition:</span> Effective for viewing xstocks only

          If `true`, display in terms of underlying equity, otherwise display in terms of SPV tokens.
        </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

The snapshot and update responses share the same schema. The payload is a JSON array containing the trade data, the channel name, and feed detail.

<ResponseField name="[0]" type="object[]">
  A list of trade objects. Each object is keyed by the Kraken trade identifier.

  <Expandable title="properties" defaultOpen>
    <ResponseField name="<trade-id>" type="object">
      The key for each trade is the Kraken trade identifier.

      <Expandable title="properties">
        <ResponseField name="ordertxid" type="string">
          Order identifier.
        </ResponseField>

        <ResponseField name="postxid" type="integer">
          Position identifier.
        </ResponseField>

        <ResponseField name="pair" type="string">
          Asset pair.
        </ResponseField>

        <ResponseField name="time" type="string">
          Unix timestamp of trade.
        </ResponseField>

        <ResponseField name="type" type="string">
          Side of order (buy/sell).
        </ResponseField>

        <ResponseField name="ordertype" type="string">
          Order type.
        </ResponseField>

        <ResponseField name="price" type="string">
          Average price order was filled in quote currency.
        </ResponseField>

        <ResponseField name="cost" type="string">
          Total cost of order in the quote currency.
        </ResponseField>

        <ResponseField name="fee" type="string">
          Total fees in the quote currency.
        </ResponseField>

        <ResponseField name="vol" type="string">
          Volume of the trade in base currency.
        </ResponseField>

        <ResponseField name="margin" type="string">
          Initial margin (quote currency).
        </ResponseField>

        <ResponseField name="margin_borrow" type="boolean">
          Indicates if an execution is on margin, i.e. if the trade increased or reduced size of margin borrowing. On trade events only.
        </ResponseField>

        <ResponseField name="cl_ord_id" type="string">
          An optional, alphanumeric client identifier associated with this order. Available on update messages only.
        </ResponseField>

        <ResponseField name="ext_exec_id" type="string">
          <span className="field-attr">Format:</span> UUID

          An optional, external partner execution identifier.
        </ResponseField>

        <ResponseField name="userref" type="integer">
          An optional, numeric identifier associated with one or more orders. Available on update messages only.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="[1]" type="string">
  Value: `ownTrades`
</ResponseField>

<ResponseField name="[2]" type="object">
  <Expandable title="properties">
    <ResponseField name="sequence" type="integer">
      Sequence number for this subscription.
    </ResponseField>
  </Expandable>
</ResponseField>

<Panel>
  <CodeGroup>
    ```json Subscribe theme={null}
    {
        "event": "subscribe",
        "subscription": {
            "name": "ownTrades",
            "token": "WW91ciBhdXRoZW50aWNhdGlvbiB0b2tlbiBnb2VzIGhlcmUu"
        }
    }
    ```

    ```json Snapshot / Update theme={null}
    [
        [
            {
                "TDLH43-DVQXD-2KHVYY": {
                    "cost": "1000000.00000",
                    "fee": "1600.00000",
                    "margin": "0.00000",
                    "ordertxid": "TDLH43-DVQXD-2KHVYY",
                    "ordertype": "limit",
                    "pair": "XBT/EUR",
                    "postxid": "OGTT3Y-C6I3P-XRI6HX",
                    "price": "100000.00000",
                    "time": "1560516023.070651",
                    "type": "sell",
                    "vol": "1000000000.00000000"
                }
            }
        ],
        "ownTrades",
        {
            "sequence": 2948
        }
    ]
    ```
  </CodeGroup>
</Panel>
