wiki/exchanges/kucoin.md
<a name="kucoin" id="kucoin"></a>
Kind: global class
Extends: <code>Exchange</code>
<a name="fetchTime" id="fetchtime"></a>
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance method of <code>kucoin</code>
Returns: <code>int</code> - the current integer timestamp in milliseconds from the exchange server
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchTime ([params])
<a name="fetchStatus" id="fetchstatus"></a>
the latest known information on the availability of the exchange API
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a status structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | spot or swap |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
| params.tradeType | <code>string</code> | No | uta only set to SPOT or FUTURES |
kucoin.fetchStatus ([params])
<a name="fetchMarkets" id="fetchmarkets"></a>
retrieves data on all markets for kucoin
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - an array of objects representing market data
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
kucoin.fetchMarkets ([params])
<a name="loadMigrationStatus" id="loadmigrationstatus"></a>
loads the migration status for the account (hf or not)
Kind: instance method of <code>kucoin</code>
Returns: <code>any</code> - ignore
See: https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type
| Param | Type | Description |
|---|---|---|
| force | <code>boolean</code> | load account state for non hf |
kucoin.loadMigrationStatus (force, [undefined])
<a name="fetchCurrencies" id="fetchcurrencies"></a>
fetches all available currencies on an exchange
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an associative dictionary of currencies
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | Yes | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
kucoin.fetchCurrencies (params, [undefined])
<a name="fetchAccounts" id="fetchaccounts"></a>
fetch all the accounts associated with a profile
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - 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
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
kucoin.fetchAccounts ([params])
<a name="fetchTransactionFee" id="fetchtransactionfee"></a>
DEPRECATED please use fetchDepositWithdrawFee instead
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a fee structure
See: https://docs.kucoin.com/#get-withdrawal-quotas
| Param | Type | Description |
|---|---|---|
| code | <code>string</code> | unified currency code |
| params | <code>object</code> | extra parameters specific to the exchange API endpoint |
kucoin.fetchTransactionFee (code, params[])
<a name="fetchDepositWithdrawFee" id="fetchdepositwithdrawfee"></a>
fetch the fee for deposits and withdrawals
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a fee structure
See: https://www.kucoin.com/docs-new/rest/account-info/withdrawals/get-withdrawal-quotas
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.network | <code>string</code> | No | The 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])
<a name="fetchTickers" id="fetchtickers"></a>
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a dictionary of ticker structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
| params.type | <code>string</code> | No | spot or swap (default is spot) |
| params.method | <code>string</code> | No | swap only the method to use, futuresPublicGetContractsActive or futuresPublicGetAllTickers (default is futuresPublicGetContractsActive) |
kucoin.fetchTickers ([symbols, params])
<a name="fetchMarkPrices" id="fetchmarkprices"></a>
fetches the mark price for multiple markets
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a dictionary of ticker structures
See: https://www.kucoin.com/docs-new/rest/margin-trading/market-data/get-mark-price-list
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchMarkPrices ([symbols, params])
<a name="fetchTicker" id="fetchticker"></a>
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
kucoin.fetchTicker (symbol[, params])
<a name="fetchMarkPrice" id="fetchmarkprice"></a>
fetches the mark price for a specific market
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchMarkPrice (symbol[, params])
<a name="fetchOHLCV" id="fetchohlcv"></a>
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
| params.paginate | <code>boolean</code> | No | default 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])
<a name="createDepositAddress" id="createdepositaddress"></a>
create a currency deposit address
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an address structure
See: https://www.kucoin.com/docs-new/rest/account-info/deposit/add-deposit-address-v3
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency for the deposit address |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.network | <code>string</code> | No | the blockchain network name |
kucoin.createDepositAddress (code[, params])
<a name="fetchDepositAddress" id="fetchdepositaddress"></a>
fetch the deposit address for a currency associated with this account
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an address structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.network | <code>string</code> | No | the blockchain network name |
| params.accountType | <code>string</code> | No | 'main', 'contract' or 'uta' (default is 'main') |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) endpoint, defaults to false |
kucoin.fetchDepositAddress (code[, params])
<a name="fetchContractDepositAddress" id="fetchcontractdepositaddress"></a>
fetch the deposit address for a currency associated with this account
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an address structure
See: https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-address
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchContractDepositAddress (code[, params])
<a name="fetchDepositAddressesByNetwork" id="fetchdepositaddressesbynetwork"></a>
fetch the deposit address for a currency associated with this account
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an array of address structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) endpoint, defaults to false |
kucoin.fetchDepositAddressesByNetwork (code[, params])
<a name="fetchOrderBook" id="fetchorderbook"></a>
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
kucoin.fetchOrderBook (symbol[, limit, params])
<a name="createOrder" id="createorder"></a>
Create an order on the exchange
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| type | <code>string</code> | Yes | 'limit' or 'market' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | the amount of currency to trade |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set 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])
<a name="createSpotOrder" id="createspotorder"></a>
helper method for creating spot orders
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| type | <code>string</code> | Yes | 'limit' or 'market' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | the amount of currency to trade |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.triggerPrice | <code>float</code> | No | The price at which a trigger order is triggered at |
| params.marginMode | <code>string</code> | No | 'cross', // cross (cross mode) and isolated (isolated mode), set to cross by default, the isolated mode will be released soon, stay tuned |
| params.timeInForce | <code>string</code> | No | GTC, GTT, IOC, or FOK, default is GTC, limit orders only |
| params.postOnly | <code>bool</code> | No | Post only flag, invalid when timeInForce is IOC or FOK EXCHANGE SPECIFIC PARAMETERS |
| params.clientOid | <code>string</code> | No | client order id, defaults to uuid if not passed |
| params.remark | <code>string</code> | No | remark for the order, length cannot exceed 100 utf8 characters |
| params.tradeType | <code>string</code> | No | 'TRADE', // TRADE, MARGIN_TRADE // not used with margin orders limit orders --------------------------------------------------- |
| params.cancelAfter | <code>float</code> | No | long, // cancel after n seconds, requires timeInForce to be GTT |
| params.hidden | <code>bool</code> | No | false, // Order will not be displayed in the order book |
| params.iceberg | <code>bool</code> | No | false, // Only a portion of the order is displayed in the order book |
| params.visibleSize | <code>string</code> | No | this.amountToPrecision (symbol, visibleSize), // The maximum visible size of an iceberg order market orders -------------------------------------------------- |
| params.funds | <code>string</code> | No | // Amount of quote currency to use stop orders ---------------------------------------------------- |
| params.stop | <code>string</code> | No | Either loss or entry, the default is loss. Requires triggerPrice to be defined margin orders -------------------------------------------------- |
| params.leverage | <code>float</code> | No | Leverage size of the order |
| params.stp | <code>string</code> | No | '', // self trade prevention, CN, CO, CB or DC |
| params.autoBorrow | <code>bool</code> | No | false, // The system will first borrow you funds at the optimal interest rate and then place an order for you |
| params.hf | <code>bool</code> | No | false, // true for hf order |
| params.test | <code>bool</code> | No | set to true to test an order, no order will be created but the request will be validated |
| params.sync | <code>bool</code> | No | set to true to use the hf sync call |
kucoin.createSpotOrder (symbol, type, side, amount[, price, params])
<a name="createContractOrder" id="createcontractorder"></a>
helper method for creating contract orders
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| type | <code>string</code> | Yes | 'limit' or 'market' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | the amount of currency to trade |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.takeProfit | <code>object</code> | No | takeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered and the triggerPriceType |
| params.stopLoss | <code>object</code> | No | stopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered and the triggerPriceType |
| params.triggerPrice | <code>float</code> | No | The price a trigger order is triggered at |
| params.stopLossPrice | <code>float</code> | No | price to trigger stop-loss orders |
| params.takeProfitPrice | <code>float</code> | No | price to trigger take-profit orders |
| params.reduceOnly | <code>bool</code> | No | A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. |
| params.timeInForce | <code>string</code> | No | GTC, GTT, IOC, or FOK, default is GTC, limit orders only |
| params.postOnly | <code>bool</code> | No | Post only flag, invalid when timeInForce is IOC or FOK |
| params.cost | <code>float</code> | No | the cost of the order in units of USDT |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', default is 'isolated' |
| params.hedged | <code>bool</code> | No | swap and future only true for hedged mode, false for one way mode, default is false ----------------- Exchange Specific Parameters ----------------- |
| params.leverage | <code>float</code> | No | Leverage size of the order (mandatory param in request, default is 1) |
| params.clientOid | <code>string</code> | No | client order id, defaults to uuid if not passed |
| params.remark | <code>string</code> | No | remark for the order, length cannot exceed 100 utf8 characters |
| params.stop | <code>string</code> | No | '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.triggerPriceType | <code>string</code> | No | "last", "mark", "index" - defaults to "mark" |
| params.stopPriceType | <code>string</code> | No | exchange-specific alternative for triggerPriceType: TP, IP or MP |
| params.closeOrder | <code>bool</code> | No | set to true to close position |
| params.test | <code>bool</code> | No | set to true to use the test order endpoint (does not submit order, use to validate params) |
| params.forceHold | <code>bool</code> | No | A 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.positionSide | <code>string</code> | No | swap and future only hedged two-way position side, LONG or SHORT |
kucoin.createContractOrder (symbol, type, side, amount[, price, params])
<a name="createUtaOrder" id="createutaorder"></a>
helper method for creating uta orders
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an order structure
See: https://www.kucoin.com/docs-new/rest/ua/place-order
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| type | <code>string</code> | Yes | 'limit' or 'market' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | the amount of currency to trade |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | <code>string</code> | No | client order id, defaults to uuid if not passed |
| params.cost | <code>float</code> | No | the cost of the order in units of quote currency |
| params.timeInForce | <code>string</code> | No | GTC, GTD, IOC, FOK or PO |
| params.postOnly | <code>bool</code> | No | Post only flag, invalid when timeInForce is IOC or FOK (default is false) |
| params.reduceOnly | <code>bool</code> | No | contract markets only A mark to reduce the position size only. Set to false by default |
| params.triggerPrice | <code>float</code> | No | The price a trigger order is triggered at |
| params.triggerDirection | <code>string</code> | No | 'ascending' or 'descending', the direction the triggerPrice is triggered from, requires triggerPrice |
| params.triggerPriceType | <code>string</code> | No | contract markets only "last", "mark", "index" - defaults to "mark" |
| params.stopLossPrice | <code>float</code> | No | price to trigger stop-loss orders |
| params.takeProfitPrice | <code>float</code> | No | price to trigger take-profit orders |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', (default is 'cross' for margin orders, default is 'isolated' for contract orders) Exchange-specific parameters ------------------------------------------------- |
| params.accountMode | <code>string</code> | No | 'unified' or 'classic', default is 'unified' |
| params.stp | <code>string</code> | No | '', // self trade prevention, CN, CO, CB or DC |
| params.cancelAfter | <code>int</code> | No | Cancel After N Seconds (Calculated from the time of entering the matching engine), only effective when timeInForce is GTD |
| params.sizeUnit | <code>string</code> | No | contracts only 'BASECCY' (amount of base currency) or 'UNIT' (number of contracts), default is 'UNIT' Classic account parameters |
| params.autoBorrow | <code>bool</code> | No | classic margin orders only |
| params.autoRepay | <code>bool</code> | No | classic margin orders only |
| params.hedged | <code>string</code> | No | classic contract orders only true for hedged mode, false for one way mode, default is false |
| params.leverage | <code>int</code> | No | classic contract orders with isolated marginMode only Leverage size of the order |
kucoin.createUtaOrder (symbol, type, side, amount[, price, params])
<a name="createMarketOrderWithCost" id="createmarketorderwithcost"></a>
create a market order by providing the symbol, side and cost
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| cost | <code>float</code> | Yes | how much you want to trade in units of the quote currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.createMarketOrderWithCost (symbol, side, cost[, params])
<a name="createMarketBuyOrderWithCost" id="createmarketbuyorderwithcost"></a>
create a market buy order by providing the symbol and cost
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| cost | <code>float</code> | Yes | how much you want to trade in units of the quote currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.createMarketBuyOrderWithCost (symbol, cost[, params])
<a name="createMarketSellOrderWithCost" id="createmarketsellorderwithcost"></a>
create a market sell order by providing the symbol and cost
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| cost | <code>float</code> | Yes | how much you want to trade in units of the quote currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.createMarketSellOrderWithCost (symbol, cost[, params])
<a name="createOrders" id="createorders"></a>
create a list of trade orders
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra 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])
<a name="createSpotOrders" id="createspotorders"></a>
helper method for creating spot orders in batch
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.hf | <code>bool</code> | No | false, // true for hf orders |
| params.sync | <code>bool</code> | No | false, // true to use the hf sync call |
kucoin.createSpotOrders (orders[, params])
<a name="createContractOrders" id="createcontractorders"></a>
helper method for creating contract orders in batch
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an order structure
See: https://www.kucoin.com/docs-new/rest/futures-trading/orders/batch-add-orders
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.createContractOrders (orders[, params])
<a name="editOrder" id="editorder"></a>
edit an order, kucoin currently only supports the modification of HF orders
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an order structure
See: https://www.kucoin.com/docs-new/rest/spot-trading/orders/modify-order
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | not used |
| side | <code>string</code> | Yes | not used |
| amount | <code>float</code> | Yes | how much of the currency you want to trade in units of the base currency |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | <code>string</code> | No | client order id, defaults to id if not passed |
kucoin.editOrder (id, symbol, type, side, amount[, price, params])
<a name="cancelOrder" id="cancelorder"></a>
cancels an open order
Kind: instance method of <code>kucoin</code>
Returns: Response from the exchange
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | 'spot' or 'swap', used if symbol is not provided (default is 'spot') |
| params.marginMode | <code>string</code> | No | spot only 'cross' or 'isolated' |
| params.uta | <code>boolean</code> | No | true 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])
<a name="cancelSpotOrder" id="cancelspotorder"></a>
helper method for cancelling spot orders
Kind: instance method of <code>kucoin</code>
Returns: Response from the exchange
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>bool</code> | No | True if cancelling a stop order |
| params.hf | <code>bool</code> | No | false, // true for hf order |
| params.sync | <code>bool</code> | No | false, // true to use the hf sync call |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' |
kucoin.cancelSpotOrder (id, symbol[, params])
<a name="cancelContractOrder" id="cancelcontractorder"></a>
helper method for cancelling contract orders
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - An order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | <code>string</code> | No | cancel order by client order id |
kucoin.cancelContractOrder (id, symbol[, params])
<a name="cancelUtaOrder" id="cancelutaorder"></a>
helper method for cancelling uta orders
Kind: instance method of <code>kucoin</code>
Returns: Response from the exchange
See: https://www.kucoin.com/docs-new/rest/ua/cancel-order
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountMode | <code>string</code> | No | 'unified' or 'classic' (default is 'unified') |
| params.clientOrderId | <code>string</code> | No | client order id, required if id is not provided |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', required if fetching a margin order (unified accountMode supports only cross margin) |
kucoin.cancelUtaOrder (id, symbol[, params])
<a name="cancelAllOrders" id="cancelallorders"></a>
cancel all open orders
Kind: instance method of <code>kucoin</code>
Returns: Response from the exchange
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | 'spot' or 'swap', used if symbol is not provided (default is 'spot') |
| params.marginMode | <code>string</code> | No | spot only 'cross' or 'isolated' |
| params.uta | <code>boolean</code> | No | true 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])
<a name="cancelAllSpotOrders" id="cancelallspotorders"></a>
helper method for cancelling all spot orders
Kind: instance method of <code>kucoin</code>
Returns: Response from the exchange
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>bool</code> | No | invalid for isolated margin true if cancelling all stop orders |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' |
| params.orderIds | <code>string</code> | No | stop orders only Comma separated order IDs |
| params.hf | <code>bool</code> | No | false, // true for hf order |
kucoin.cancelAllSpotOrders (symbol[, params])
<a name="cancelAllContractOrders" id="cancelallcontractorders"></a>
helper method for cancelling all contract orders
Kind: instance method of <code>kucoin</code>
Returns: Response from the exchange
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>object</code> | No | When true, all the trigger orders will be cancelled |
kucoin.cancelAllContractOrders (symbol[, params])
<a name="cancelAllUtaOrders" id="cancelallutaorders"></a>
helper method for cancelling all uta orders
Kind: instance method of <code>kucoin</code>
Returns: Response from the exchange
See: https://www.kucoin.com/docs-new/rest/ua/batch-cancel-order-by-symbol
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>bool</code> | No | true if cancelling all stop orders |
| params.marginMode | <code>string</code> | No | 'CROSS' or 'ISOLATED' |
kucoin.cancelAllUtaOrders (symbol[, params])
<a name="fetchOrdersByStatus" id="fetchordersbystatus"></a>
fetches a list of orders placed on the exchange
Kind: instance method of <code>kucoin</code>
Returns: An array of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| status | <code>string</code> | Yes | 'active' or 'closed', only 'active' is valid for stop orders |
| symbol | <code>string</code> | Yes | unified symbol for the market to retrieve orders from |
| since | <code>int</code> | No | timestamp in ms of the earliest order to retrieve |
| limit | <code>int</code> | No | The maximum number of orders to retrieve |
| params | <code>object</code> | No | exchange specific parameters |
| params.uta | <code>boolean</code> | No | true 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])
<a name="fetchSpotOrdersByStatus" id="fetchspotordersbystatus"></a>
fetch a list of spot orders
Kind: instance method of <code>kucoin</code>
Returns: An array of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| status | <code>string</code> | Yes | not used for stop orders 'open' or 'closed' |
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | timestamp in ms of the earliest order |
| limit | <code>int</code> | No | max number of orders to return |
| params | <code>object</code> | No | exchange specific params |
| params.until | <code>int</code> | No | end time in ms |
| params.side | <code>string</code> | No | buy or sell |
| params.type | <code>string</code> | No | limit, market, limit_stop or market_stop |
| params.tradeType | <code>string</code> | No | TRADE for spot trading, MARGIN_TRADE or MARGIN_ISOLATED_TRADE for Margin Trading |
| params.currentPage | <code>int</code> | No | trigger orders only current page |
| params.orderIds | <code>string</code> | No | trigger orders only comma separated order ID list |
| params.trigger | <code>bool</code> | No | True if fetching a trigger order |
| params.hf | <code>bool</code> | No | false, // true for hf order |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', only for margin orders |
kucoin.fetchSpotOrdersByStatus (status, symbol[, since, limit, params])
<a name="fetchContractOrdersByStatus" id="fetchcontractordersbystatus"></a>
fetches a list of contract orders placed on the exchange
Kind: instance method of <code>kucoin</code>
Returns: An array of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| status | <code>string</code> | Yes | 'active' or 'closed', only 'active' is valid for stop orders |
| symbol | <code>string</code> | Yes | unified symbol for the market to retrieve orders from |
| since | <code>int</code> | No | timestamp in ms of the earliest order to retrieve |
| limit | <code>int</code> | No | The maximum number of orders to retrieve |
| params | <code>object</code> | No | exchange specific parameters |
| params.trigger | <code>bool</code> | No | set to true to retrieve untriggered stop orders |
| params.until | <code>int</code> | No | End time in ms |
| params.side | <code>string</code> | No | buy or sell |
| params.type | <code>string</code> | No | limit or market |
| params.paginate | <code>boolean</code> | No | default 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])
<a name="fetchUtaOrdersByStatus" id="fetchutaordersbystatus"></a>
helper method for fetching orders by status with uta endpoint
Kind: instance method of <code>kucoin</code>
Returns: An array of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| status | <code>string</code> | Yes | 'active' or 'closed', only 'active' is valid for stop orders |
| symbol | <code>string</code> | Yes | unified symbol for the market to retrieve orders from |
| since | <code>int</code> | No | timestamp in ms of the earliest order to retrieve |
| limit | <code>int</code> | No | The maximum number of orders to retrieve |
| params | <code>object</code> | No | exchange specific parameters |
| params.until | <code>int</code> | No | End time in ms |
| params.side | <code>string</code> | No | closed orders only 'BUY' or 'SELL' |
| params.accountMode | <code>string</code> | No | 'unified' or 'classic' (default is unified) |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', only for margin orders (unified accountMode supports only cross margin) |
| params.paginate | <code>boolean</code> | No | default 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])
<a name="fetchClosedOrders" id="fetchclosedorders"></a>
fetches information on multiple closed orders made by the user
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<Order></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | end time in ms |
| params.side | <code>string</code> | No | buy or sell |
| params.type | <code>string</code> | No | limit, market, limit_stop or market_stop |
| params.tradeType | <code>string</code> | No | TRADE for spot trading, MARGIN_TRADE for Margin Trading |
| params.trigger | <code>bool</code> | No | True if fetching a trigger order |
| params.hf | <code>bool</code> | No | false, // true for hf order |
| params.paginate | <code>boolean</code> | No | default 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])
<a name="fetchOpenOrders" id="fetchopenorders"></a>
fetch all unfilled currently open orders
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<Order></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch open orders for |
| limit | <code>int</code> | No | the maximum number of open orders structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | end time in ms |
| params.trigger | <code>bool</code> | No | true if fetching trigger orders |
| params.side | <code>string</code> | No | buy or sell |
| params.type | <code>string</code> | No | limit, market, limit_stop or market_stop |
| params.tradeType | <code>string</code> | No | TRADE for spot trading, MARGIN_TRADE for Margin Trading |
| params.currentPage | <code>int</code> | No | trigger orders only current page |
| params.orderIds | <code>string</code> | No | trigger orders only comma separated order ID list |
| params.hf | <code>bool</code> | No | false, // true for hf order |
| params.paginate | <code>boolean</code> | No | default 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])
<a name="fetchOrder" id="fetchorder"></a>
fetches information on an order made by the user
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - An order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | 'spot' or 'swap', used if symbol is not provided (default is 'spot') |
| params.uta | <code>bool</code> | No | true 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])
<a name="fetchSpotOrder" id="fetchspotorder"></a>
fetch a spot order
Kind: instance method of <code>kucoin</code>
Returns: An order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | Order id |
| symbol | <code>string</code> | Yes | not sent to exchange except for trigger orders with clientOid, but used internally by CCXT to filter |
| params | <code>object</code> | No | exchange specific parameters |
| params.trigger | <code>bool</code> | No | true if fetching a trigger order |
| params.hf | <code>bool</code> | No | false, // true for hf order |
| params.clientOid | <code>bool</code> | No | unique order id created by users to identify their orders |
| params.marginMode | <code>object</code> | No | 'cross' or 'isolated' |
kucoin.fetchSpotOrder (id, symbol[, params])
<a name="fetchContractOrder" id="fetchcontractorder"></a>
fetc contract order
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - An order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchContractOrder (id, symbol[, params])
<a name="fetchUtaOrder" id="fetchutaorder"></a>
fetch uta order
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - An order structure
See: https://www.kucoin.com/docs-new/rest/ua/get-order-details
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountMode | <code>string</code> | No | 'unified' or 'classic' (default is 'unified') |
| params.clientOrderId | <code>string</code> | No | client order id, required if id is not provided |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', required if fetching a margin order (unified accountMode supports only cross margin) |
kucoin.fetchUtaOrder (id, symbol[, params])
<a name="fetchOrderTrades" id="fetchordertrades"></a>
fetch all the trades made from a single order
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | 'spot' or 'swap', used if symbol is not provided (default is 'spot') |
| params.uta | <code>boolean</code> | No | set to true if fetching trades from uta endpoint, default is false. |
kucoin.fetchOrderTrades (id, symbol[, since, limit, params])
<a name="fetchMyTrades" id="fetchmytrades"></a>
fetch all trades made by the user
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
| params.type | <code>string</code> | No | '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])
<a name="fetchMySpotTrades" id="fetchmyspottrades"></a>
fetch all spot trades made by the user
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.hf | <code>bool</code> | No | false, // true for hf order |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', only for margin trades |
| params.paginate | <code>boolean</code> | No | default 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])
<a name="fetchMyContractTrades" id="fetchmycontracttrades"></a>
fetch all contract trades made by the user
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See: https://www.kucoin.com/docs-new/rest/futures-trading/orders/get-trade-history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | End time in ms |
| params.paginate | <code>boolean</code> | No | default 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])
<a name="fetchMyUtaTrades" id="fetchmyutatrades"></a>
fetch all trades made by the user
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See: https://www.kucoin.com/docs-new/rest/ua/get-trade-history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve (default is 50, max is 200) |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.accountMode | <code>string</code> | No | 'unified' or 'classic', defaults to 'unified' |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', only for margin trades (unified accountMode support only cross margin) |
| params.side | <code>string</code> | No | 'BUY' or 'SELL' (both if not provided) |
| params.paginate | <code>boolean</code> | No | default 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])
<a name="fetchTrades" id="fetchtrades"></a>
get the list of most recent trades for a particular symbol
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
kucoin.fetchTrades (symbol[, since, limit, params])
<a name="fetchTradingFee" id="fetchtradingfee"></a>
fetch the trading fees for a market
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a fee structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) endpoint, defaults to false |
kucoin.fetchTradingFee (symbol[, params])
<a name="withdraw" id="withdraw"></a>
make a withdrawal
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a transaction structure
See: https://www.kucoin.com/docs-new/rest/account-info/withdrawals/withdraw-v3
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | the amount to withdraw |
| address | <code>string</code> | Yes | the address to withdraw to |
| tag | <code>string</code> | Yes | |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.withdraw (code, amount, address, tag[, params])
<a name="fetchDeposits" id="fetchdeposits"></a>
fetch all deposits made to an account
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of transaction structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch deposits for |
| limit | <code>int</code> | No | the maximum number of deposits structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.paginate | <code>boolean</code> | No | main account only default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
| params.accountType | <code>string</code> | No | 'main' or 'contract' (default is 'main') |
kucoin.fetchDeposits (code[, since, limit, params])
<a name="fetchContractDeposits" id="fetchcontractdeposits"></a>
helper method for fetching deposits for futures accounts
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch deposits for |
| limit | <code>int</code> | No | the maximum number of deposits structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchContractDeposits (code[, since, limit, params])
<a name="fetchWithdrawals" id="fetchwithdrawals"></a>
fetch all withdrawals made from an account
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of transaction structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch withdrawals for |
| limit | <code>int</code> | No | the maximum number of withdrawals structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.paginate | <code>boolean</code> | No | main account only default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
| params.accountType | <code>string</code> | No | 'main' or 'contract' (default is 'main') |
kucoin.fetchWithdrawals (code[, since, limit, params])
<a name="fetchContractWithdrawals" id="fetchcontractwithdrawals"></a>
helper method for fetching withdrawals for futures accounts
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch withdrawals for |
| limit | <code>int</code> | No | the maximum number of withdrawals structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchContractWithdrawals (code[, since, limit, params])
<a name="fetchBalance" id="fetchbalance"></a>
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a balance structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>object</code> | No | 'cross' or 'isolated', margin type for fetching margin balance |
| params.type | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.hf | <code>object</code> | No | default if false if true, the result includes the balance of the high frequency account |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) endpoint, defaults to false |
kucoin.fetchBalance ([params])
<a name="fetchContractBalance" id="fetchcontractbalance"></a>
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a balance structure
See: https://www.kucoin.com/docs-new/rest/account-info/account-funding/get-account-futures
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.code | <code>object</code> | No | the unified currency code to fetch the balance for, if not provided, the default .options['fetchBalance']['code'] will be used |
kucoin.fetchContractBalance ([params])
<a name="fetchUtaBalance" id="fetchutabalance"></a>
helper method for fetching balance with unified trading account (uta) endpoint
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a balance structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | 'unified', 'spot', 'funding', 'cross', 'isolated' or 'swap' (default is 'unified') |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', margin type for fetching margin balance, only applicable if type is margin (default is cross) |
kucoin.fetchUtaBalance ([params])
<a name="transfer" id="transfer"></a>
transfer currency internally between wallets on the same account
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a transfer structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | amount to transfer |
| fromAccount | <code>string</code> | Yes | account to transfer from |
| toAccount | <code>string</code> | Yes | account to transfer to |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set 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])
<a name="transferUta" id="transferuta"></a>
transfer currency internally between wallets on the same account with uta endpoint
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a transfer structure
See: https://www.kucoin.com/docs-new/rest/ua/flex-transfer
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | amount to transfer |
| fromAccount | <code>string</code> | Yes | account to transfer from |
| toAccount | <code>string</code> | Yes | account to transfer to |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.transferType | <code>string</code> | No | INTERNAL, PARENT_TO_SUB, SUB_TO_PARENT, SUB_TO_SUB (default is INTERNAL) |
| params.fromUserId | <code>string</code> | No | required if transferType is SUB_TO_PARENT or SUB_TO_SUB |
| params.toUserId | <code>string</code> | No | required if transferType is PARENT_TO_SUB or SUB_TO_SUB |
kucoin.transferUta (code, amount, fromAccount, toAccount[, params])
<a name="transferClassic" id="transferclassic"></a>
transfer currency internally between wallets on the same account with classic endpoints
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a transfer structure
See: https://www.kucoin.com/docs-new/rest/account-info/transfer/flex-transfer?lang=en_US&
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | amount to transfer |
| fromAccount | <code>string</code> | Yes | account to transfer from |
| toAccount | <code>string</code> | Yes | account to transfer to |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.transferType | <code>string</code> | No | INTERNAL, PARENT_TO_SUB, SUB_TO_PARENT (default is INTERNAL) |
| params.fromUserId | <code>string</code> | No | required if transferType is SUB_TO_PARENT |
| params.toUserId | <code>string</code> | No | required if transferType is PARENT_TO_SUB |
kucoin.transferClassic (code, amount, fromAccount, toAccount[, params])
<a name="fetchLedger" id="fetchledger"></a>
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a ledger structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code, default is undefined |
| since | <code>int</code> | No | timestamp in ms of the earliest ledger entry, default is undefined |
| limit | <code>int</code> | No | max number of ledger entries to return, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.hf | <code>boolean</code> | No | default false, when true will fetch ledger entries for the high frequency trading account |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.uta | <code>boolean</code> | No | default false, when true will fetch ledger entries for the unified trading account (UTA) instead of the regular accounts endpoint |
| params.paginate | <code>boolean</code> | No | default 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])
<a name="fetchBorrowInterest" id="fetchborrowinterest"></a>
fetch the interest owed by the user for borrowing currency for margin trading
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of borrow interest structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code |
| symbol | <code>string</code> | No | unified market symbol, required for isolated margin |
| since | <code>int</code> | No | the earliest time in ms to fetch borrrow interest for |
| limit | <code>int</code> | No | the maximum number of structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' default is 'cross' |
kucoin.fetchBorrowInterest ([code, symbol, since, limit, params])
<a name="fetchBorrowRateHistories" id="fetchborrowratehistories"></a>
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 <code>kucoin</code>
Returns: <code>object</code> - 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
| Param | Type | Required | Description |
|---|---|---|---|
| codes | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified currency codes, default is undefined |
| since | <code>int</code> | No | timestamp in ms of the earliest borrowRate, default is undefined |
| limit | <code>int</code> | No | max number of borrow rate prices to return, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' default is 'cross' |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
kucoin.fetchBorrowRateHistories (codes[, since, limit, params])
<a name="fetchBorrowRateHistory" id="fetchborrowratehistory"></a>
retrieves a history of a currencies borrow interest rate at specific time slots
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - an array of borrow rate structures
See: https://www.kucoin.com/docs-new/rest/margin-trading/debit/get-interest-history
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | timestamp for the earliest borrow rate |
| limit | <code>int</code> | No | the maximum number of borrow rate structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' default is 'cross' |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
kucoin.fetchBorrowRateHistory (code[, since, limit, params])
<a name="fetchCrossBorrowRate" id="fetchcrossborrowrate"></a>
fetch the rate of interest to borrow a currency for margin trading
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a borrow rate structure
See: https://www.kucoin.com/docs-new/rest/ua/get-borrowing-rates-and-limits
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchCrossBorrowRate (code[, params])
<a name="borrowCrossMargin" id="borrowcrossmargin"></a>
create a loan to borrow margin
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a margin loan structure
See: https://www.kucoin.com/docs-new/rest/margin-trading/debit/borrow
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency to borrow |
| amount | <code>float</code> | Yes | the amount to borrow |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoints |
| params.timeInForce | <code>string</code> | No | either IOC or FOK |
kucoin.borrowCrossMargin (code, amount[, params])
<a name="borrowIsolatedMargin" id="borrowisolatedmargin"></a>
create a loan to borrow margin
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a margin loan structure
See: https://www.kucoin.com/docs-new/rest/margin-trading/debit/borrow
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, required for isolated margin |
| code | <code>string</code> | Yes | unified currency code of the currency to borrow |
| amount | <code>float</code> | Yes | the amount to borrow |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoints |
| params.timeInForce | <code>string</code> | No | either IOC or FOK |
kucoin.borrowIsolatedMargin (symbol, code, amount[, params])
<a name="repayCrossMargin" id="repaycrossmargin"></a>
repay borrowed margin and interest
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a margin loan structure
See: https://www.kucoin.com/docs-new/rest/margin-trading/debit/repay
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency to repay |
| amount | <code>float</code> | Yes | the amount to repay |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoints |
kucoin.repayCrossMargin (code, amount[, params])
<a name="repayIsolatedMargin" id="repayisolatedmargin"></a>
repay borrowed margin and interest
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a margin loan structure
See: https://www.kucoin.com/docs-new/rest/margin-trading/debit/repay
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| code | <code>string</code> | Yes | unified currency code of the currency to repay |
| amount | <code>float</code> | Yes | the amount to repay |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoints |
kucoin.repayIsolatedMargin (symbol, code, amount[, params])
<a name="fetchDepositWithdrawFees" id="fetchdepositwithdrawfees"></a>
fetch deposit and withdraw fees - IMPORTANT use fetchDepositWithdrawFee to get more in-depth info
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a list of fee structures
See: https://docs.kucoin.com/#get-currencies
| Param | Type | Required | Description |
|---|---|---|---|
| codes | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified currency codes |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchDepositWithdrawFees (codes[, params])
<a name="fetchLeverage" id="fetchleverage"></a>
fetch the set leverage for a market
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a leverage structure
See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/get-cross-margin-leverage
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchLeverage (symbol[, params])
<a name="setLeverage" id="setleverage"></a>
set the level of leverage for a market
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - response from the exchange
See
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | <code>int</code> | No | New 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 |
| symbol | <code>string</code> | No | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) |
| params.marginMode | <code>string</code> | No | spot non-uta only 'cross' or 'isolated' default is 'cross' |
| params.code | <code>string</code> | No | uta margin only the unified currency code for the margin to set the leverage for |
kucoin.setLeverage ([leverage, symbol, params])
<a name="setContractLeverage" id="setcontractleverage"></a>
set the level of leverage for a market
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - response from the exchange
See
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | <code>float</code> | Yes | the rate of leverage |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) |
kucoin.setContractLeverage (leverage, symbol[, params])
<a name="fetchFundingInterval" id="fetchfundinginterval"></a>
fetch the current funding rate interval
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a funding rate structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchFundingInterval (symbol[, params])
<a name="fetchFundingRate" id="fetchfundingrate"></a>
fetch the current funding rate
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a funding rate structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) |
kucoin.fetchFundingRate (symbol[, params])
<a name="fetchFundingRateHistory" id="fetchfundingratehistory"></a>
fetches historical funding rate prices
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of funding rate structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the funding rate history for |
| since | <code>int</code> | No | not used by kucuoinfutures |
| limit | <code>int</code> | No | the maximum amount of funding rate structures to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | end time in ms |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to true |
kucoin.fetchFundingRateHistory (symbol[, since, limit, params])
<a name="fetchFundingHistory" id="fetchfundinghistory"></a>
fetch the history of funding payments paid and received on this account
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a funding history structure
See: https://www.kucoin.com/docs-new/rest/futures-trading/funding-fees/get-private-funding-history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch funding history for |
| limit | <code>int</code> | No | the maximum number of funding history structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
kucoin.fetchFundingHistory (symbol[, since, limit, params])
<a name="fetchPosition" id="fetchposition"></a>
fetch data on an open position
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a position structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the position is held in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
| params.pageSize | <code>integer</code> | No | uta only page size for the uta endpoint (default 50, max 200) |
| params.pageNumber | <code>integer</code> | No | uta only page number for the uta endpoint (default 1) |
kucoin.fetchPosition (symbol[, params])
<a name="fetchPositions" id="fetchpositions"></a>
fetch all open positions
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of position structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
| params.pageSize | <code>integer</code> | No | uta only page size for the uta endpoint (default 50, max 200) |
| params.pageNumber | <code>integer</code> | No | uta only page number for the uta endpoint (default 1) |
kucoin.fetchPositions (symbols[, params])
<a name="fetchPositionsHistory" id="fetchpositionshistory"></a>
fetches historical positions
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of position structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| since | <code>int</code> | No | the earliest time in ms to fetch position history for |
| limit | <code>int</code> | No | the maximum number of entries to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | closing end time |
| params.pageId | <code>int</code> | No | page id |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
kucoin.fetchPositionsHistory ([symbols, since, limit, params])
<a name="cancelOrders" id="cancelorders"></a>
cancel multiple orders for contract markets
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| ids | <code>Array<string></code> | Yes | order ids |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderIds | <code>Array<string></code> | No | client order ids |
| params.uta | <code>boolean</code> | No | set to true to use the unified trading account (uta) endpoint, defaults to false for the contract orders |
| params.accountMode | <code>string</code> | No | for uta endpoint only 'unified' or 'classic' (default is 'unified') |
| params.marginMode | <code>string</code> | No | for margin orders only 'cross' or 'isolated' (unified accountMode supports cross margin only) |
kucoin.cancelOrders (ids, symbol[, params])
<a name="addMargin" id="addmargin"></a>
add margin
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a margin structure
See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/add-isolated-margin
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| amount | <code>float</code> | Yes | amount of margin to add |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.positionSide | <code>string</code> | No | required for hedged position 'BOTH', 'LONG' or 'SHORT' (default is 'BOTH') |
kucoin.addMargin (symbol, amount[, params])
<a name="fetchMarginMode" id="fetchmarginmode"></a>
fetches the margin mode of a trading pair
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a margin mode structure
See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/get-margin-mode
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the margin mode for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchMarginMode (symbol[, params])
<a name="setMarginMode" id="setmarginmode"></a>
set margin mode to 'cross' or 'isolated'
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - response from the exchange
See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/switch-margin-mode
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | <code>string</code> | Yes | 'cross' or 'isolated' |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.setMarginMode (marginMode, symbol[, params])
<a name="setPositionMode" id="setpositionmode"></a>
set hedged to true or false for a market
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a response from the exchange
See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/switch-position-mode
| Param | Type | Required | Description |
|---|---|---|---|
| hedged | <code>bool</code> | Yes | set to true to use two way position |
| symbol | <code>string</code> | No | not used by bybit setPositionMode () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.setPositionMode (hedged[, symbol, params])
<a name="fetchPositionMode" id="fetchpositionmode"></a>
fetchs the position mode, hedged or one way
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - 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
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified symbol of the market to fetch the position mode for (not used in blofin fetchPositionMode) |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchPositionMode ([symbol, params])
<a name="closePosition" id="closeposition"></a>
closes open positions for a market
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - A list of position structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| side | <code>string</code> | Yes | not used by kucoin closePositions |
| params | <code>object</code> | No | extra parameters specific to the okx api endpoint |
| params.clientOrderId | <code>string</code> | No | client order id of the order |
kucoin.closePosition (symbol, side[, params])
<a name="fetchMarketLeverageTiers" id="fetchmarketleveragetiers"></a>
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a leverage tiers structure
See: https://www.kucoin.com/docs-new/rest/futures-trading/positions/get-isolated-margin-risk-limit
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true to fetch leverage tiers for unified trading account instead of futures account (default is false) |
kucoin.fetchMarketLeverageTiers (symbol[, params])
<a name="fetchLeverageTiers" id="fetchleveragetiers"></a>
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a dictionary of leverage tiers structures, indexed by market symbols
See: https://www.kucoin.com/docs-new/rest/ua/get-position-tiers
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.fetchLeverageTiers (symbols[, params])
<a name="fetchOpenInterests" id="fetchopeninterests"></a>
Retrieves the open interest for a list of symbols
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an open interest structurehttps://docs.ccxt.com/?id=open-interest-structure
See: https://www.kucoin.com/docs-new/rest/ua/get-futures-open-interset
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | Unified CCXT market symbol |
| params | <code>object</code> | No | exchange specific parameters |
kucoin.fetchOpenInterests ([symbols, params])
<a name="fetchOpenInterestHistory" id="fetchopeninteresthistory"></a>
Retrieves the open interest history of a currency
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - an array of open interest structures
See: https://www.kucoin.com/docs-new/rest/ua/get-futures-open-interset
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| timeframe | <code>string</code> | Yes | '5m', '15m', '30m', '1h', '4h' or '1d' |
| since | <code>int</code> | No | the time(ms) of the earliest record to retrieve as a unix timestamp |
| limit | <code>int</code> | No | default 30,max 200 |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.paginate | <code>boolean</code> | No | default 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])
<a name="isUTAEnabled" id="isutaenabled"></a>
returns true or false so the user can check if unified account is enabled
Kind: instance method of <code>kucoin</code>
Returns: <code>boolean</code> - true if unified account is enabled, false otherwise
See: https://www.kucoin.com/docs-new/rest/ua/get-account-mode
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.isUTAEnabled ([params])
<a name="fetchTransfers" id="fetchtransfers"></a>
fetch a history of internal transfers made on an account
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of transfer structures
See: https://www.kucoin.com/docs-new/rest/account-info/account-funding/get-account-ledgers-spot-margin
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code of the currency transferred |
| since | <code>int</code> | No | the earliest time in ms to fetch transfers for |
| limit | <code>int</code> | No | the maximum number of transfer structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch transfers for |
| params.paginate | <code>boolean</code> | No | default 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])
<a name="watchTicker" id="watchticker"></a>
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), default is false |
kucoin.watchTicker (symbol[, params])
<a name="unWatchTicker" id="unwatchticker"></a>
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), default is false |
kucoin.unWatchTicker (symbol[, params])
<a name="watchTickers" id="watchtickers"></a>
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 <code>kucoin</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.method | <code>string</code> | No | spot markets only either '/market/snapshot' or '/market/ticker' default is '/market/ticker' |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), default is false |
kucoin.watchTickers (symbols[, params])
<a name="watchBidsAsks" id="watchbidsasks"></a>
watches best bid & ask for symbols
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.watchBidsAsks (symbols[, params])
<a name="watchOHLCV" id="watchohlcv"></a>
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), default is false |
kucoin.watchOHLCV (symbol, timeframe[, since, limit, params])
<a name="unWatchOHLCV" id="unwatchohlcv"></a>
unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), default is false |
kucoin.unWatchOHLCV (symbol, timeframe[, params])
<a name="watchTrades" id="watchtrades"></a>
get the list of most recent trades for a particular symbol
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), default is false |
kucoin.watchTrades (symbol[, since, limit, params])
<a name="watchTradesForSymbols" id="watchtradesforsymbols"></a>
get the list of most recent trades for a particular symbol
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.watchTradesForSymbols (symbols[, since, limit, params])
<a name="unWatchTradesForSymbols" id="unwatchtradesforsymbols"></a>
unWatches trades stream
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>string</code> | Yes | |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.unWatchTradesForSymbols (symbols[, params])
<a name="unWatchTrades" id="unwatchtrades"></a>
unWatches trades stream
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), default is false |
kucoin.unWatchTrades (symbol[, params])
<a name="watchOrderBook" id="watchorderbook"></a>
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), default is false |
| params.method | <code>string</code> | No | either '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2' |
kucoin.watchOrderBook (symbol[, limit, params])
<a name="unWatchOrderBook" id="unwatchorderbook"></a>
unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), default is false |
| params.method | <code>string</code> | No | either '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2' |
kucoin.unWatchOrderBook (symbol[, params])
<a name="watchOrderBookForSymbols" id="watchorderbookforsymbols"></a>
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified array of symbols |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
kucoin.watchOrderBookForSymbols (symbols[, limit, params])
<a name="unWatchOrderBookForSymbols" id="unwatchorderbookforsymbols"></a>
unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified array of symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.method | <code>string</code> | No | either '/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])
<a name="watchOrders" id="watchorders"></a>
watches information on multiple orders made by the user
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) |
| params.trigger | <code>boolean</code> | No | trigger orders are watched if true |
| params.type | <code>string</code> | No | 'spot' or 'swap' (default is 'spot' if symbol is not provided) |
kucoin.watchOrders (symbol[, since, limit, params])
<a name="watchMyTrades" id="watchmytrades"></a>
watches information on multiple trades made by the user on spot
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market trades were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trade structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) |
| params.method | <code>string</code> | No | classic (non-uta) account only '/spotMarket/tradeOrders' or '/spot/tradeFills' or '/contractMarket/tradeOrders', default is '/spotMarket/tradeOrders' |
kucoin.watchMyTrades (symbol[, since, limit, params])
<a name="watchBalance" id="watchbalance"></a>
watch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a balance structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) |
| params.type | <code>string</code> | No | classic (non-uta) account only 'spot' or 'swap' (default is 'spot') |
kucoin.watchBalance ([params])
<a name="watchPosition" id="watchposition"></a>
watch open positions for a specific symbol
Kind: instance method of <code>kucoin</code>
Returns: <code>object</code> - a position structure
See: https://www.kucoin.com/docs-new/3470093w0
| Param | Type | Description |
|---|---|---|
| symbol | <code>string</code>, <code>undefined</code> | unified market symbol |
| params | <code>object</code> | extra parameters specific to the exchange API endpoint |
kucoin.watchPosition (symbol, params[])
<a name="watchPositions" id="watchpositions"></a>
watch all open positions
Kind: instance method of <code>kucoin</code>
Returns: <code>Array<object></code> - a list of position structure
See: https://www.kucoin.com/docs-new/3470233w0
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| since | <code>int</code> | No | the earliest time in ms to fetch positions for |
| limit | <code>int</code> | No | the maximum number of positions to retrieve |
| params | <code>object</code> | Yes | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) |
kucoin.watchPositions ([symbols, since, limit, params])