CCXT

kucoin

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

kucoin

Kind: global class
Extends: Exchange

fetchTime

fetches the current integer timestamp in milliseconds from the exchange server

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

See

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

fetchStatus

the latest known information on the availability of the exchange API

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

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.typestringNospot or swap
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
params.tradeTypestringNouta only set to SPOT or FUTURES
kucoin.fetchStatus (params?)

fetchMarkets

retrieves data on all markets for kucoin

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

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
kucoin.fetchMarkets (params?)

loadMigrationStatus

loads the migration status for the account (hf or not)

Kind: instance method of kucoin
Returns: any - ignore

See: https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type

ParamTypeDescription
forcebooleanload account state for non hf
kucoin.loadMigrationStatus (force)

fetchCurrencies

fetches all available currencies on an exchange

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

See

ParamTypeRequiredDescription
paramsobjectYesextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
kucoin.fetchCurrencies (params)

fetchAccounts

fetch all the accounts associated with a profile

Kind: instance method of kucoin
Returns: object - a dictionary of account structures indexed by the account type

See: https://www.kucoin.com/docs-new/rest/account-info/account-funding/get-account-list-spot

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
kucoin.fetchAccounts (params?)

fetchTransactionFee

DEPRECATED please use fetchDepositWithdrawFee instead

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

See: https://docs.kucoin.com/#get-withdrawal-quotas

ParamTypeDescription
codestringunified currency code
paramsobjectextra parameters specific to the exchange API endpoint
kucoin.fetchTransactionFee (code, params)

fetchDepositWithdrawFee

fetch the fee for deposits and withdrawals

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

See: https://www.kucoin.com/docs-new/rest/account-info/withdrawals/get-withdrawal-quotas

ParamTypeRequiredDescription
codestringYesunified currency code
paramsobjectNoextra parameters specific to the exchange API endpoint
params.networkstringNoThe chain of currency. This only apply for multi-chain currency, and there is no need for single chain currency; you can query the chain through the response of the GET /api/v2/currencies/{currency} interface
kucoin.fetchDepositWithdrawFee (code, params?)

fetchTickers

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

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

See

ParamTypeRequiredDescription
symbolsArray<string>, undefinedNounified 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
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
params.typestringNospot or swap (default is spot)
params.methodstringNoswap only the method to use, futuresPublicGetContractsActive or futuresPublicGetAllTickers (default is futuresPublicGetContractsActive)
kucoin.fetchTickers (symbols?, params?)

fetchMarkPrices

fetches the mark price for multiple markets

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

See: https://www.kucoin.com/docs-new/rest/margin-trading/market-data/get-mark-price-list

ParamTypeRequiredDescription
symbolsArray<string>Nounified 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
kucoin.fetchMarkPrices (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 kucoin
Returns: object - a ticker structure

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
kucoin.fetchTicker (symbol, params?)

fetchMarkPrice

fetches the mark price for a specific market

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.fetchMarkPrice (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 kucoin
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See

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.utabooleanNoset to true for the unified trading account (uta), defaults to false
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
kucoin.fetchOHLCV (symbol, timeframe, since?, limit?, params?)

createDepositAddress

create a currency deposit address

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

See: https://www.kucoin.com/docs-new/rest/account-info/deposit/add-deposit-address-v3

ParamTypeRequiredDescription
codestringYesunified currency code of the currency for the deposit address
paramsobjectNoextra parameters specific to the exchange API endpoint
params.networkstringNothe blockchain network name
kucoin.createDepositAddress (code, params?)

fetchDepositAddress

fetch the deposit address for a currency associated with this account

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

See

ParamTypeRequiredDescription
codestringYesunified currency code
paramsobjectNoextra parameters specific to the exchange API endpoint
params.networkstringNothe blockchain network name
params.accountTypestringNo'main', 'contract' or 'uta' (default is 'main')
params.utabooleanNoset to true for the unified trading account (uta) endpoint, defaults to false
kucoin.fetchDepositAddress (code, params?)

fetchContractDepositAddress

fetch the deposit address for a currency associated with this account

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

See: https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-address

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

fetchDepositAddressesByNetwork

fetch the deposit address for a currency associated with this account

Kind: instance method of kucoin
Returns: object - an array of address structures

See

ParamTypeRequiredDescription
codestringYesunified currency code
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta) endpoint, defaults to false
kucoin.fetchDepositAddressesByNetwork (code, params?)

fetchOrderBook

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

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

See

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
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
kucoin.fetchOrderBook (symbol, limit?, params?)

createOrder

Create an order on the exchange

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

See

ParamTypeRequiredDescription
symbolstringYesUnified CCXT market symbol
typestringYes'limit' or 'market'
sidestringYes'buy' or 'sell'
amountfloatYesthe amount of currency to trade
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.utabooleanNoset to true for the unified trading account (uta) endpoint, defaults to false Check createSpotOrder(), createContractOrder() and createUtaOrder () for more details on the extra parameters that can be used in params
kucoin.createOrder (symbol, type, side, amount, price?, params?)

createSpotOrder

helper method for creating spot orders

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

See

ParamTypeRequiredDescription
symbolstringYesUnified CCXT market symbol
typestringYes'limit' or 'market'
sidestringYes'buy' or 'sell'
amountfloatYesthe amount of currency to trade
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.triggerPricefloatNoThe price at which a trigger order is triggered at
params.marginModestringNo'cross', // cross (cross mode) and isolated (isolated mode), set to cross by default, the isolated mode will be released soon, stay tuned
params.timeInForcestringNoGTC, GTT, IOC, or FOK, default is GTC, limit orders only
params.postOnlyboolNoPost only flag, invalid when timeInForce is IOC or FOK EXCHANGE SPECIFIC PARAMETERS
params.clientOidstringNoclient order id, defaults to uuid if not passed
params.remarkstringNoremark for the order, length cannot exceed 100 utf8 characters
params.tradeTypestringNo'TRADE', // TRADE, MARGIN_TRADE // not used with margin orders limit orders ---------------------------------------------------
params.cancelAfterfloatNolong, // cancel after n seconds, requires timeInForce to be GTT
params.hiddenboolNofalse, // Order will not be displayed in the order book
params.icebergboolNofalse, // Only a portion of the order is displayed in the order book
params.visibleSizestringNothis.amountToPrecision (symbol, visibleSize), // The maximum visible size of an iceberg order market orders --------------------------------------------------
params.fundsstringNo// Amount of quote currency to use stop orders ----------------------------------------------------
params.stopstringNoEither loss or entry, the default is loss. Requires triggerPrice to be defined margin orders --------------------------------------------------
params.leveragefloatNoLeverage size of the order
params.stpstringNo'', // self trade prevention, CN, CO, CB or DC
params.autoBorrowboolNofalse, // The system will first borrow you funds at the optimal interest rate and then place an order for you
params.hfboolNofalse, // true for hf order
params.testboolNoset to true to test an order, no order will be created but the request will be validated
params.syncboolNoset to true to use the hf sync call
kucoin.createSpotOrder (symbol, type, side, amount, price?, params?)

createContractOrder

helper method for creating contract orders

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

See

ParamTypeRequiredDescription
symbolstringYesUnified CCXT market symbol
typestringYes'limit' or 'market'
sidestringYes'buy' or 'sell'
amountfloatYesthe amount of currency to trade
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.takeProfitobjectNotakeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered and the triggerPriceType
params.stopLossobjectNostopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered and the triggerPriceType
params.triggerPricefloatNoThe price a trigger order is triggered at
params.stopLossPricefloatNoprice to trigger stop-loss orders
params.takeProfitPricefloatNoprice to trigger take-profit orders
params.reduceOnlyboolNoA mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true.
params.timeInForcestringNoGTC, GTT, IOC, or FOK, default is GTC, limit orders only
params.postOnlyboolNoPost only flag, invalid when timeInForce is IOC or FOK
params.costfloatNothe cost of the order in units of USDT
params.marginModestringNo'cross' or 'isolated', default is 'isolated'
params.hedgedboolNoswap and future only true for hedged mode, false for one way mode, default is false ----------------- Exchange Specific Parameters -----------------
params.leveragefloatNoLeverage size of the order (mandatory param in request, default is 1)
params.clientOidstringNoclient order id, defaults to uuid if not passed
params.remarkstringNoremark for the order, length cannot exceed 100 utf8 characters
params.stopstringNo'up' or 'down', the direction the triggerPrice is triggered from, requires triggerPrice. down: Triggers when the price reaches or goes below the triggerPrice. up: Triggers when the price reaches or goes above the triggerPrice.
params.triggerPriceTypestringNo"last", "mark", "index" - defaults to "mark"
params.stopPriceTypestringNoexchange-specific alternative for triggerPriceType: TP, IP or MP
params.closeOrderboolNoset to true to close position
params.testboolNoset to true to use the test order endpoint (does not submit order, use to validate params)
params.forceHoldboolNoA mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default.\
params.positionSidestringNoswap and future only hedged two-way position side, LONG or SHORT
kucoin.createContractOrder (symbol, type, side, amount, price?, params?)

createUtaOrder

helper method for creating uta orders

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

See: https://www.kucoin.com/docs-new/rest/ua/place-order

ParamTypeRequiredDescription
symbolstringYesUnified CCXT market symbol
typestringYes'limit' or 'market'
sidestringYes'buy' or 'sell'
amountfloatYesthe amount of currency to trade
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.clientOrderIdstringNoclient order id, defaults to uuid if not passed
params.costfloatNothe cost of the order in units of quote currency
params.timeInForcestringNoGTC, GTD, IOC, FOK or PO
params.postOnlyboolNoPost only flag, invalid when timeInForce is IOC or FOK (default is false)
params.reduceOnlyboolNocontract markets only A mark to reduce the position size only. Set to false by default
params.triggerPricefloatNoThe price a trigger order is triggered at
params.triggerDirectionstringNo'ascending' or 'descending', the direction the triggerPrice is triggered from, requires triggerPrice
params.triggerPriceTypestringNocontract markets only "last", "mark", "index" - defaults to "mark"
params.stopLossPricefloatNoprice to trigger stop-loss orders
params.takeProfitPricefloatNoprice to trigger take-profit orders
params.marginModestringNo'cross' or 'isolated', (default is 'cross' for margin orders, default is 'isolated' for contract orders) Exchange-specific parameters -------------------------------------------------
params.accountModestringNo'unified' or 'classic', default is 'unified'
params.stpstringNo'', // self trade prevention, CN, CO, CB or DC
params.cancelAfterintNoCancel After N Seconds (Calculated from the time of entering the matching engine), only effective when timeInForce is GTD
params.sizeUnitstringNocontracts only 'BASECCY' (amount of base currency) or 'UNIT' (number of contracts), default is 'UNIT' Classic account parameters
params.autoBorrowboolNoclassic margin orders only
params.autoRepayboolNoclassic margin orders only
params.hedgedstringNoclassic contract orders only true for hedged mode, false for one way mode, default is false
params.leverageintNoclassic contract orders with isolated marginMode only Leverage size of the order
kucoin.createUtaOrder (symbol, type, side, amount, price?, params?)

createMarketOrderWithCost

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

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

See

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

createMarketBuyOrderWithCost

create a market buy order by providing the symbol and cost

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

See

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
kucoin.createMarketBuyOrderWithCost (symbol, cost, params?)

createMarketSellOrderWithCost

create a market sell order by providing the symbol and cost

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

See

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
kucoin.createMarketSellOrderWithCost (symbol, cost, params?)

createOrders

create a list of trade orders

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

See

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 Check createSpotOrders() and createContractOrders() for more details on the extra parameters that can be used in params
kucoin.createOrders (orders, params?)

createSpotOrders

helper method for creating spot orders in batch

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

See

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
params.hfboolNofalse, // true for hf orders
params.syncboolNofalse, // true to use the hf sync call
kucoin.createSpotOrders (orders, params?)

createContractOrders

helper method for creating contract orders in batch

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

See: https://www.kucoin.com/docs-new/rest/futures-trading/orders/batch-add-orders

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
kucoin.createContractOrders (orders, params?)

editOrder

edit an order, kucoin currently only supports the modification of HF orders

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

See: https://www.kucoin.com/docs-new/rest/spot-trading/orders/modify-order

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market to create an order in
typestringYesnot used
sidestringYesnot used
amountfloatYeshow 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.clientOrderIdstringNoclient order id, defaults to id if not passed
kucoin.editOrder (id, symbol, type, side, amount, price?, params?)

cancelOrder

cancels an open order

Kind: instance method of kucoin
Returns: Response from the exchange

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.typestringNo'spot' or 'swap', used if symbol is not provided (default is 'spot')
params.marginModestringNospot only 'cross' or 'isolated'
params.utabooleanNotrue for cancelling order with unified account endpoint (default is false) Check cancelSpotOrder() and cancelContractOrder() for more details on the extra parameters that can be used in params
kucoin.cancelOrder (id, symbol, params?)

cancelSpotOrder

helper method for cancelling spot orders

Kind: instance method of kucoin
Returns: Response from the exchange

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.triggerboolNoTrue if cancelling a stop order
params.hfboolNofalse, // true for hf order
params.syncboolNofalse, // true to use the hf sync call
params.marginModestringNo'cross' or 'isolated'
kucoin.cancelSpotOrder (id, symbol, params?)

cancelContractOrder

helper method for cancelling contract orders

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

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdstringNocancel order by client order id
kucoin.cancelContractOrder (id, symbol, params?)

cancelUtaOrder

helper method for cancelling uta orders

Kind: instance method of kucoin
Returns: Response from the exchange

See: https://www.kucoin.com/docs-new/rest/ua/cancel-order

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.accountModestringNo'unified' or 'classic' (default is 'unified')
params.clientOrderIdstringNoclient order id, required if id is not provided
params.marginModestringNo'cross' or 'isolated', required if fetching a margin order (unified accountMode supports only cross margin)
kucoin.cancelUtaOrder (id, symbol, params?)

cancelAllOrders

cancel all open orders

Kind: instance method of kucoin
Returns: Response from the exchange

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
params.typestringNo'spot' or 'swap', used if symbol is not provided (default is 'spot')
params.marginModestringNospot only 'cross' or 'isolated'
params.utabooleanNotrue for cancelling orders with unified account endpoint (default is false) Check cancelAllSpotOrders(), cancelAllContractOrders() and cancelAllUtaOrders() for more details on the extra parameters that can be used in params
kucoin.cancelAllOrders (symbol, params?)

cancelAllSpotOrders

helper method for cancelling all spot orders

Kind: instance method of kucoin
Returns: Response from the exchange

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
params.triggerboolNoinvalid for isolated margin true if cancelling all stop orders
params.marginModestringNo'cross' or 'isolated'
params.orderIdsstringNostop orders only Comma separated order IDs
params.hfboolNofalse, // true for hf order
kucoin.cancelAllSpotOrders (symbol, params?)

cancelAllContractOrders

helper method for cancelling all contract orders

Kind: instance method of kucoin
Returns: Response from the exchange

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
params.triggerobjectNoWhen true, all the trigger orders will be cancelled
kucoin.cancelAllContractOrders (symbol, params?)

cancelAllUtaOrders

helper method for cancelling all uta orders

Kind: instance method of kucoin
Returns: Response from the exchange

See: https://www.kucoin.com/docs-new/rest/ua/batch-cancel-order-by-symbol

ParamTypeRequiredDescription
symbolstringYesunified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
params.triggerboolNotrue if cancelling all stop orders
params.marginModestringNo'CROSS' or 'ISOLATED'
kucoin.cancelAllUtaOrders (symbol, params?)

fetchOrdersByStatus

fetches a list of orders placed on the exchange

Kind: instance method of kucoin
Returns: An array of order structures

See

ParamTypeRequiredDescription
statusstringYes'active' or 'closed', only 'active' is valid for stop orders
symbolstringYesunified symbol for the market to retrieve orders from
sinceintNotimestamp in ms of the earliest order to retrieve
limitintNoThe maximum number of orders to retrieve
paramsobjectNoexchange specific parameters
params.utabooleanNotrue for fetch orders with uta endpoint (default is false) Check fetchSpotOrdersByStatus(), fetchContractOrdersByStatus() and fetchUtaOrdersByStatus() for more details on the extra parameters that can be used in params
kucoin.fetchOrdersByStatus (status, symbol, since?, limit?, params?)

fetchSpotOrdersByStatus

fetch a list of spot orders

Kind: instance method of kucoin
Returns: An array of order structures

See

ParamTypeRequiredDescription
statusstringYesnot used for stop orders 'open' or 'closed'
symbolstringYesunified market symbol
sinceintNotimestamp in ms of the earliest order
limitintNomax number of orders to return
paramsobjectNoexchange specific params
params.untilintNoend time in ms
params.sidestringNobuy or sell
params.typestringNolimit, market, limit_stop or market_stop
params.tradeTypestringNoTRADE for spot trading, MARGIN_TRADE or MARGIN_ISOLATED_TRADE for Margin Trading
params.currentPageintNotrigger orders only current page
params.orderIdsstringNotrigger orders only comma separated order ID list
params.triggerboolNoTrue if fetching a trigger order
params.hfboolNofalse, // true for hf order
params.marginModestringNo'cross' or 'isolated', only for margin orders
kucoin.fetchSpotOrdersByStatus (status, symbol, since?, limit?, params?)

fetchContractOrdersByStatus

fetches a list of contract orders placed on the exchange

Kind: instance method of kucoin
Returns: An array of order structures

See

ParamTypeRequiredDescription
statusstringYes'active' or 'closed', only 'active' is valid for stop orders
symbolstringYesunified symbol for the market to retrieve orders from
sinceintNotimestamp in ms of the earliest order to retrieve
limitintNoThe maximum number of orders to retrieve
paramsobjectNoexchange specific parameters
params.triggerboolNoset to true to retrieve untriggered stop orders
params.untilintNoEnd time in ms
params.sidestringNobuy or sell
params.typestringNolimit or market
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
kucoin.fetchContractOrdersByStatus (status, symbol, since?, limit?, params?)

fetchUtaOrdersByStatus

helper method for fetching orders by status with uta endpoint

Kind: instance method of kucoin
Returns: An array of order structures

See

ParamTypeRequiredDescription
statusstringYes'active' or 'closed', only 'active' is valid for stop orders
symbolstringYesunified symbol for the market to retrieve orders from
sinceintNotimestamp in ms of the earliest order to retrieve
limitintNoThe maximum number of orders to retrieve
paramsobjectNoexchange specific parameters
params.untilintNoEnd time in ms
params.sidestringNoclosed orders only 'BUY' or 'SELL'
params.accountModestringNo'unified' or 'classic' (default is unified)
params.marginModestringNo'cross' or 'isolated', only for margin orders (unified accountMode supports only cross margin)
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
kucoin.fetchUtaOrdersByStatus (status, symbol, since?, limit?, params?)

fetchClosedOrders

fetches information on multiple closed orders made by the user

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

See

ParamTypeRequiredDescription
symbolstringYesunified 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.untilintNoend time in ms
params.sidestringNobuy or sell
params.typestringNolimit, market, limit_stop or market_stop
params.tradeTypestringNoTRADE for spot trading, MARGIN_TRADE for Margin Trading
params.triggerboolNoTrue if fetching a trigger order
params.hfboolNofalse, // true for hf order
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
kucoin.fetchClosedOrders (symbol, since?, limit?, params?)

fetchOpenOrders

fetch all unfilled currently open orders

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

See

ParamTypeRequiredDescription
symbolstringYesunified 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.untilintNoend time in ms
params.triggerboolNotrue if fetching trigger orders
params.sidestringNobuy or sell
params.typestringNolimit, market, limit_stop or market_stop
params.tradeTypestringNoTRADE for spot trading, MARGIN_TRADE for Margin Trading
params.currentPageintNotrigger orders only current page
params.orderIdsstringNotrigger orders only comma separated order ID list
params.hfboolNofalse, // true for hf order
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
kucoin.fetchOpenOrders (symbol, since?, limit?, params?)

fetchOrder

fetches information on an order made by the user

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

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.typestringNo'spot' or 'swap', used if symbol is not provided (default is 'spot')
params.utaboolNotrue if fetching an order with uta endpoint (default is false) Check fetchSpotOrder(), fetchContractOrder() and fetchUtaOrder() for more details on the extra parameters that can be used in params
kucoin.fetchOrder (id, symbol, params?)

fetchSpotOrder

fetch a spot order

Kind: instance method of kucoin
Returns: An order structure

See

ParamTypeRequiredDescription
idstringYesOrder id
symbolstringYesnot sent to exchange except for trigger orders with clientOid, but used internally by CCXT to filter
paramsobjectNoexchange specific parameters
params.triggerboolNotrue if fetching a trigger order
params.hfboolNofalse, // true for hf order
params.clientOidboolNounique order id created by users to identify their orders
params.marginModeobjectNo'cross' or 'isolated'
kucoin.fetchSpotOrder (id, symbol, params?)

fetchContractOrder

fetc contract order

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

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.fetchContractOrder (id, symbol, params?)

fetchUtaOrder

fetch uta order

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

See: https://www.kucoin.com/docs-new/rest/ua/get-order-details

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.accountModestringNo'unified' or 'classic' (default is 'unified')
params.clientOrderIdstringNoclient order id, required if id is not provided
params.marginModestringNo'cross' or 'isolated', required if fetching a margin order (unified accountMode supports only cross margin)
kucoin.fetchUtaOrder (id, symbol, params?)

fetchOrderTrades

fetch all the trades made from a single order

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

See

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
params.typestringNo'spot' or 'swap', used if symbol is not provided (default is 'spot')
params.utabooleanNoset to true if fetching trades from uta endpoint, default is false.
kucoin.fetchOrderTrades (id, symbol, since?, limit?, params?)

fetchMyTrades

fetch all trades made by the user

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

See

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.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
params.typestringNo'spot' or 'swap', used if symbol is not provided (default is 'spot') Check fetchMySpotTrades() and fetchMyContractTrades() for more details on the extra parameters that can be used in params
kucoin.fetchMyTrades (symbol, since?, limit?, params?)

fetchMySpotTrades

fetch all spot trades made by the user

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

See

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.untilintNothe latest time in ms to fetch entries for
params.hfboolNofalse, // true for hf order
params.marginModestringNo'cross' or 'isolated', only for margin trades
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
kucoin.fetchMySpotTrades (symbol, since?, limit?, params?)

fetchMyContractTrades

fetch all contract trades made by the user

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

See: https://www.kucoin.com/docs-new/rest/futures-trading/orders/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.untilintNoEnd time in ms
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
kucoin.fetchMyContractTrades (symbol, since?, limit?, params?)

fetchMyUtaTrades

fetch all trades made by the user

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

See: https://www.kucoin.com/docs-new/rest/ua/get-trade-history

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades structures to retrieve (default is 50, max is 200)
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch entries for
params.accountModestringNo'unified' or 'classic', defaults to 'unified'
params.marginModestringNo'cross' or 'isolated', only for margin trades (unified accountMode support only cross margin)
params.sidestringNo'BUY' or 'SELL' (both if not provided)
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
kucoin.fetchMyUtaTrades (symbol, since?, limit?, params?)

fetchTrades

get the list of most recent trades for a particular symbol

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

See

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
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
kucoin.fetchTrades (symbol, since?, limit?, params?)

fetchTradingFee

fetch the trading fees for a market

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

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta) endpoint, defaults to false
kucoin.fetchTradingFee (symbol, params?)

withdraw

make a withdrawal

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

See: https://www.kucoin.com/docs-new/rest/account-info/withdrawals/withdraw-v3

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesthe amount to withdraw
addressstringYesthe address to withdraw to
tagstringYes
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.withdraw (code, amount, address, tag, params?)

fetchDeposits

fetch all deposits made to an account

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

See

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.untilintNothe latest time in ms to fetch entries for
params.paginatebooleanNomain account only default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
params.accountTypestringNo'main' or 'contract' (default is 'main')
kucoin.fetchDeposits (code, since?, limit?, params?)

fetchContractDeposits

helper method for fetching deposits for futures accounts

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

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
kucoin.fetchContractDeposits (code, since?, limit?, params?)

fetchWithdrawals

fetch all withdrawals made from an account

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

See

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.untilintNothe latest time in ms to fetch entries for
params.paginatebooleanNomain account only default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
params.accountTypestringNo'main' or 'contract' (default is 'main')
kucoin.fetchWithdrawals (code, since?, limit?, params?)

fetchContractWithdrawals

helper method for fetching withdrawals for futures accounts

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

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
kucoin.fetchContractWithdrawals (code, 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 kucoin
Returns: object - a balance structure

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModeobjectNo'cross' or 'isolated', margin type for fetching margin balance
params.typeobjectNoextra parameters specific to the exchange API endpoint
params.hfobjectNodefault if false if true, the result includes the balance of the high frequency account
params.utabooleanNoset to true for the unified trading account (uta) endpoint, defaults to false
kucoin.fetchBalance (params?)

fetchContractBalance

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

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

See: https://www.kucoin.com/docs-new/rest/account-info/account-funding/get-account-futures

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.codeobjectNothe unified currency code to fetch the balance for, if not provided, the default .options['fetchBalance']['code'] will be used
kucoin.fetchContractBalance (params?)

fetchUtaBalance

helper method for fetching balance with unified trading account (uta) endpoint

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

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.typestringNo'unified', 'spot', 'funding', 'cross', 'isolated' or 'swap' (default is 'unified')
params.marginModestringNo'cross' or 'isolated', margin type for fetching margin balance, only applicable if type is margin (default is cross)
kucoin.fetchUtaBalance (params?)

transfer

transfer currency internally between wallets on the same account

Kind: instance method of kucoin
Returns: object - a transfer structure

See

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesamount to transfer
fromAccountstringYesaccount to transfer from
toAccountstringYesaccount to transfer to
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta) endpoint, defaults to false Check transferClassic() and transferUta() for more details on params
kucoin.transfer (code, amount, fromAccount, toAccount, params?)

transferUta

transfer currency internally between wallets on the same account with uta endpoint

Kind: instance method of kucoin
Returns: object - a transfer structure

See: https://www.kucoin.com/docs-new/rest/ua/flex-transfer

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesamount to transfer
fromAccountstringYesaccount to transfer from
toAccountstringYesaccount to transfer to
paramsobjectNoextra parameters specific to the exchange API endpoint
params.transferTypestringNoINTERNAL, PARENT_TO_SUB, SUB_TO_PARENT, SUB_TO_SUB (default is INTERNAL)
params.fromUserIdstringNorequired if transferType is SUB_TO_PARENT or SUB_TO_SUB
params.toUserIdstringNorequired if transferType is PARENT_TO_SUB or SUB_TO_SUB
kucoin.transferUta (code, amount, fromAccount, toAccount, params?)

transferClassic

transfer currency internally between wallets on the same account with classic endpoints

Kind: instance method of kucoin
Returns: object - a transfer structure

See: https://www.kucoin.com/docs-new/rest/account-info/transfer/flex-transfer?lang=en_US&

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesamount to transfer
fromAccountstringYesaccount to transfer from
toAccountstringYesaccount to transfer to
paramsobjectNoextra parameters specific to the exchange API endpoint
params.transferTypestringNoINTERNAL, PARENT_TO_SUB, SUB_TO_PARENT (default is INTERNAL)
params.fromUserIdstringNorequired if transferType is SUB_TO_PARENT
params.toUserIdstringNorequired if transferType is PARENT_TO_SUB
kucoin.transferClassic (code, amount, fromAccount, toAccount, 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 kucoin
Returns: object - a ledger structure

See

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.typeobjectNoextra parameters specific to the exchange API endpoint
params.hfbooleanNodefault false, when true will fetch ledger entries for the high frequency trading account
params.untilintNothe latest time in ms to fetch entries for
params.utabooleanNodefault false, when true will fetch ledger entries for the unified trading account (UTA) instead of the regular accounts endpoint
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
kucoin.fetchLedger (code?, since?, limit?, params?)

fetchBorrowInterest

fetch the interest owed by the user for borrowing currency for margin trading

Kind: instance method of kucoin
Returns: Array<object> - a list of borrow interest structures

See

ParamTypeRequiredDescription
codestringNounified currency code
symbolstringNounified market symbol, required for isolated margin
sinceintNothe earliest time in ms to fetch borrrow interest for
limitintNothe maximum number of structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNo'cross' or 'isolated' default is 'cross'
kucoin.fetchBorrowInterest (code?, symbol?, since?, limit?, params?)

fetchBorrowRateHistories

retrieves a history of a multiple currencies borrow interest rate at specific time slots, returns all currencies if no symbols passed, default is undefined

Kind: instance method of kucoin
Returns: object - a dictionary of borrow rate structures indexed by the market symbol

See: https://www.kucoin.com/docs-new/rest/margin-trading/debit/get-interest-history

ParamTypeRequiredDescription
codesArray<string>, undefinedYeslist of unified currency codes, default is undefined
sinceintNotimestamp in ms of the earliest borrowRate, default is undefined
limitintNomax number of borrow rate prices to return, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNo'cross' or 'isolated' default is 'cross'
params.untilintNothe latest time in ms to fetch entries for
kucoin.fetchBorrowRateHistories (codes, since?, limit?, params?)

fetchBorrowRateHistory

retrieves a history of a currencies borrow interest rate at specific time slots

Kind: instance method of kucoin
Returns: Array<object> - an array of borrow rate structures

See: https://www.kucoin.com/docs-new/rest/margin-trading/debit/get-interest-history

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNotimestamp for the earliest borrow rate
limitintNothe maximum number of borrow rate structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNo'cross' or 'isolated' default is 'cross'
params.untilintNothe latest time in ms to fetch entries for
kucoin.fetchBorrowRateHistory (code, since?, limit?, params?)

fetchCrossBorrowRate

fetch the rate of interest to borrow a currency for margin trading

Kind: instance method of kucoin
Returns: object - a borrow rate structure

See: https://www.kucoin.com/docs-new/rest/ua/get-borrowing-rates-and-limits

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

borrowCrossMargin

create a loan to borrow margin

Kind: instance method of kucoin
Returns: object - a margin loan structure

See: https://www.kucoin.com/docs-new/rest/margin-trading/debit/borrow

ParamTypeRequiredDescription
codestringYesunified currency code of the currency to borrow
amountfloatYesthe amount to borrow
paramsobjectNoextra parameters specific to the exchange API endpoints
params.timeInForcestringNoeither IOC or FOK
kucoin.borrowCrossMargin (code, amount, params?)

borrowIsolatedMargin

create a loan to borrow margin

Kind: instance method of kucoin
Returns: object - a margin loan structure

See: https://www.kucoin.com/docs-new/rest/margin-trading/debit/borrow

ParamTypeRequiredDescription
symbolstringYesunified market symbol, required for isolated margin
codestringYesunified currency code of the currency to borrow
amountfloatYesthe amount to borrow
paramsobjectNoextra parameters specific to the exchange API endpoints
params.timeInForcestringNoeither IOC or FOK
kucoin.borrowIsolatedMargin (symbol, code, amount, params?)

repayCrossMargin

repay borrowed margin and interest

Kind: instance method of kucoin
Returns: object - a margin loan structure

See: https://www.kucoin.com/docs-new/rest/margin-trading/debit/repay

ParamTypeRequiredDescription
codestringYesunified currency code of the currency to repay
amountfloatYesthe amount to repay
paramsobjectNoextra parameters specific to the exchange API endpoints
kucoin.repayCrossMargin (code, amount, params?)

repayIsolatedMargin

repay borrowed margin and interest

Kind: instance method of kucoin
Returns: object - a margin loan structure

See: https://www.kucoin.com/docs-new/rest/margin-trading/debit/repay

ParamTypeRequiredDescription
symbolstringYesunified market symbol
codestringYesunified currency code of the currency to repay
amountfloatYesthe amount to repay
paramsobjectNoextra parameters specific to the exchange API endpoints
kucoin.repayIsolatedMargin (symbol, code, amount, params?)

fetchDepositWithdrawFees

fetch deposit and withdraw fees - IMPORTANT use fetchDepositWithdrawFee to get more in-depth info

Kind: instance method of kucoin
Returns: object - a list of fee structures

See: https://docs.kucoin.com/#get-currencies

ParamTypeRequiredDescription
codesArray<string>, undefinedYeslist of unified currency codes
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.fetchDepositWithdrawFees (codes, params?)

fetchLeverage

fetch the set leverage for a market

Kind: instance method of kucoin
Returns: object - a leverage structure

See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/get-cross-margin-leverage

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

setLeverage

set the level of leverage for a market

Kind: instance method of kucoin
Returns: object - response from the exchange

See

ParamTypeRequiredDescription
leverageintNoNew leverage multiplier. Must be greater than 1 and up to two decimal places, and cannot be less than the user's current debt leverage or greater than the system's maximum leverage
symbolstringNounified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta)
params.marginModestringNospot non-uta only 'cross' or 'isolated' default is 'cross'
params.codestringNouta margin only the unified currency code for the margin to set the leverage for
kucoin.setLeverage (leverage?, symbol?, params?)

setContractLeverage

set the level of leverage for a market

Kind: instance method of kucoin
Returns: object - response from the exchange

See

ParamTypeRequiredDescription
leveragefloatYesthe rate of leverage
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta)
kucoin.setContractLeverage (leverage, symbol, params?)

fetchFundingInterval

fetch the current funding rate interval

Kind: instance method of kucoin
Returns: object - a funding rate structure

See

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

fetchFundingRate

fetch the current funding rate

Kind: instance method of kucoin
Returns: object - a funding rate structure

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta)
kucoin.fetchFundingRate (symbol, params?)

fetchFundingRateHistory

fetches historical funding rate prices

Kind: instance method of kucoin
Returns: Array<object> - a list of funding rate structures

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the funding rate history for
sinceintNonot used by kucuoinfutures
limitintNothe maximum amount of funding rate structures to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNoend time in ms
params.utabooleanNoset to true for the unified trading account (uta), defaults to true
kucoin.fetchFundingRateHistory (symbol, since?, limit?, params?)

fetchFundingHistory

fetch the history of funding payments paid and received on this account

Kind: instance method of kucoin
Returns: object - a funding history structure

See: https://www.kucoin.com/docs-new/rest/futures-trading/funding-fees/get-private-funding-history

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch funding history for
limitintNothe maximum number of funding history structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
kucoin.fetchFundingHistory (symbol, since?, limit?, params?)

fetchPosition

fetch data on an open position

Kind: instance method of kucoin
Returns: object - a position structure

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market the position is held in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
params.pageSizeintegerNouta only page size for the uta endpoint (default 50, max 200)
params.pageNumberintegerNouta only page number for the uta endpoint (default 1)
kucoin.fetchPosition (symbol, params?)

fetchPositions

fetch all open positions

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

See

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYeslist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
params.pageSizeintegerNouta only page size for the uta endpoint (default 50, max 200)
params.pageNumberintegerNouta only page number for the uta endpoint (default 1)
kucoin.fetchPositions (symbols, params?)

fetchPositionsHistory

fetches historical positions

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

See

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols
sinceintNothe earliest time in ms to fetch position history for
limitintNothe maximum number of entries to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNoclosing end time
params.pageIdintNopage id
params.utabooleanNoset to true for the unified trading account (uta), defaults to false
kucoin.fetchPositionsHistory (symbols?, since?, limit?, params?)

cancelOrders

cancel multiple orders for contract markets

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

See

ParamTypeRequiredDescription
idsArray<string>Yesorder ids
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.clientOrderIdsArray<string>Noclient order ids
params.utabooleanNoset to true to use the unified trading account (uta) endpoint, defaults to false for the contract orders
params.accountModestringNofor uta endpoint only 'unified' or 'classic' (default is 'unified')
params.marginModestringNofor margin orders only 'cross' or 'isolated' (unified accountMode supports cross margin only)
kucoin.cancelOrders (ids, symbol, params?)

addMargin

add margin

Kind: instance method of kucoin
Returns: object - a margin structure

See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/add-isolated-margin

ParamTypeRequiredDescription
symbolstringYesunified market symbol
amountfloatYesamount of margin to add
paramsobjectNoextra parameters specific to the exchange API endpoint
params.positionSidestringNorequired for hedged position 'BOTH', 'LONG' or 'SHORT' (default is 'BOTH')
kucoin.addMargin (symbol, amount, params?)

fetchMarginMode

fetches the margin mode of a trading pair

Kind: instance method of kucoin
Returns: object - a margin mode structure

See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/get-margin-mode

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the margin mode for
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.fetchMarginMode (symbol, params?)

setMarginMode

set margin mode to 'cross' or 'isolated'

Kind: instance method of kucoin
Returns: object - response from the exchange

See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/switch-margin-mode

ParamTypeRequiredDescription
marginModestringYes'cross' or 'isolated'
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.setMarginMode (marginMode, symbol, params?)

setPositionMode

set hedged to true or false for a market

Kind: instance method of kucoin
Returns: object - a response from the exchange

See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/switch-position-mode

ParamTypeRequiredDescription
hedgedboolYesset to true to use two way position
symbolstringNonot used by bybit setPositionMode ()
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.setPositionMode (hedged, symbol?, params?)

fetchPositionMode

fetchs the position mode, hedged or one way

Kind: instance method of kucoin
Returns: object - an object detailing whether the market is in hedged or one-way mode

See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/get-position-mode

ParamTypeRequiredDescription
symbolstringNounified symbol of the market to fetch the position mode for (not used in blofin fetchPositionMode)
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.fetchPositionMode (symbol?, params?)

closePosition

closes open positions for a market

Kind: instance method of kucoin
Returns: Array<object> - A list of position structures

See

ParamTypeRequiredDescription
symbolstringYesUnified CCXT market symbol
sidestringYesnot used by kucoin closePositions
paramsobjectNoextra parameters specific to the okx api endpoint
params.clientOrderIdstringNoclient order id of the order
kucoin.closePosition (symbol, side, params?)

fetchMarketLeverageTiers

retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market

Kind: instance method of kucoin
Returns: object - a leverage tiers structure

See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/get-isolated-margin-risk-limit

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true to fetch leverage tiers for unified trading account instead of futures account (default is false)
kucoin.fetchMarketLeverageTiers (symbol, params?)

fetchLeverageTiers

retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes

Kind: instance method of kucoin
Returns: object - a dictionary of leverage tiers structures, indexed by market symbols

See: https://www.kucoin.com/docs-new/rest/ua/get-position-tiers

ParamTypeRequiredDescription
symbolsArray<string>Yeslist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.fetchLeverageTiers (symbols, params?)

fetchOpenInterests

Retrieves the open interest for a list of symbols

Kind: instance method of kucoin
Returns: object - an open interest structure/docs/manual#open-interest-structure

See: https://www.kucoin.com/docs-new/rest/ua/get-futures-open-interset

ParamTypeRequiredDescription
symbolsArray<string>NoUnified CCXT market symbol
paramsobjectNoexchange specific parameters
kucoin.fetchOpenInterests (symbols?, params?)

fetchOpenInterestHistory

Retrieves the open interest history of a currency

Kind: instance method of kucoin
Returns: object - an array of open interest structures

See: https://www.kucoin.com/docs-new/rest/ua/get-futures-open-interset

ParamTypeRequiredDescription
symbolstringYesUnified CCXT market symbol
timeframestringYes'5m', '15m', '30m', '1h', '4h' or '1d'
sinceintNothe time(ms) of the earliest record to retrieve as a unix timestamp
limitintNodefault 30,max 200
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch entries for
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
kucoin.fetchOpenInterestHistory (symbol, timeframe, since?, limit?, params?)

isUTAEnabled

returns true or false so the user can check if unified account is enabled

Kind: instance method of kucoin
Returns: boolean - true if unified account is enabled, false otherwise

See: https://www.kucoin.com/docs-new/rest/ua/get-account-mode

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.isUTAEnabled (params?)

fetchTransfers

fetch a history of internal transfers made on an account

Kind: instance method of kucoin
Returns: Array<object> - a list of transfer structures

See: https://www.kucoin.com/docs-new/rest/account-info/account-funding/get-account-ledgers-spot-margin

ParamTypeRequiredDescription
codestringNounified currency code of the currency transferred
sinceintNothe earliest time in ms to fetch transfers for
limitintNothe maximum number of transfer structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch transfers for
params.paginatebooleanNodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
kucoin.fetchTransfers (code?, since?, limit?, params?)

watchTicker

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), default is false
kucoin.watchTicker (symbol, params?)

unWatchTicker

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), default is false
kucoin.unWatchTicker (symbol, params?)

watchTickers

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

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

See

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.methodstringNospot markets only either '/market/snapshot' or '/market/ticker' default is '/market/ticker'
params.utabooleanNoset to true for the unified trading account (uta), default is false
kucoin.watchTickers (symbols, params?)

watchBidsAsks

watches best bid & ask for symbols

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

See

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.watchBidsAsks (symbols, params?)

watchOHLCV

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

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

See

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.utabooleanNoset to true for the unified trading account (uta), default is false
kucoin.watchOHLCV (symbol, timeframe, since?, limit?, params?)

unWatchOHLCV

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), default is false
kucoin.unWatchOHLCV (symbol, timeframe, params?)

watchTrades

get the list of most recent trades for a particular symbol

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

See

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
params.utabooleanNoset to true for the unified trading account (uta), default is false
kucoin.watchTrades (symbol, since?, limit?, params?)

watchTradesForSymbols

get the list of most recent trades for a particular symbol

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

See

ParamTypeRequiredDescription
symbolsArray<string>Yes
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.watchTradesForSymbols (symbols, since?, limit?, params?)

unWatchTradesForSymbols

unWatches trades stream

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

See

ParamTypeRequiredDescription
symbolsstringYes
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.unWatchTradesForSymbols (symbols, params?)

unWatchTrades

unWatches trades stream

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), default is false
kucoin.unWatchTrades (symbol, params?)

watchOrderBook

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

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

See

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
params.utabooleanNoset to true for the unified trading account (uta), default is false
params.methodstringNoeither '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2'
kucoin.watchOrderBook (symbol, limit?, params?)

unWatchOrderBook

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

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

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta), default is false
params.methodstringNoeither '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2'
kucoin.unWatchOrderBook (symbol, params?)

watchOrderBookForSymbols

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

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

See

ParamTypeRequiredDescription
symbolsArray<string>Yesunified array of symbols
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
kucoin.watchOrderBookForSymbols (symbols, limit?, params?)

unWatchOrderBookForSymbols

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

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

See

ParamTypeRequiredDescription
symbolsArray<string>Yesunified array of symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
params.methodstringNoeither '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' or '/contractMarket/level2' or '/contractMarket/level2Depth5' or '/contractMarket/level2Depth50' default is '/market/level2' for spot and '/contractMarket/level2' for futures
kucoin.unWatchOrderBookForSymbols (symbols, params?)

watchOrders

watches information on multiple orders made by the user

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

See

ParamTypeRequiredDescription
symbolstringYesunified 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.utabooleanNoset to true for the unified trading account (uta)
params.triggerbooleanNotrigger orders are watched if true
params.typestringNo'spot' or 'swap' (default is 'spot' if symbol is not provided)
kucoin.watchOrders (symbol, since?, limit?, params?)

watchMyTrades

watches information on multiple trades made by the user on spot

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

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market trades were made in
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trade structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta)
params.methodstringNoclassic (non-uta) account only '/spotMarket/tradeOrders' or '/spot/tradeFills' or '/contractMarket/tradeOrders', default is '/spotMarket/tradeOrders'
kucoin.watchMyTrades (symbol, since?, limit?, params?)

watchBalance

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

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

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta)
params.typestringNoclassic (non-uta) account only 'spot' or 'swap' (default is 'spot')
kucoin.watchBalance (params?)

watchPosition

watch open positions for a specific symbol

Kind: instance method of kucoin
Returns: object - a position structure

See: https://www.kucoin.com/docs-new/3470093w0

ParamTypeDescription
symbolstring, undefinedunified market symbol
paramsobjectextra parameters specific to the exchange API endpoint
kucoin.watchPosition (symbol, params)

watchPositions

watch all open positions

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

See: https://www.kucoin.com/docs-new/3470233w0

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols
sinceintNothe earliest time in ms to fetch positions for
limitintNothe maximum number of positions to retrieve
paramsobjectYesextra parameters specific to the exchange API endpoint
params.utabooleanNoset to true for the unified trading account (uta)
kucoin.watchPositions (symbols?, since?, limit?, params)

On this page

kucoinfetchTimefetchStatusfetchMarketsloadMigrationStatusfetchCurrenciesfetchAccountsfetchTransactionFeefetchDepositWithdrawFeefetchTickersfetchMarkPricesfetchTickerfetchMarkPricefetchOHLCVcreateDepositAddressfetchDepositAddressfetchContractDepositAddressfetchDepositAddressesByNetworkfetchOrderBookcreateOrdercreateSpotOrdercreateContractOrdercreateUtaOrdercreateMarketOrderWithCostcreateMarketBuyOrderWithCostcreateMarketSellOrderWithCostcreateOrderscreateSpotOrderscreateContractOrderseditOrdercancelOrdercancelSpotOrdercancelContractOrdercancelUtaOrdercancelAllOrderscancelAllSpotOrderscancelAllContractOrderscancelAllUtaOrdersfetchOrdersByStatusfetchSpotOrdersByStatusfetchContractOrdersByStatusfetchUtaOrdersByStatusfetchClosedOrdersfetchOpenOrdersfetchOrderfetchSpotOrderfetchContractOrderfetchUtaOrderfetchOrderTradesfetchMyTradesfetchMySpotTradesfetchMyContractTradesfetchMyUtaTradesfetchTradesfetchTradingFeewithdrawfetchDepositsfetchContractDepositsfetchWithdrawalsfetchContractWithdrawalsfetchBalancefetchContractBalancefetchUtaBalancetransfertransferUtatransferClassicfetchLedgerfetchBorrowInterestfetchBorrowRateHistoriesfetchBorrowRateHistoryfetchCrossBorrowRateborrowCrossMarginborrowIsolatedMarginrepayCrossMarginrepayIsolatedMarginfetchDepositWithdrawFeesfetchLeveragesetLeveragesetContractLeveragefetchFundingIntervalfetchFundingRatefetchFundingRateHistoryfetchFundingHistoryfetchPositionfetchPositionsfetchPositionsHistorycancelOrdersaddMarginfetchMarginModesetMarginModesetPositionModefetchPositionModeclosePositionfetchMarketLeverageTiersfetchLeverageTiersfetchOpenInterestsfetchOpenInterestHistoryisUTAEnabledfetchTransferswatchTickerunWatchTickerwatchTickerswatchBidsAskswatchOHLCVunWatchOHLCVwatchTradeswatchTradesForSymbolsunWatchTradesForSymbolsunWatchTradeswatchOrderBookunWatchOrderBookwatchOrderBookForSymbolsunWatchOrderBookForSymbolswatchOrderswatchMyTradeswatchBalancewatchPositionwatchPositions