roq-kraken-futures¶
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¶
$ mamba install \
--channel https://roq-trading.com/conda/stable \
roq-kraken-futures
$ mamba install \
--channel https://roq-trading.com/conda/unstable \
roq-kraken-futures
Using¶
$ roq-kraken-futures \
--name "kraken-futures" \
--config_file $CONFIG_FILE_PATH \
--client_listen_address $UNIX_SOCKET_PATH \
--flagfile $ENVIRONMENT_FLAGFILE
Flags¶
$ roq-kraken-futures --help
--exchange
(kraken-futures
)Exchange identifier
--rest_uri
(https://demo-futures.kraken.com/derivatives
)Exchange end-point
--rest_proxy
Proxy end-point
--rest_ping_freq
(5s
)Ping frequency
--rest_ping_path
(/api/v3/instruments
)Ping path
--rest_cancel_on_disconnect
(true
)Cancel orders on disconnect?
--rest_cancel_all_after
(30s
)Cancel all after, requires cancel-on-disconnect
--rest_request_timeout
(30s
)Request timeout
--rest_allow_order_request_pipeline
(false
)Allow more than one in-flight order action?
--rest_use_nonce
(true
)Use nonce for security?
--ws_uri
(wss://demo-futures.kraken.com/ws/v3
)Exchange end-point
--ws_ping_freq
(5s
)Ping frequency
--ws_request_timeout
(15s
)Request timeout
--ws_max_subscriptions_per_stream
(128
)Maximum number of symbols per connection
--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-futures/flags/prod/flags.cfg
# flagfile for the roq-kraken-futures gateway
--rest_uri=https://futures.kraken.com/derivatives/
--ws_uri=wss://futures.kraken.com/ws/v3
$ $CONDA_PREFIX/share/roq-kraken-futures/flags/test/flags.cfg
# flagfile for the roq-kraken-futures gateway
--rest_uri=https://demo-futures.kraken.com/derivatives/
--ws_uri=wss://demo-futures.kraken.com/ws/v3
Configuration¶
$ $CONDA_PREFIX/share/roq-kraken-futures/config.toml
Important
The template will be replaced when the software is upgraded. Make a copy and modify to your needs.
symbols = [
"^FI_ETHUSD_[0-9]{6}$", # futures
"^FI_XBTUSD_[0-9]{6}$", # futures
"^PF_ETHUSD$", # swaps
"^PF_XBTUSD$" # swaps
]
[accounts]
[accounts.A1]
master = true
login = "YOUR_KRAKEN_FUTURES_API_KEY_GOES_HERE"
secret = "YOUR_KRAKEN_FUTURES_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 |
---|---|---|---|
MarketData |
ticker |
||
MarketData |
ticker |
||
MarketData |
book |
||
Unavailable |
|||
MarketData |
trade |
||
MarketData |
ticker |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Rest |
instruments |
||
Statistics¶
Type |
Comments |
---|---|
|
(ticker) |
|
(ticker) |
|
(ticker) |
|
(ticker) |
Order Management¶
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
open_orders |
||
DropCopy |
fills |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
open_orders_snapshot |
||
DropCopy |
fills_snapshot |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
OrderEntry |
/api/v3/sendorder |
||
OrderEntry |
/api/v3/editorder |
||
OrderEntry |
/api/v3/cancelorder |
||
OrderEntry |
/api/v3/canceallorders |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Order Types¶
Type |
Comments |
---|---|
|
Mapped to |
|
Mapped to |
Time in Force¶
Type |
Comments |
---|---|
|
Mapped to |
|
Mapped to |
Position Effect¶
Note
Not supported
Execution Instructions¶
Type |
Comments |
---|---|
|
Mapped to |
Account Management¶
Event |
Stream |
Messages |
Comments |
---|---|---|---|
DropCopy |
open_positions |
||
DropCopy |
account_balances_and_margins |
Event |
Stream |
Messages |
Comments |
---|---|---|---|
Streams¶
Type |
Comments |
---|---|
REST |
Primary purpose
|
Type |
Comments |
---|---|
WebSocket |
Primary purpose
Each connection
|
Type |
Comments |
---|---|
REST |
Primary purpose
Each connection
|
Type |
Comments |
---|---|
WebSocket |
Primary purpose
Each connection
|
Constraints¶
The field
cliOrdId
is a string containing only web-safe characters.
Comments¶
Order updates has no information about last traded price/quantity and total average price
There is a race between REST (ack) and WebSocket (update) for order actions
Some uncertainty around edit/cancel order and execution response
Statistics are using relative funding rates to be compatible with other exchanges