Kraken

roq-kraken

Environments

Production

Option

Value

Type

Comment(s)

--rest-uri

https://api.kraken.com

REST

Cloudflare

--ws-public-uri

wss://ws.kraken.com

WebSocket

Cloudflare

--ws-private-uri

wss://ws-auth.kraken.com

WebSocket

Cloudflare

Data center

To be confirmed

Test

Warning

Beta environment to test new API’s

Option

Value

Type

Comment(s)

--rest-uri

https://beta-api.kraken.com

REST

Cloudflare

--ws-public-uri

wss://beta-ws.kraken.com

WebSocket

Cloudflare

--ws-private-uri

wss://beta-ws-auth.kraken.com

WebSocket

Cloudflare

Data center

To be confirmed

Installation

Conda

Install

conda install -y roq-kraken

Configuration

cp $CONDA_PREFIX/share/roq/kraken/config.toml $CONFIG_FILE_PATH

# then modify $CONFIG_FILE_PATH to match your specific configuration

Using

roq-kraken \
      --name "kraken" \
      --config-file "$CONFIG_FILE_PATH" \
      --client-listen-address "$UNIX_SOCKET_PATH" \
      --metrics-listen-address "$TCP_LISTEN_PORT" \
      --rest-uri "$REST_URI" \
      --ws-public-uri "$WS_PUBLIC_URI" \
      --ws-private-uri "$WS_PRIVATE_URI"

Flags

Only notable flags are mentioned here. Please refer to roq-kraken --help for all flags.

--book-depth

Maximum order book depth. The exchange will limit order book updates to this depth. Please refer to Kraken Websockets API for further details.

Ansible

Add your host to the roq_kraken group

[roq_kraken]
MY_SERVER

Docker

docker pull roqtrading/roq-kraken

Implementation

Restrictions

Order book ends up in bad state

Downtime (scheduled or not) appears to not shutdown existing connections nor are established subscriptions unsubscribed. Worse, during downtime, what appears to be uninitialized order book data can be disseminated. (This was confirmed with Kraken support early May 2020).

Warning

We currently have no means to detect bad order book updates. At best, a parse exception will terminate your gateway with an unhandled excpetion.

Incoming Events

Event

Connection

Message(s)

Comment(s)

ReferenceData

REST

public/AssetPairs

MarketStatus

Not available

TopOfBook

WS_PUBLIC

spread

MarketByPrice

WS_PUBLIC

book

MarketByOrder

Not available

TradeSummary

WS_PUBLIC

trade

SessionStatistics

Not supported

DailyStatistics

Not supported

OrderAck

WS_PRIVATE

addOrder, cancelOrder

Not implemented

OrderUpdate

WS_PRIVATE

openOrders

Not implemented

TradeUpdate

WS_PRIVATE

ownTrades

Not implemented

PositionUpdate

REST

private/OpenPositions

Not implemented

FundsUpdate

REST

private/Balance, private/TradeBalance

Not implemented

Outgoing Events

Event

Connection

Message(s)

Comment(s)

CreateOrder

WS_PRIVATE

addOrder

Not implemented

ModifyOrder

Not available

CancelOrder

WS_PRIVATE

cancelOrder

Not implemented