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

# Unified WebSocket

> Reference for the Unified WebSocket API — Spot and Derivatives streaming over a single connection

> [!WARNING]
>
> **Availability**
>
> * **Spot is a work in progress, planned for Q1 2027.** Until then, the Unified
>   WebSocket supports Derivatives only (`asset_class: derivatives`).

The Kraken Unified WebSocket API provides real-time market data and
streaming order entry for both **Spot and Derivatives** markets through
a single WebSocket connection. Supported channels accept `asset_class` to select Spot or Derivatives
instruments. Channel availability depends on the asset class.

The Unified WebSocket uses the same v2 message format as the Spot
WebSocket v2, with normalised JSON objects, RFC 3339 timestamps, and
sequential trade IDs.

For connection details, ping/pong, and rate-limit behaviour, see the
[WebSocket overview](https://docs.kraken.com/exchange/guides/websockets/introduction.md).

## Endpoints

| Environment | Public | Private (auth) |
| :- | :- | :- |
| Primary | `wss://uws.kraken.com/v2/public` | `wss://uws.kraken.com/v2/private` |

## Authentication

Public channels need no authentication. Private channels and trading
require a **WebSocket token**, retrieved via the Spot REST endpoint
[`GetWebSocketsToken`](https://docs.kraken.com/api-reference/trading/get-websockets-token)
and sent in `params.token` on each private request. Request the token
with a Kraken API key that has the **Access WebSocket API** permission
(see [API key permissions](https://docs.kraken.com/exchange/guides/rest/api-keys.md)). This
applies to Derivatives too: Derivatives API keys and the Derivatives
WebSocket signed challenge are not used. Tokens are short-lived; obtain
a fresh token on each connection.

See [WebSocket
authentication](https://docs.kraken.com/exchange/guides/websockets/authentication.md) for the
full flow.

## Asset class selection

Subscription and order messages that apply to a market include an
`asset_class` field set to either `spot` or `derivatives`. This
determines which market the request applies to, allowing both markets
to be streamed and traded on the same connection.

> [!NOTE]
>
> `asset_class: spot` is planned for Q1 2027. Until then, use `derivatives`.

```json theme={null}
{
  "method": "subscribe",
  "params": {
    "channel": "book",
    "asset_class": "spot",
    "symbol": ["BTC/USD"]
  }
}
```

`book`, `trade`, and `executions` accept `spot` or `derivatives`. Other
market-specific channels currently accept only `derivatives`.

The account-wide
[`balances`](https://docs.kraken.com/exchange/api-reference/unified-ws/balances) and
[`ledgers`](https://docs.kraken.com/exchange/api-reference/unified-ws/ledgers) channels cover
every asset class at once, so they reject `asset_class` rather than
accepting it. The account-wide
[`preferences`](https://docs.kraken.com/exchange/api-reference/unified-ws/preferences) channel does not
require `asset_class`.

## Quick start

> [card] [book (L2)](https://docs.kraken.com/exchange/api-reference/unified-ws/book.md)
>
> Order book snapshots + incremental updates with CRC32 checksums.

> [card] [executions](https://docs.kraken.com/exchange/api-reference/unified-ws/executions.md)
>
> Private order acks, fills, and amends — the canonical order-state stream.

> [card] [add\_order](https://docs.kraken.com/exchange/api-reference/unified-ws/add_order.md)
>
> Place a Spot or Derivatives order over the open connection.

> [card] [ticker](https://docs.kraken.com/exchange/api-reference/unified-ws/ticker.md)
>
> Level 1 market data — top of book and recent trade summary.

The complete channel catalog (book, level3, ticker, trade, ohlc,
instrument, rfqs, status, heartbeat, executions, balances, ledgers,
margin, positions, preferences, quotes, add\_order, amend\_order, cancel\_order,
cancel\_all, cancel\_all\_orders\_after, batch\_add, batch\_cancel, set\_preference, ping) is available under the
**Unified WebSocket** dropdown in the left navigation.

## Connection management

Send a `ping` at least every 60 seconds. On reconnect, resubscribe to
each channel and reconcile state — the
[reconnection guide](https://docs.kraken.com/exchange/guides/websockets/reconnection.md) walks
through resubscription, sequence handling, and book recovery.

## Related

> [card] [WebSocket overview](https://docs.kraken.com/exchange/guides/websockets/introduction.md)
>
> Connection details, ping/pong, beta endpoints.

> [card] [WebSocket authentication](https://docs.kraken.com/exchange/guides/websockets/authentication.md)
>
> How to request a WebSocket token with your API key.

> [card] [Book checksum (v2)](https://docs.kraken.com/exchange/guides/websockets/book-checksum-v2.md)
>
> Validate book consistency after every update.

> [card] [L3 checksum (v2)](https://docs.kraken.com/exchange/guides/websockets/l3-checksum-v2.md)
>
> L3 order-by-order checksum logic.

> [card] [Reconnection](https://docs.kraken.com/exchange/guides/websockets/reconnection.md)
>
> Disconnect handling and resubscribe.

> [card] [Choose your protocol](https://docs.kraken.com/exchange/guides/general/api-comparison.md)
>
> WebSocket vs FIX vs REST trade-offs.
