Skip to main content

Kraken Spot Trade Connector

Features

crypto-krakenConnector Key
Instruments
FX
Request Types
SUBMITCANCEL
Order Types
MARKETLIMIT
Time In Force
IOCFOKGTCGTD
Order ID Mapper
COMPOSITE
Order Status Request
Cancel On Disconnect
Commission
Post Only
Fast Cancel
Fast Replace

Notes

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?.

note

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):

  • defaultLeverage connector setting
  • krakenLeverage instrument attribute
  • 6001 custom 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:

warning

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

ParameterDefault ValueDescription
defaultLeverageLeverage allows you to place trades larger than what you have in your collateral balances.
webSocketRequestTimeout3mAfter 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).
deadline10sTimestamp 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.
cancelAllOrdersAfternot enabledHas two settings: period, timeout. This feature can work like Cancel-On-Disconnect behavior. https://docs.kraken.com/websockets/#message-cancelAllOrdersAfter
selfMatchPreventionInstructionDEFAULTOptional setting for Self-Trade Prevention function. Supported values: DEFAULT, CANCEL_RESTING, CANCEL_TAKING, CANCEL_BOTH.
pingPeriod60sPing requests period.

Supported order attributes

KeyDescription
6001Leverage allows you to place trades larger than what you have in your collateral balances.
186 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>"
}
]
}
}
}