Skip to main content
Derivatives WebSocket is being deprecated. For new integrations, use the Unified WebSocket, which streams Spot and Derivatives over a single connection. Existing integrations continue to work until 1 March 2027, when the Derivatives WebSocket will no longer be available. Migrate to the Unified WebSocket before then.To use private channels or trade on the Unified WebSocket, you need a Kraken API key, not a Derivatives API key. Use it to get a token from GetWebSocketsToken. See Unified WebSocket authentication.

Deprecation and Unified WebSocket

The Derivatives WebSocket (wss://futures.kraken.com/ws/v1) is being deprecated. Existing integrations continue to work until 1 March 2027, when the Derivatives WebSocket will no longer be available. Migrate to the Unified WebSocket before then. If you are starting a new integration, use the Unified WebSocket. It covers Spot and Derivatives over a single connection. You choose the market by setting asset_class to derivatives on each subscription or order message.

Connect to the Unified WebSocket

Public channels, such as ticker and book, need no authentication. Connect to wss://uws.kraken.com/v2/public and subscribe. Private channels and trading use a WebSocket token instead of the signed challenge:
  1. Create a Kraken API key at Settings → API, with the Access WebSocket API permission and the permissions your integration needs. Derivatives API keys do not work with the Unified WebSocket. See API key permissions.
  2. Call the Spot REST endpoint GetWebSocketsToken with that key. Tokens are short-lived, so get a fresh one for each connection.
  3. Connect to wss://uws.kraken.com/v2/private and send the token in params.token on each private subscription and trading request.
See WebSocket authentication for code examples of the token request. Example of subscribing to a Derivatives ticker on the Unified WebSocket:
The rest of this page describes the Derivatives WebSocket.

Endpoint

Keeping the connection alive

Send a ping request at least every 60 seconds to keep the connection open. See the sample implementation for reference.

Snapshots and updates

Most feeds send a snapshot of the current state first, followed by real-time incremental updates.

Authentication

Private feeds require a signed challenge. The process:
  1. Connect to the WebSocket endpoint.
  2. Send a request to obtain a challenge (using your api_key).
  3. Sign the challenge with your api_secret (see Sign challenge below).
  4. Include both original_challenge and signed_challenge in every subscribe/unsubscribe message for private feeds.

Sign challenge

Signing steps

Given a challenge string:
  1. Hash the challenge with SHA-256
  2. Base64-decode your api_secret
  3. Hash the result of step 1 with the result of step 2 using HMAC-SHA-512
  4. Base64-encode the result of step 3
The result of step 4 is the signed_challenge.

Example

The challenge is a UUID string.

Subscribe request

For private feeds, include the challenge fields: