Kraken Spot Trade Connector
Features
crypto-krakenConnector KeyNotes
Nonce Window
A nonce window allows API requests with a nonce slightly lower than the previously used value without returning an EAPI:Invalid nonce error.
The connector's nonce is time-based, in milliseconds.
See Why am I getting Invalid Nonce Errors?.
The API Key's Nonce Window must be set to 0.
Rate Limits
The Spot API rate limits are divided into three sections (public, private, trading) depending upon the API interface being used (REST or WebSocket) and the type of call that is being made (market data, account management, placing/cancelling orders).
The connector uses WebSocket API v1 to send place/cancel requests.
Minimum Order Sizes
https://support.kraken.com/hc/en-us/articles/205893708-What-is-the-minimum-order-size-
Margin Trading
Info about leverage and margin:
Ways to set leverage (last takes highest priority):
defaultLeverageconnector settingkrakenLeverageinstrument attribute6001custom attribute.
Cancel All Orders After
Kraken provides a "Dead Man's Switch" mechanism to protect the client from network malfunction, extreme latency or unexpected matching engine downtime. The client can send a request with a timeout (in seconds), that will start a countdown timer which will cancel all client orders when the timer expires.
Config block sample:
cancelAllOrdersAfter {
period = 30s
timeout = 60s
}
Self Match Prevention Instruction
When selfMatchPreventionInstruction setting is not defined or defined as DEFAULT, the exchange applies CANCEL_TAKING (cancel_newest) by default.
Symbology
Currency pairs in BASE/QUOTE format, e.g. XBT/USD, LTC/USD.
For the full list of available currency pairs, see the exchange GUI or query the REST API:
If symbols are specified with currency code prefixes, the exchange may return them without those prefixes, causing instrument lookup failures and unmatched orders.
Configuration
Connector settings
| Parameter | Default Value | Description |
|---|---|---|
| defaultLeverage | Leverage allows you to place trades larger than what you have in your collateral balances. | |
| webSocketRequestTimeout | 3m | After this time interval websocket request will be considered as lost. Decrease it carefully, can happen that order will be lost and discarded when it have not been created on exchange yet. |
| uncertainErrors | ["EService:Unavailable", "EGeneral:Internal error", "EService:Busy"] | List of uncertain errors. When one of them happened on submission, order will be marked as lost (else rejected). |
| deadline | 10s | Timestamp after which matching engine should reject new order request, in presence of latency or order queueing. min 5 seconds, max 90 seconds. Defaults to 90 seconds if not specified. |
| cancelAllOrdersAfter | not enabled | Has two settings: period, timeout. This feature can work like Cancel-On-Disconnect behavior. https://docs.kraken.com/websockets/#message-cancelAllOrdersAfter |
| selfMatchPreventionInstruction | DEFAULT | Optional setting for Self-Trade Prevention function. Supported values: DEFAULT, CANCEL_RESTING, CANCEL_TAKING, CANCEL_BOTH. |
| pingPeriod | 60s | Ping requests period. |
Supported order attributes
| Key | Description |
|---|---|
| 6001 | Leverage allows you to place trades larger than what you have in your collateral balances. |
| 18 | 6 value used for post only orders submission |
Config sample
connectors {
KRAKEN: ${template.connector.crypto.kraken} {
settings {
restUrl = "https://api.kraken.com"
websocketUrl = "wss://ws-auth.kraken.com"
apiKeys: [
{
apiKey = "<API_KEY>"
apiSecret = "<API_SECRET>"
}
]
}
}
}