roq-kraken

$ conda install \
      --channel https://roq-trading.com/conda/unstable \
      roq-kraken
$ conda install \
      --channel https://roq-trading.com/conda/stable \
      roq-kraken

Supports

Products

Spot

Futures

Swap

Option

Orders & Quotes
Account

Funds

Position

Note

✅ = Available.

❎ = Not implemented.

❌ = Unavailable.

❶ The exchange protocol does not support streaming updates for reference data and market status.

Using

$ roq-kraken [FLAGS]

Flags

$ roq-kraken --help
--exchange (kraken)

Exchange identifier

--ws_api (true)

Use WebSocket API?

--rest_uri (https://api.kraken.com)

Exchange end-point

--rest_proxy

Proxy end-point

--rest_ping_freq (5s)

Ping frequency

--rest_ping_path (/0/public/Time)

Ping path

--rest_request_timeout (30s)

Request timeout

--ws_public_uri (wss://beta-ws.kraken.com)

Exchange end-point

--ws_public_ping_freq (5s)

Ping frequency

--ws_public_request_timeout (15s)

Request timeout

--ws_public_subscribe_book_depth (10)

Book depth

--ws_public_max_subscriptions_per_stream (128)

Maximum number of symbols per connection

--ws_private_uri (wss://beta-ws-auth.kraken.com)

Exchange end-point

--ws_private_ping_freq (5s)

Ping frequency

--ws_private_request_timeout (15s)

Request timeout

--encode_buffer_size (1048576)

Encode buffer size

--decode_buffer_size (10485760)

Decode buffer size

--mbp_allow_price_inversion (true)

Allow price inversion?

Environments

$ --flagfile $CONDA_PREFIX/share/roq-kraken/flags/prod/flags.cfg
# flagfile for the roq-kraken gateway

--rest_uri=https://api.kraken.com
--ws_public_uri=wss://ws.kraken.com/v2
--ws_private_uri=wss://ws-auth.kraken.com/v2
$ --flagfile $CONDA_PREFIX/share/roq-kraken/flags/test/flags.cfg
# flagfile for the roq-kraken gateway

--rest_uri=https://beta-api.kraken.com
--ws_public_uri=wss://beta-ws.kraken.com
--ws_private_uri=wss://beta-ws-auth.kraken.com

Configuration

$ --config_file $CONDA_PREFIX/share/roq-kraken/config.toml

Important

This template will be replaced when the software is upgraded. Make a copy and modify to your own needs.

# config template for the roq-kraken gateway

symbols = [
  "^ETH/USD[A-Z]?$",
  "^XBT/USD[A-Z]?$"
]

[accounts]

  [accounts.A1]
  master = true
  login = "YOUR_KRAKEN_API_KEY_GOES_HERE"
  secret = "YOUR_KRAKEN_SECRET_GOES_HERE"
  symbols = [ ".*" ]

[users]

  [users.test]
  password = "1234"
  symbols = ".*"

  [users.trader]
  password = "secret"
  accounts = [ "A1" ]
  symbols = [ ".*BTC.*", ".*ETH.*" ]

[rate_limits]

  [rate_limits.global]
    type = "ORDER_ACTION"
    aggregate = true
    request_limit = 100
    monitor_period = "10s"
    ban_period = "5m"

Market Data

Inbound

Order Management

Inbound

Outbound

Comments

  • Choice prices appear to be allowed from book updates

  • Limited length of ClOrdId => we use HEX encoding and limit the fields we can download

  • Unsure how expensive it is to get snapshot of orders from WS

  • Issue with downloading open orders from REST (using pair which has different encoding than symbol)

  • Unresolved issue with wrong code:traded_quantity

References

Common

Exchange