Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
AscendEx
Backpack
BigONE
Binance
Bitfinex
bitFlyer
Bitget
Bithumb
Bitstamp
Bybit
Coincheck
Coinone
CoinW
Crypto.com
DeepCoin
Deribit
DigiFinex
Gate
Gemini
HashKey
HitBTC
HTX
Korbit
Kraken
KuCoin
LBank
MEXC
OKX
Poloniex
Upbit
WEEX
WOO X
Zaif
Decentralized Exchanges (DEX)
Prediction Markets
Securities and Futures
On-chain & Custom

Kraken (Spot): Kraken spot trading (Kraken REST API https://api.kraken.com), accessed with a Kraken API Key and Secret Key. The account is the Kraken spot balance, with the available amount being the balance minus what open orders hold; Kraken Futures is a separate exchange object, Futures_Kraken.

Futures_Kraken (Futures): Kraken Futures (Kraken Futures API https://futures.kraken.com): inverse (coin-margined) perpetual and delivery contracts, multi-collateral (linear) perpetual and delivery contracts, and Kraken Futures options. Access uses a Kraken Futures API Key and Secret Key; Kraken spot is a separate exchange object, Kraken.

Names and Configuration
exchange.GetName()TypeAliases
KrakenSpot—
Futures_KrakenFuturesKraken Futures
FieldRequired
--
Access KeyYes
Secret KeyYes

Trading Pairs and Contract Codes
Kraken (Spot)

Pair examples: BTC_USD, ETH_USDT, BTC_EUR

Trading pairs are written BASE_QUOTE. Kraken writes BTC as XBT and DOGE as XDG; use BTC and DOGE in trading pairs (XBT_USD also works), and returned symbols always use BTC and DOGE.

Futures_Kraken (Futures)

Pair examples: BTC_USD, ETH_USD

Trading pairs look like BTC_USD; the contract code selects the contract type: codes without a suffix are inverse contracts (Kraken PI_, FI_), codes with the _pf or _ff suffix are multi-collateral contracts (PF_, FF_). Kraken contract codes write BTC as XBT; use BTC in the trading pair, and returned symbols always use BTC.

Contract codeDescription
swapInverse perpetual contract (the default).
monthThe nearest-expiry inverse delivery contract.
this_weekSame as month; written as month in exchange.GetMarkets and query results.
quarterInverse quarterly contract (the nearest one expiring in March, June, September or December).
next_quarterInverse next-quarter contract.
third_quarterInverse third-quarter contract.
swap_pfMulti-collateral perpetual contract.
month_ffThe nearest-expiry multi-collateral delivery contract.
this_week_ffSame as month_ff; written as month_ff in exchange.GetMarkets and query results.
quarter_ffMulti-collateral quarterly contract.
next_quarter_ffMulti-collateral next-quarter contract.
third_quarter_ffMulti-collateral third-quarter contract.

Kraken lists monthly and quarterly delivery contracts only; this_week and month both mean the nearest expiry. Delivery contracts are picked by expiry from the exchange's contract list. When one contract belongs to several tiers (the nearest quarterly contract is also month, for example), exchange.GetMarkets and the symbols of tickers, positions and orders use only one of them, with the quarter tiers ahead of month; a delivery contract outside every tier uses its native code as the contract code (such as BTC_USD.FF_XBTUSD_261030). Each contract appears once in exchange.GetMarkets. Positions and open orders can be queried with the ranges USD.swap_pf (multi-collateral perpetuals) and USD.futures_ff (multi-collateral delivery).

Native contract code examples: FF_ETHUSD_250307, PF_XBTUSD

Contracts can be given by their Kraken native codes: delivery contracts (prefixes FI_, FF_) such as ETH_USD.FF_ETHUSD_250307, perpetuals (prefixes PI_, PF_) such as BTC_USD.PF_XBTUSD. exchange.SetContractType() also accepts the native codes of the current pair (including delivery contracts that belong to a tier and appear under the tier code in exchange.GetMarkets), for example exchange.SetContractType("PF_XBTUSD") with pair BTC_USD.

Exchange-specific IO Commands
Kraken (Spot)

No exchange-specific commands; for the common commands see exchange.IO.

Futures_Kraken (Futures)
CommandArgumentsDescriptionReturns
crossbool[, symbol]Cross (true) / isolated (false) margin, multi-collateral contracts only. Switching to isolated sets the leverage limit to 10x; change it afterwards with exchange.SetMarginLevel().Null also on success; check GetLastError() afterwards when needed.

For the common commands api, base and currency see exchange.IO.

Function Support
All exchange objects

No unsupported standard functions.

Kraken (Spot)

Served through a fallback:

  • exchange.GetRecords: Native periods are 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w, 15d; other periods are synthesized by the docker.
Futures_Kraken (Futures)

Served through a fallback:

  • exchange.GetRecords: Native periods are 1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w; other periods are synthesized by the docker.

Margin, Account and Simulation
Futures_Kraken (Futures)

Margin mode: Only multi-collateral contracts (swap_pf, *_ff) can switch cross/isolated margin and set leverage; for inverse contracts and options exchange.IO("cross", ...) and exchange.SetMarginLevel() fail. Kraken expresses the margin mode through leverage preferences: exchange.SetMarginLevel() sets the leverage limit and also switches the contract to isolated margin, while exchange.IO("cross", true) removes the limit and returns to cross margin.

Position mode: The connector has no position-mode setting; exchange.IO("dual", ...) fails.

Account: Inverse contracts use their own single-currency wallets, and the Stocks of exchange.GetAccount() is that wallet's available coin amount; multi-collateral contracts and options use the multi-collateral wallet, where Balance is the available margin in USD.

Options
Futures_Kraken (Futures)

Kraken Futures options are supported. Limitations:

  • Kraken has no option listing endpoint, so exchange.GetMarkets() does not include option contracts; get the option codes from the Kraken website.
  • In exchange.GetTicker(), Last is the mark price when the contract has no last trade price, and Buy, Sell, High and Low are 0 when nobody is quoting; the raw data in Info carries the implied volatility, the greeks and other fields.
  • Options have no funding rate, and exchange.SetMarginLevel() and margin-mode switching are not supported.

Option code examples: OF_ETHUSD_261225_4000_C, OF_XBTUSD_261225_100000_P

Option codes are Kraken native codes: OF_, underlying and quote currency, expiry (YYMMDD), strike, C/P, C for a call and P for a put. The underlying and quote currency in the code must match the trading pair, with BTC written as XBT; the full symbol looks like ETH_USD.OF_ETHUSD_261225_4000_C.

Notes
Kraken (Spot)
  • The amount of a spot market buy order is in the base currency (Kraken's volume), not a quote-currency amount.
  • Conditional orders support take-profit and stop-loss only, not OCO.
  • Orders support tif IOC and maker-only (postOnly, limit prices only); FOK is not supported and reports an error.
  • exchange.ModifyOrder() and exchange.ModifyConditionOrder() are supported; both amend the order in place on Kraken and keep the order ID. Regular orders can change price and amount; conditional orders can change the trigger price, order price and amount.
  • exchange.GetOrders() and exchange.GetConditionOrders() without arguments return the open orders of all trading pairs. exchange.GetHistoryOrders() and exchange.GetHistoryConditionOrders() return the latest 50 records when limit is not given, and page automatically to fill a larger limit.
Futures_Kraken (Futures)
  • Order amounts are Kraken contract sizes: one inverse contract is 1 USD, multi-collateral contracts are sized in the underlying coin (see CtVal and CtValCcy in exchange.GetMarkets).
  • Kraken's raw funding rate is an absolute amount per contract; exchange.GetFundings() converts it to a relative rate. Perpetuals settle funding every hour.
  • Conditional orders support take-profit and stop-loss only, not OCO; they trigger on the last traded price.
  • Limit orders support tif IOC and maker-only (postOnly), but not FOK; market orders do not support FOK or maker-only, and conditional orders support neither tif nor maker-only; passing them reports an error.
  • exchange.ModifyOrder() and exchange.ModifyConditionOrder() are supported (Kraken's edit-order endpoint); conditional orders can change the trigger price, order price and amount.