roq-kraken¶
Links¶
Supports¶
Spot |
✓ |
Futures |
|
Options |
|
Combos |
Reference Data |
✓ |
Market Status |
|
Top of Book |
✓ |
Market by Price |
✓ |
Market by Order |
|
Trade Summary |
✓ |
Statistics |
Create |
✓ |
Modify |
|
Cancel |
✓ |
Cancel All |
✓ |
Auto-Cancel |
✓ |
Positions |
✓ |
Funds |
✓ |
Installing¶
$ conda install \
--channel https://roq-trading.com/conda/stable \
roq-kraken
$ conda install \
--channel https://roq-trading.com/conda/unstable \
roq-kraken
Using¶
$ roq-kraken \
--name "kraken" \
--config_file $CONFIG_FILE_PATH \
--client_listen_address $UNIX_SOCKET_PATH \
--flagfile $ENVIRONMENT_FLAGFILE
Flags¶
$ roq-kraken --help
--exchange
(kraken
)Exchange identifier
--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
(false
)Allow price inversion?
Environments¶
$ $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
--ws_private_uri=wss://ws-auth.kraken.com
$ $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¶
$ $CONDA_PREFIX/share/roq-kraken/config.toml
Important
The template will be replaced when the software is upgraded. Make a copy and modify to your needs.
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¶
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Unavailable |
|||
Unavailable |
|||
MarketData |
spread |
||
MarketData |
book |
||
Unavailable |
|||
MarketData |
trade |
||
Not supported |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
/0/public/AssetPairs |
||
Statistics¶
Order Management¶
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
openOrders |
Not implemented |
|
DropCopy |
ownTrades |
Not implemented |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
addOrder |
Not implemented |
|
Unavailable |
|||
DropCopy |
cancelOrder |
Not implemented |
|
DropCopy |
cancelAll |
Not implemented |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
addOrder, cancelOrder |
Not implemented |
Order Types¶
TBD
Time in Force¶
TBD
Position Effect¶
TBD
Execution Instructions¶
TBD
Account Management¶
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
/0/private/OpenPositions |
Not implemented |
|
OrderEntry |
/0/private/Balance, /0/private/TradeBalance |
Not implemented |
Streams¶
Type |
Comments |
---|---|
REST |
Primary purpose
Each connection
The master account is used to
|
Type |
Comments |
---|---|
WebSocket |
Primary purpose
Each connection
|
Type |
Comments |
---|---|
WebSocket |
Primary purpose
Each connection
|
Constraints¶
Rate-limit usage is not communicated by the exchange
- 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.