Skip to main content

Documentation Index

Fetch the complete documentation index at: https://kraken-sandbox.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Endpoint

wss://futures.kraken.com/ws/v1

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

FieldValue
challengec100b894-1729-464d-ace1-52dbce11db42
api_secret7zxMEF5p/Z8l2p2U7Ghv6x14Af+Fx+92tPgUdVQ748FOIrEoT9bgT+bTRfXc5pz8na+hL/QdrCVG7bh9KpT0eMTm
signed_challenge4JEpF3ix66GA2B+ooK128Ift4XQVtc137N9yeg4Kqsn9PI0Kpzbysl9M1IeCEdjg0zl00wkVqcsnG4bmnlMb3A==
The challenge is a UUID string.

Subscribe request

{
  "event": "subscribe",
  "feed": "ticker",
  "product_ids": [
    "PI_XBTUSD",
    "FI_ETHUSD_210625"
  ]
}
For private feeds, include the challenge fields:
{
  "event": "subscribe",
  "feed": "open_orders",
  "api_key": "<your_api_key>",
  "original_challenge": "<challenge>",
  "signed_challenge": "<signed_challenge>"
}