CCXT

kraken

kraken cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.

kraken

Kind: global class
Extends: Exchange

kraken

Set rateLimit to 1000 if fully verified

kraken.kraken ()

fetchMarkets

retrieves data on all markets for kraken

Kind: instance method of kraken
Returns: Array<object> - an array of objects representing market data

See: https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getTradableAssetPairs

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchMarkets (params?)

fetchStatus

the latest known information on the availability of the exchange API

Kind: instance method of kraken
Returns: object - a status structure

See: https://docs.kraken.com/api/docs/rest-api/get-system-status/

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchStatus (params?)

fetchCurrencies

fetches all available currencies on an exchange

Kind: instance method of kraken
Returns: object - an associative dictionary of currencies

See: https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getAssetInfo

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchCurrencies (params?)

fetchTradingFee

fetch the trading fees for a market

Kind: instance method of kraken
Returns: object - a fee structure

See: https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradeVolume

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchTradingFee (symbol, params?)

fetchOrderBook

fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of kraken
Returns: object - A dictionary of order book structures indexed by market symbols

See: https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getOrderBook

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchOrderBook (symbol, limit?, params?)

fetchTickers

fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market

Kind: instance method of kraken
Returns: object - a dictionary of ticker structures

See: https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getTickerInformation

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYesunified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchTickers (symbols, params?)

fetchTicker

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of kraken
Returns: object - a ticker structure

See: https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getTickerInformation

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchTicker (symbol, params?)

fetchOHLCV

fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of kraken
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://docs.kraken.com/api/docs/rest-api/get-ohlc-data

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
kraken.fetchOHLCV (symbol, timeframe, since?, limit?, params?)

fetchLedger

fetch the history of changes, actions done by the user or operations that altered the balance of the user

Kind: instance method of kraken
Returns: object - a ledger structure

See: https://docs.kraken.com/rest/#tag/Account-Data/operation/getLedgers

ParamTypeRequiredDescription
codestringNounified currency code, default is undefined
sinceintNotimestamp in ms of the earliest ledger entry, default is undefined
limitintNomax number of ledger entries to return, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest ledger entry
params.endintNotimestamp in seconds of the latest ledger entry
kraken.fetchLedger (code?, since?, limit?, params?)

fetchTrades

get the list of most recent trades for a particular symbol

Kind: instance method of kraken
Returns: Array<Trade> - a list of trade structures

See: https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getRecentTrades

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchTrades (symbol, since?, limit?, params?)

fetchBalance

query for balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of kraken
Returns: object - a balance structure

See: https://docs.kraken.com/rest/#tag/Account-Data/operation/getExtendedBalance

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchBalance (params?)

createMarketOrderWithCost

create a market order by providing the symbol, side and cost

Kind: instance method of kraken
Returns: object - an order structure

See: https://docs.kraken.com/rest/#tag/Spot-Trading/operation/addOrder

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in (only USD markets are supported)
sidestringYes'buy' or 'sell'
costfloatYeshow much you want to trade in units of the quote currency
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.createMarketOrderWithCost (symbol, side, cost, params?)

createMarketBuyOrderWithCost

create a market buy order by providing the symbol, side and cost

Kind: instance method of kraken
Returns: object - an order structure

See: https://docs.kraken.com/rest/#tag/Spot-Trading/operation/addOrder

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
costfloatYeshow much you want to trade in units of the quote currency
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.createMarketBuyOrderWithCost (symbol, cost, params?)

createOrder

create a trade order

Kind: instance method of kraken
Returns: object - an order structure

See: https://docs.kraken.com/api/docs/rest-api/add-order

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.postOnlyboolNoif true, the order will only be posted to the order book and not executed immediately
params.reduceOnlyboolNomargin only indicates if this order is to reduce the size of a position
params.stopLossPricefloatNomargin only the price that a stop loss order is triggered at
params.takeProfitPricefloatNomargin only the price that a take profit order is triggered at
params.trailingAmountstringNomargin only the quote amount to trail away from the current market price
params.trailingPercentstringNomargin only the percent to trail away from the current market price
params.trailingLimitAmountstringNomargin only the quote amount away from the trailingAmount
params.trailingLimitPercentstringNomargin only the percent away from the trailingAmount
params.offsetstringNomargin only '+' or '-' whether you want the trailingLimitAmount value to be positive or negative, default is negative '-'
params.triggerstringNomargin only the activation price type, 'last' or 'index', default is 'last'
kraken.createOrder (symbol, type, side, amount, price?, params?)

createOrders

create a list of trade orders

Kind: instance method of kraken
Returns: object - an order structure

See: https://docs.kraken.com/api/docs/rest-api/add-order-batch/

ParamTypeRequiredDescription
ordersArrayYeslist of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.createOrders (orders, params?)

editOrder

edit a trade order

Kind: instance method of kraken
Returns: object - an order structure

See: https://docs.kraken.com/api/docs/rest-api/amend-order

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatNohow much of the currency you want to trade in units of the base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.stopLossPricefloatNothe price that a stop loss order is triggered at
params.takeProfitPricefloatNothe price that a take profit order is triggered at
params.trailingAmountstringNothe quote amount to trail away from the current market price
params.trailingPercentstringNothe percent to trail away from the current market price
params.trailingLimitAmountstringNothe quote amount away from the trailingAmount
params.trailingLimitPercentstringNothe percent away from the trailingAmount
params.offsetstringNo'+' or '-' whether you want the trailingLimitAmount value to be positive or negative
params.postOnlybooleanNoif true, the order will only be posted to the order book and not executed immediately
params.clientOrderIdstringNothe orders client order id
kraken.editOrder (id, symbol, type, side, amount?, price?, params?)

fetchOrder

fetches information on an order made by the user

Kind: instance method of kraken
Returns: object - An order structure

See: https://docs.kraken.com/rest/#tag/Account-Data/operation/getOrdersInfo

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesnot used by kraken fetchOrder
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchOrder (id, symbol, params?)

fetchOrderTrades

fetch all the trades made from a single order

Kind: instance method of kraken
Returns: Array<object> - a list of trade structures

See: https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradesInfo

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchOrderTrades (id, symbol, since?, limit?, params?)

fetchOrdersByIds

fetch orders by the list of order id

Kind: instance method of kraken
Returns: Array<object> - a list of order structure

See: https://docs.kraken.com/rest/#tag/Account-Data/operation/getClosedOrders

ParamTypeRequiredDescription
idsArray<string>Nolist of order id
symbolstringNounified ccxt market symbol
paramsobjectNoextra parameters specific to the kraken api endpoint
kraken.fetchOrdersByIds (ids?, symbol?, params?)

fetchMyTrades

fetch all trades made by the user

Kind: instance method of kraken
Returns: Array<Trade> - a list of trade structures

See: https://docs.kraken.com/api/docs/rest-api/get-trade-history

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest trade entry
params.endintNotimestamp in seconds of the latest trade entry
kraken.fetchMyTrades (symbol, since?, limit?, params?)

cancelOrder

cancels an open order

Kind: instance method of kraken
Returns: object - an order structure

See: https://docs.kraken.com/api/docs/rest-api/cancel-order

ParamTypeRequiredDescription
idstringYesorder id
symbolstringNounified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdstringNothe orders client order id
params.userrefintNothe orders user reference id
kraken.cancelOrder (id, symbol?, params?)

cancelOrders

cancel multiple orders

Kind: instance method of kraken
Returns: object - an list of order structures

See: https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelOrderBatch

ParamTypeRequiredDescription
idsArray<string>Yesopen orders transaction ID (txid) or user reference (userref)
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.cancelOrders (ids, symbol, params?)

cancelAllOrders

cancel all open orders

Kind: instance method of kraken
Returns: Array<object> - a list of order structures

See: https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelAllOrders

ParamTypeRequiredDescription
symbolstringYesunified market symbol, not used by kraken cancelAllOrders (all open orders are cancelled)
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.cancelAllOrders (symbol, params?)

cancelAllOrdersAfter

dead man's switch, cancel all orders after the given timeout

Kind: instance method of kraken
Returns: object - the api result

See: https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelAllOrdersAfter

ParamTypeRequiredDescription
timeoutnumberYestime in milliseconds, 0 represents cancel the timer
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.cancelAllOrdersAfter (timeout, params?)

fetchOpenOrders

fetch all unfilled currently open orders

Kind: instance method of kraken
Returns: Array<Order> - a list of order structures

See: https://docs.kraken.com/api/docs/rest-api/get-open-orders

ParamTypeRequiredDescription
symbolstringNounified market symbol
sinceintNothe earliest time in ms to fetch open orders for
limitintNothe maximum number of open orders structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdstringNothe orders client order id
params.userrefintNothe orders user reference id
kraken.fetchOpenOrders (symbol?, since?, limit?, params?)

fetchClosedOrders

fetches information on multiple closed orders made by the user

Kind: instance method of kraken
Returns: Array<Order> - a list of order structures

See: https://docs.kraken.com/api/docs/rest-api/get-closed-orders

ParamTypeRequiredDescription
symbolstringNounified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest entry
params.clientOrderIdstringNothe orders client order id
params.userrefintNothe orders user reference id
kraken.fetchClosedOrders (symbol?, since?, limit?, params?)

fetchDeposits

fetch all deposits made to an account

Kind: instance method of kraken
Returns: Array<object> - a list of transaction structures

See: https://docs.kraken.com/rest/#tag/Funding/operation/getStatusRecentDeposits

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch deposits for
limitintNothe maximum number of deposits structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest transaction entry
params.endintNotimestamp in seconds of the latest transaction entry
kraken.fetchDeposits (code, since?, limit?, params?)

fetchTime

fetches the current integer timestamp in milliseconds from the exchange server

Kind: instance method of kraken
Returns: int - the current integer timestamp in milliseconds from the exchange server

See: https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getServerTime

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchTime (params?)

fetchWithdrawals

fetch all withdrawals made from an account

Kind: instance method of kraken
Returns: Array<object> - a list of transaction structures

See: https://docs.kraken.com/rest/#tag/Funding/operation/getStatusRecentWithdrawals

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch withdrawals for
limitintNothe maximum number of withdrawals structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest transaction entry
params.endintNotimestamp in seconds of the latest transaction entry
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times
kraken.fetchWithdrawals (code, since?, limit?, params?)

createDepositAddress

create a currency deposit address

Kind: instance method of kraken
Returns: object - an address structure

See: https://docs.kraken.com/rest/#tag/Funding/operation/getDepositAddresses

ParamTypeRequiredDescription
codestringYesunified currency code of the currency for the deposit address
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.createDepositAddress (code, params?)

fetchDepositMethods

fetch deposit methods for a currency associated with this account

Kind: instance method of kraken
Returns: object - of deposit methods

See: https://docs.kraken.com/rest/#tag/Funding/operation/getDepositMethods

ParamTypeRequiredDescription
codestringYesunified currency code
paramsobjectNoextra parameters specific to the kraken api endpoint
kraken.fetchDepositMethods (code, params?)

fetchDepositAddress

fetch the deposit address for a currency associated with this account

Kind: instance method of kraken
Returns: object - an address structure

See: https://docs.kraken.com/rest/#tag/Funding/operation/getDepositAddresses

ParamTypeRequiredDescription
codestringYesunified currency code
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchDepositAddress (code, params?)

withdraw

make a withdrawal

Kind: instance method of kraken
Returns: object - a transaction structure

See: https://docs.kraken.com/rest/#tag/Funding/operation/withdrawFunds

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesthe amount to withdraw
addressstringYesthe address to withdraw to, not required can be '' or undefined/none/null
tagstringYes
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.withdraw (code, amount, address, tag, params?)

fetchPositions

fetch all open positions

Kind: instance method of kraken
Returns: Array<object> - a list of position structure

See: https://docs.kraken.com/rest/#tag/Account-Data/operation/getOpenPositions

ParamTypeRequiredDescription
symbolsArray<string>Nonot used by kraken fetchPositions ()
paramsobjectNoextra parameters specific to the exchange API endpoint
kraken.fetchPositions (symbols?, params?)

transferOut

transfer from spot wallet to futures wallet

Kind: instance method of kraken
Returns: a transfer structure

See: https://docs.kraken.com/rest/#tag/User-Funding/operation/walletTransfer

ParamTypeRequiredDescription
codestrYesUnified currency code
amountfloatYesSize of the transfer
paramsdictNoExchange specific parameters
kraken.transferOut (code, amount, params?)

transfer

transfers currencies between sub-accounts (only spot->swap direction is supported)

Kind: instance method of kraken
Returns: a transfer structure

See: https://docs.kraken.com/rest/#tag/User-Funding/operation/walletTransfer

ParamTypeRequiredDescription
codestringYesUnified currency code
amountfloatYesSize of the transfer
fromAccountstringYes'spot' or 'Spot Wallet'
toAccountstringYes'swap' or 'Futures Wallet'
paramsobjectNoExchange specific parameters
kraken.transfer (code, amount, fromAccount, toAccount, params?)

On this page