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

# Executions

> Subscribe to order status and execution events for your account

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

The `executions` channel streams order status and execution events for this account.

It corresponds to a combination of the following Websockets v1 channels: `openOrders` and `ownTrades`.

This channel contains account specific data, an authentication token is required in the request.

## Subscribe

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

    <ResponseField name="params" type="object" required>
      <Expandable title="properties" defaultOpen>
        <ResponseField name="channel" type="string" required>
          Value: `executions`
        </ResponseField>

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

          If `true`, the last 50 order fills will be included in snapshot.
        </ResponseField>

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

          If `true`, open orders will be included in snapshot.
        </ResponseField>

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

          If `true`, all possible status transitions will be sent. Otherwise, only open / close transitions will be streamed: `new`, `filled`, `canceled`, `expired`.
        </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>

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

          If `true`, the rate-limit counter is included in the stream.
        </ResponseField>

        <ResponseField name="users" type="string">
          <span className="field-attr">One of:</span> `all`<br />
          <span className="field-attr">Condition:</span> Available on master accounts only

          If `all`, events for master and subaccounts are streamed, otherwise only master account events are published. No snapshot is provided.
        </ResponseField>

        <ResponseField name="snapshot_trades" type="boolean" deprecated>
          <span className="field-attr">One of:</span> `true`, `false`<br />
          <span className="field-attr">Deprecated:</span> Use 'snap\_trades' field

          If `true`, snapshot provides only trade events. Otherwise, open orders and trades will be included in snapshot.
        </ResponseField>

        <ResponseField name="snapshot" type="boolean" deprecated>
          <span className="field-attr">One of:</span> `true`, `false`<br />
          <span className="field-attr">Deprecated:</span> Use 'snap\_orders' or 'snap\_trades' field

          Request a snapshot after subscribing.
        </ResponseField>

        <ResponseField name="token" type="string" required>
          Authentication token. See [authentication guide](/exchange/guides/websockets/authentication) for details.
        </ResponseField>
      </Expandable>
    </ResponseField>

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

  <Tab title="Response">
    <ResponseField name="method" type="string" required>
      Value: `subscribe`
    </ResponseField>

    <ResponseField name="result" type="object">
      <Expandable title="properties" defaultOpen>
        <ResponseField name="channel" type="string" required>
          Value: `executions`
        </ResponseField>

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

          Indicates if a snapshot of orders is requested.
        </ResponseField>

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

          Indicates if a snapshot of trades is requested.
        </ResponseField>

        <ResponseField name="maxratecount" type="integer">
          Specifies the max rate counter value for the user transaction rate. It is based on user tier.
        </ResponseField>

        <ResponseField name="snapshot" type="boolean" deprecated>
          <span className="field-attr">Deprecated:</span> Use 'snap\_trades' and 'snap\_orders'

          Indicates if a snapshot is requested.
        </ResponseField>

        <ResponseField name="warnings" type="string[]">
          An advisory message, highlighting deprecated fields or upcoming changes to the channel.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="success" type="boolean">
      Indicates if the request was successfully processed by the engine. One of: `true`, `false`
    </ResponseField>

    <ResponseField name="error" type="string">
      Error message. Condition: if `success` is `false`.
    </ResponseField>

    <ResponseField name="time_in" type="string">
      The timestamp when the subscription was received on the wire, just prior to parsing data. Format: RFC3339. Example: `2022-12-25T09:30:59.123456Z`
    </ResponseField>

    <ResponseField name="time_out" type="string">
      The timestamp when the acknowledgement was sent on the wire, just prior to transmitting data. Format: RFC3339. Example: `2022-12-25T09:30:59.123456Z`
    </ResponseField>

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

## Snapshot / Update

The snapshot and update stream share the same data schema, the fields included in the message is dependant on the `exec_type`.

By default, the snapshot response contains all open orders and latest 50 trades.

The snapshot message content can be adjusted with the subscription parameters.

<ResponseField name="channel" type="string">
  Value: `executions`
</ResponseField>

<ResponseField name="type" type="string">
  <span className="field-attr">One of:</span> `snapshot`, `update`
</ResponseField>

<ResponseField name="data" type="object[]">
  A list of execution reports: order status and fills.

  <Expandable title="properties" defaultOpen>
    <ResponseField name="amended" type="boolean">
      <span className="field-attr">One of:</span> `true`, `false`

      Indicates if the order has been amended, the modification history can be extracted from the REST `OrderAmends` endpoint. This field is present in the snapshot and the `amended`, `restated` event types.
    </ResponseField>

    <ResponseField name="avg_price" type="float">
      Order's average fill price.
    </ResponseField>

    <ResponseField name="cash_order_qty" type="float">
      Order volume expressed in quote currency (if specified on the original order).
    </ResponseField>

    <ResponseField name="cl_ord_id" type="string">
      Optional client identifier associated with the order.
    </ResponseField>

    <ResponseField name="contingent" type="object">
      The contingent object describes the template for generating the secondary close orders when the primary order fills.

      <Expandable title="properties" defaultOpen>
        <ResponseField name="order_type" type="string">
          <span className="field-attr">One of:</span> `limit`, `stop-loss`, `stop-loss-limit`, `take-profit`, `take-profit-limit`, `trailing-stop`, `trailing-stop-limit`

          Describes the order type of the secondary orders which will be created on each fill.
        </ResponseField>

        <ResponseField name="trigger_price" type="float">
          <span className="field-attr">Condition:</span> Only on triggered secondary order types

          Describes the trigger price amount on the secondary orders. This field is used in combination with the `contingent.trigger_price_type` field to determine the effective trigger price.
        </ResponseField>

        <ResponseField name="trigger_price_type" type="string">
          <span className="field-attr">One of:</span> `static`, `pct`, `quote`<br />
          <span className="field-attr">Condition:</span> Only on triggered secondary order types

          Describes trigger price units on the secondary orders.

          * `static`: a static market price for the asset, i.e. 30000 for BTC/USD.
          * `pct`: a percentage offset from the reference price, i.e. -10% from index price.
          * `quote`: a notional offset from the reference price in the quote currency, i.e, 150 BTC/USD from last price.
        </ResponseField>

        <ResponseField name="limit_price" type="float">
          <span className="field-attr">Condition:</span> Only on secondary order types that support limit price

          Describes limit price amount on the secondary orders. This field is used in combination with the `contingent.limit_price_type` field to determine the effective limit price.
        </ResponseField>

        <ResponseField name="limit_price_type" type="string">
          <span className="field-attr">One of:</span> `static`, `pct`, `quote`<br />
          <span className="field-attr">Condition:</span> Only on secondary order types that support limit price

          Describes limit price units on the secondary orders.

          * `static`: a static market price for the asset, i.e. 30000 for BTC/USD.
          * `pct`: a percentage offset from the reference price, i.e. -10% from index price.
          * `quote`: a notional offset from the reference price in the quote currency, i.e, 150 BTC/USD from last price.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="cost" type="float">
      <span className="field-attr">Condition:</span> trade events only

      Value of an individual execution.
    </ResponseField>

    <ResponseField name="cum_cost" type="float">
      The order cumulative value executed.
    </ResponseField>

    <ResponseField name="cum_qty" type="float">
      The order cumulative executed quantity.
    </ResponseField>

    <ResponseField name="display_qty" type="float">
      Display quantity for iceberg order types.
    </ResponseField>

    <ResponseField name="display_qty_remain" type="float">
      <span className="field-attr">Condition:</span> Iceberg Order

      Indicates next display\_qty in Iceberg order.
    </ResponseField>

    <ResponseField name="effective_time" type="string">
      <span className="field-attr">Format:</span> RFC3339<br />
      <span className="field-attr">Example:</span> `2022-12-25T09:30:59.123456Z`

      Scheduled start time of the order.
    </ResponseField>

    <ResponseField name="exec_id" type="string">
      <span className="field-attr">Condition:</span> trade events only

      Execution identifier.
    </ResponseField>

    <ResponseField name="exec_type" type="string">
      <span className="field-attr">One of:</span> `pending_new`, `new`, `trade`, `filled`, `iceberg_refill`, `canceled`, `expired`, `amended`, `restated`, `status`

      Describes the type of order event and determines the set of fields in the message.

      * `pending_new`: Order request has been received and validated but the order is not live yet.
      * `new`: Order has been created and is live in the engine.
      * `trade`: The order has received a fill.
      * `filled`: The order has been fully filled.
      * `canceled`: The order has been cancelled.
      * `iceberg_refill`: Indicates an Iceberg order refill.
      * `expired`: The order has expired.
      * `amended`: There is a user initiated amend on the order, i.e. limit price change.
      * `restated`: There is a engine initiated amend on the order for maintenance of position or book, see `reason` field, i.e. reduce non-tradable liquidity.
      * `status`: The order has a status update, i.e. trigger price has been updated.
    </ResponseField>

    <ResponseField name="expire_time" type="string">
      <span className="field-attr">Format:</span> RFC3339<br />
      <span className="field-attr">Example:</span> `2022-12-25T09:30:59.123456Z`

      Scheduled expiration time of the order.
    </ResponseField>

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

      An optional, external partner order identifier shown on order events.
    </ResponseField>

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

      An optional, external partner execution identifier shown on trade events.
    </ResponseField>

    <ResponseField name="fees" type="object[]">
      <span className="field-attr">Condition:</span> trade events only

      The fees paid on this trade event. Currently, the fees are expressed in the quote currency only.

      <Expandable title="properties" defaultOpen>
        <ResponseField name="asset" type="string">
          The fee currency.
        </ResponseField>

        <ResponseField name="qty" type="float">
          The fee amount.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="fee_ccy_pref" type="string">
      The preferred currency for paying fees.

      * `fcib`: prefer fee in base currency.
      * `fciq`: prefer fee in quote currency.
    </ResponseField>

    <ResponseField name="fee_usd_equiv" type="float">
      The total fee paid in USD.
    </ResponseField>

    <ResponseField name="limit_price" type="float">
      Limit price for order types that support limit price restriction.
    </ResponseField>

    <ResponseField name="liquidated" type="boolean">
      Indicates if the order has been liquidated by the engine.
    </ResponseField>

    <ResponseField name="liquidity_ind" type="string">
      <span className="field-attr">One of:</span> `m`, `t`

      The liquidity indicator: `t` taker, `m` maker.
    </ResponseField>

    <ResponseField name="last_price" type="float">
      <span className="field-attr">Condition:</span> trade events only

      The average price in this trade event.
    </ResponseField>

    <ResponseField name="last_qty" type="float">
      <span className="field-attr">Condition:</span> trade events only

      The quantity filled in this trade event.
    </ResponseField>

    <ResponseField name="margin" type="boolean">
      Indicates if the order can be funded on margin.
    </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="no_mpp" type="boolean">
      Indicates if the order has market price protection.
    </ResponseField>

    <ResponseField name="ord_ref_id" type="string">
      Referral order transaction id that created this order.
    </ResponseField>

    <ResponseField name="order_id" type="string">
      Unique order identifier generated by Kraken.
    </ResponseField>

    <ResponseField name="order_qty" type="float">
      The client order quantity.
    </ResponseField>

    <ResponseField name="order_type" type="string">
      <span className="field-attr">One of:</span> `limit`, `market`, `iceberg`, `stop-loss`, `stop-loss-limit`, `take-profit`, `take-profit-limit`, `trailing-stop`, `trailing-stop-limit`, `settle-position`

      The execution model of the order.
    </ResponseField>

    <ResponseField name="order_status" type="string">
      Describes current state of the order.

      * `pending_new`: Order has been received but not yet created by the engine.
      * `new`: Order is live but has no fills.
      * `partially_filled`: Order is live and some fills.
      * `filled`: The order has been fully filled.
      * `canceled`: The order has been cancelled.
      * `expired`: The order has expired.
    </ResponseField>

    <ResponseField name="order_userref" type="integer">
      Optional numeric, client identifier associated with one or more orders.
    </ResponseField>

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

      Indicates a post only order.
    </ResponseField>

    <ResponseField name="position_status" type="string">
      <span className="field-attr">One of:</span> `opened`, `closing`, `closed`

      Indicates status of the position on a margin order.
    </ResponseField>

    <ResponseField name="reason" type="string">
      The reason associated with an event, if applicable.
    </ResponseField>

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

      Indicates a reduce only order.
    </ResponseField>

    <ResponseField name="sender_sub_id" type="string">
      For institutional accounts, identifies underlying sub-account/trader for Self Trade Prevention (STP).
    </ResponseField>

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

      Side of the order.
    </ResponseField>

    <ResponseField name="symbol" type="string">
      <span className="field-attr">Example:</span> `"BTC/USD"`

      The symbol of the currency pair.
    </ResponseField>

    <ResponseField name="time_in_force" type="string">
      <span className="field-attr">One of:</span> `GTC`, `GTD`, `IOC`, `FOK`

      Time-in-force specifies how long an order remains in effect before being expired.

      * `GTC`: Good Till Canceled
      * `GTD`: Good Till Date
      * `IOC`: Immediate Or Cancel
      * `FOK`: Fill Or Kill
    </ResponseField>

    <ResponseField name="timestamp" type="string">
      <span className="field-attr">Format:</span> RFC3339<br />
      <span className="field-attr">Example:</span> `2022-12-25T09:30:59.123456Z`

      Time of the event.
    </ResponseField>

    <ResponseField name="trade_id" type="integer">
      The trade identifier.
    </ResponseField>

    <ResponseField name="triggers" type="object">
      Describes the parameters and status of the price trigger for triggered order types.

      <Expandable title="properties" defaultOpen>
        <ResponseField name="reference" type="string">
          <span className="field-attr">One of:</span> `index`, `last`

          The reference price tracked for triggering orders.
        </ResponseField>

        <ResponseField name="price" type="float">
          Specifies the amount for the trigger price - it supports both static market prices and relative prices. This field is used in combination with the `price_type` field below to determine the effective trigger price.
        </ResponseField>

        <ResponseField name="price_type" type="string">
          <span className="field-attr">One of:</span> `static`, `pct`, `quote`

          The units for the trigger price.

          * `static`: a static market price for the asset, i.e. 30000 for BTC/USD.
          * `pct`: a percentage offset from the reference price, i.e. -10% from index price.
          * `quote`: a notional offset from the reference price in the quote currency, i.e, 150 BTC/USD from last price.
        </ResponseField>

        <ResponseField name="actual_price" type="float">
          The current value of the effective trigger price, this is useful if the trigger was entered using a relative price or the trigger price changes over time.
        </ResponseField>

        <ResponseField name="peak_price" type="float">
          The peak / trough price on `trailing-stop` and `trailing-stop-limit` orders.
        </ResponseField>

        <ResponseField name="last_price" type="float">
          On trigger activation, the value of the reference last price that triggered the order.
        </ResponseField>

        <ResponseField name="status" type="string">
          <span className="field-attr">One of:</span> `triggered`, `untriggered`

          The status is set to `triggered` when the trigger conditions are met and the order becomes active.
        </ResponseField>

        <ResponseField name="timestamp" type="string">
          <span className="field-attr">Format:</span> RFC3339<br />
          <span className="field-attr">Example:</span> `2022-12-25T09:30:59.123456Z`

          On trigger activation, the timestamp of the trigger event.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="user" type="string">
      <span className="field-attr">Example:</span> `AA96N74GCGEFN8KI`<br />
      <span className="field-attr">Condition:</span> Published when request parameters have 'users=all'

      The Kraken generated identifier for a user / sub-account.
    </ResponseField>

    <ResponseField name="cancel_reason" type="string" deprecated>
      <span className="field-attr">Deprecated:</span> Use 'reason' field

      Cancellation reason.
    </ResponseField>

    <ResponseField name="stop_price" type="float" deprecated>
      <span className="field-attr">Deprecated:</span> Use 'triggers' object

      The stop price for triggered order types.
    </ResponseField>

    <ResponseField name="trigger" type="string" deprecated>
      <span className="field-attr">One of:</span> `index`, `last`<br />
      <span className="field-attr">Deprecated:</span> Use 'triggers' object

      Reference price for triggered order types.
    </ResponseField>

    <ResponseField name="triggered_price" type="float" deprecated>
      <span className="field-attr">Deprecated:</span> Use 'triggers' object

      Price which triggered the order.
    </ResponseField>
  </Expandable>
</ResponseField>

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

## Unsubscribe

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

    <ResponseField name="params" type="object" required>
      <Expandable title="properties" defaultOpen>
        <ResponseField name="channel" type="string" required>
          Value: `executions`
        </ResponseField>

        <ResponseField name="token" type="string" required>
          Authentication token. See [authentication guide](/exchange/guides/websockets/authentication) for details.
        </ResponseField>
      </Expandable>
    </ResponseField>

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

  <Tab title="Response">
    <ResponseField name="method" type="string" required>
      Value: `unsubscribe`
    </ResponseField>

    <ResponseField name="result" type="object">
      <Expandable title="properties" defaultOpen>
        <ResponseField name="channel" type="string" required>
          Value: `executions`
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="success" type="boolean">
      Indicates if the request was successfully processed by the engine. One of: `true`, `false`
    </ResponseField>

    <ResponseField name="error" type="string">
      Error message. Condition: if `success` is `false`.
    </ResponseField>

    <ResponseField name="time_in" type="string">
      The timestamp when the subscription was received on the wire, just prior to parsing data. Format: RFC3339. Example: `2022-12-25T09:30:59.123456Z`
    </ResponseField>

    <ResponseField name="time_out" type="string">
      The timestamp when the acknowledgement was sent on the wire, just prior to transmitting data. Format: RFC3339. Example: `2022-12-25T09:30:59.123456Z`
    </ResponseField>

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

<Panel>
  <CodeGroup>
    ```json Subscribe Request theme={null}
    {
        "method": "subscribe",
        "params": {
            "channel": "executions",
            "token": "G38a1tGFzqGiUCmnegBcm8d4nfP3tytiNQz6tkCBYXY",
            "snap_orders": true,
            "snap_trades": true
        }
    }
    ```

    ```json Subscribe Response theme={null}
    {
        "method": "subscribe",
        "result": {
            "channel": "executions",
            "maxratecount": 125,
            "snap_orders": true,
            "snap_trades": true
        },
        "success": true,
        "time_in": "2023-10-16T13:18:35.303171Z",
        "time_out": "2023-10-16T13:18:35.318297Z"
    }
    ```
  </CodeGroup>

  <CodeGroup>
    ```json Pending theme={null}
    {
        "channel": "executions",
        "type": "update",
        "data": [
            {
                "order_id": "OK4GJX-KSTLS-7DZZO5",
                "order_userref": 3,
                "symbol": "BTC/USD",
                "order_qty": 0.005,
                "cum_cost": 0.0,
                "time_in_force": "GTC",
                "exec_type": "pending_new",
                "side": "sell",
                "order_type": "limit",
                "limit_price_type": "static",
                "limit_price": 26500.0,
                "stop_price": 0.0,
                "order_status": "pending_new",
                "fee_usd_equiv": 0.0,
                "fee_ccy_pref": "fciq",
                "timestamp": "2023-09-22T10:33:05.709950Z"
            }
        ],
        "sequence": 8
    }
    ```

    ```json Live Order theme={null}
    {
        "channel": "executions",
        "type": "update",
        "data": [
            {
                "timestamp": "2023-09-22T10:33:05.709982Z",
                "order_status": "new",
                "exec_type": "new",
                "order_userref": 3,
                "order_id": "OK4GJX-KSTLS-7DZZO5"
            }
        ],
        "sequence": 9
    }
    ```

    ```json Execution theme={null}
    {
        "channel": "executions",
        "type": "update",
        "data": [
            {
                "order_id": "OK4GJX-KSTLS-7DZZO5",
                "order_userref": 3,
                "exec_id": "TGBB7L-HT5LX-J3BZ4A",
                "exec_type": "trade",
                "trade_id": 62887576,
                "symbol": "BTC/USD",
                "side": "sell",
                "last_qty": 0.005,
                "last_price": 26599.9,
                "liquidity_ind": "t",
                "cost": 132.9995,
                "order_type": "limit",
                "timestamp": "2023-09-22T10:33:05.709993Z",
                "order_status": "partially_filled",
                "cum_qty": 0.005,
                "cum_cost": 132.9995,
                "avg_price": 26599.9,
                "fee_usd_equiv": 0.3458,
                "fees": [
                    {
                        "asset": "USD",
                        "qty": 0.3458
                    }
                ]
            }
        ],
        "sequence": 10
    }
    ```
  </CodeGroup>

  <CodeGroup>
    ```json Unsubscribe Request theme={null}
    {
        "method": "unsubscribe",
        "params": {
            "channel": "executions",
            "token": "G38a1tGFzqGiUCmnegBcm8d4nfP3tytiNQz6tkCBYXY"
        }
    }
    ```

    ```json Unsubscribe Response theme={null}
    {
        "method": "unsubscribe",
        "result": {
            "channel": "executions"
        },
        "success": true,
        "time_in": "2023-10-16T13:18:35.303171Z",
        "time_out": "2023-10-16T13:18:35.318297Z"
    }
    ```
  </CodeGroup>
</Panel>
