Kraken WebSocket API

Subscribe to Kraken v2 public channels (ticker, book, trade, ohlc, spread) and authenticated private channels (openOrders, ownTrades) from a typed Delphi component.

TsgcWSAPI_Kraken

Kraken WebSocket v2 client — ticker, book, trade, ohlc and spread channels plus signed openOrders / ownTrades private streams.

Component class

TsgcWSAPI_Kraken

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Standard / Professional / Enterprise

Drop the component, set keys, subscribe

Pair with a TsgcWebSocketClient, fetch a WebSocket token if you need private channels, then subscribe to public or authenticated streams.

uses
  sgcWebSocket, sgcWebSocket_API_Kraken;

var
  WSClient: TsgcWebSocketClient;
  Kraken: TsgcWSAPI_Kraken;
begin
  WSClient := TsgcWebSocketClient.Create(nil);

  Kraken := TsgcWSAPI_Kraken.Create(nil);
  Kraken.Client := WSClient;
  Kraken.Kraken.ApiKey    := 'your-api-key';
  Kraken.Kraken.ApiSecret := 'your-api-secret';

  WSClient.Active := True;

  Kraken.SubscribeTicker(['XBT/USD']);
  Kraken.SubscribeBook(['XBT/USD'], 25);
  Kraken.SubscribeTrade(['XBT/USD']);
end;
// uses: sgcWebSocket, sgcWebSocket_API_Kraken
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_Kraken *Kraken = new TsgcWSAPI_Kraken(this);
Kraken->Client = WSClient;

WSClient->Active = true;
Kraken->SubscribeTicker(OPENARRAY(UnicodeString, ("XBT/USD")));
Kraken->SubscribeBook(OPENARRAY(UnicodeString, ("XBT/USD")), 25);

What's inside

Per-symbol ticker, book deltas, ohlc, spread and trade streams, plus the signed openOrders / ownTrades channels.

v2 public channels

SubscribeTicker, SubscribeBook, SubscribeTrade, SubscribeOHLC, SubscribeSpread and SubscribeInstrument cover every Kraken WebSocket v2 public channel.

Private channels

SubscribeOpenOrders, SubscribeOwnTrades, SubscribeBalances open authenticated streams — the component obtains the WebSocket token via the signed REST call automatically.

Multi-pair arrays

Every subscribe call accepts an array of symbols so one connection multiplexes any number of pairs.

Order management

The v2 RPC verbs (add_order, cancel_order, cancel_all, edit_order, batch_add, batch_cancel) are exposed as typed methods.

Snapshot then deltas

Book subscriptions deliver an initial snapshot followed by incremental updates — ideal for maintaining a synchronised local order book.

Sequence numbers

Kraken v2 messages carry a sequence_num inside the relevant channels — the component watches for gaps and signals via OnException if resubscription is needed.

Specifications & references

Authoritative sources for the APIs this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Online Help — API_Kraken Full property, method and event reference for this component.
Demo Project — Demos\05.Crypto\08.Kraken Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.

Ready to Trade on Kraken?

Download the free trial and stream Kraken market data and account events from Delphi.