API Spec by Method
CCXT unified API specification — every method and the exchanges that implement it.
addMargin
add margin
Kind: instance
Returns: object - a margin structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| amount | float | Yes | amount of margin to add |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster binance bitget delta digifinex gate hashkey hitbtc hyperliquid kucoin lighter mexc mudrex okx poloniex polymarket weex woo woofipro xt zebpay
approveBuilderCode
approves a builder code to charge fees on the account orders
Kind: instance
Returns: object - the api result
| Param | Type | Required | Description |
|---|---|---|---|
| builderCode | string | Yes | the builder code to approve |
| maxFeeRate | string | Yes | the maximum fee rate the builder may charge |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: pacifica
bindAgentWallet
binds an agent wallet that can sign trading actions for the account
Kind: instance
Returns: object - the api result
| Param | Type | Required | Description |
|---|---|---|---|
| agentAddress | string | Yes | the public key of the agent wallet |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: pacifica
borrowCrossMargin
create a loan to borrow margin
Kind: instance
Returns: object - a margin loan structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency to borrow |
| amount | float | Yes | the amount to borrow |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean | No | set to true if you would like to borrow margin in a portfolio margin account |
Supported exchanges: binance bitget bybit gate htx kucoin okx
borrowIsolatedMargin
create a loan to borrow margin
Kind: instance
Returns: object - a margin loan structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol, required for isolated margin |
| code | string | Yes | unified currency code of the currency to borrow |
| amount | float | Yes | the amount to borrow |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bitget gate htx kucoin
calculateFee
calculates the presumptive fee that would be charged for an order
Kind: instance
Returns: object - contains the rate, the percentage multiplied to the order amount to obtain the fee amount, and cost, the total value of the fee in units of the quote currency, for the order
| Param | Type | Description |
|---|---|---|
| symbol | string | unified market symbol |
| type | string | not used by btcmarkets.calculateFee |
| side | string | not used by btcmarkets.calculateFee |
| amount | float | how much you want to trade, in units of the base currency on most exchanges, or number of contracts |
| price | float | the price for the order to be filled at, in units of the quote currency |
| takerOrMaker | string | 'taker' or 'maker' |
| params | object |
Supported exchanges: btcmarkets
calculatePricePrecision
Helper function to calculate the Hyperliquid DECIMAL_PLACES price precision
Kind: instance
Returns: int - The calculated price precision
| Param | Type | Description |
|---|---|---|
| price | float | the price to use in the calculation |
| amountPrecision | int | the amountPrecision to use in the calculation |
| maxDecimals | int | the maxDecimals to use in the calculation |
Supported exchanges: hyperliquid
cancelAllContractOrders
helper method for cancelling all contract orders
Kind: instance
Returns: Response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | object | No | When true, all the trigger orders will be cancelled |
Supported exchanges: kucoin
cancelAllOrders
cancel all open orders in a market
Kind: instance
Returns: Array<object> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | alpaca cancelAllOrders cannot setting symbol, it will cancel all open orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bitfinex bitget bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blockchaincom btse bullish bybit cex coinbaseexchange coinbaseinternational coinsph cryptocom deepcoin delta deribit derive extended foxbit gate grvt hashkey hibachi hitbtc hollaex htx kraken krakenfutures kucoin latoken lbank lighter mexc modetrade nado ndax onetrading pacifica paradex phemex poloniex polymarket revolutx toobit weex whitebit woo woofipro xt zebpay
cancelAllOrdersAfter
dead man's switch, cancel all orders after the given timeout
Kind: instance
Returns: object - the api result
| Param | Type | Required | Description |
|---|---|---|---|
| timeout | number | Yes | time in milliseconds, 0 represents cancel the timer |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.type | string | No | spot or swap market |
| params.subType | string | No | 'linear' or 'inverse' (default is 'linear'), 'inverse' is not supported |
Supported exchanges: bingx bitvavo btse bybit extended htx hyperliquid kraken krakenfutures lighter okx polymarket whitebit woo
cancelAllOrdersWs
cancel all open orders in a market
Kind: instance
Returns: Array<object> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the market to cancel orders in |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bitvavo coinbaseinternational cryptocom gate lighter nado okx pacifica
cancelAllSpotOrders
helper method for cancelling all spot orders
Kind: instance
Returns: Response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | invalid for isolated margin true if cancelling all stop orders |
| params.marginMode | string | No | 'cross' or 'isolated' |
| params.orderIds | string | No | stop orders only Comma separated order IDs |
| params.hf | bool | No | false, // true for hf order |
Supported exchanges: kucoin
cancelAllUtaOrders
helper method for cancelling all uta orders
Kind: instance
Returns: Response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | true if cancelling all stop orders |
| params.marginMode | string | No | 'CROSS' or 'ISOLATED' |
Supported exchanges: kucoin
cancelContractOrder
helper method for cancelling contract orders
Kind: instance
Returns: object - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | string | No | cancel order by client order id |
Supported exchanges: kucoin
cancelOrder
cancels an open order
Kind: instance
Returns: object - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bit2c bitbank bitbns bitfinex bitflyer bitget bithumb bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blockchaincom blofin btcbox btcmarkets btcturk btse bullish bybit cex coinbase coinbaseexchange coinbaseinternational coincheck coinmate coinone coinsph coinspot cryptocom cryptomus deepcoin delta deribit derive digifinex dydx extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx hyperliquid independentreserve indodax kraken krakenfutures kucoin latoken lbank lighter luno mercado mexc modetrade mudrex nado ndax okx onetrading p2b pacifica paradex paymium phemex polymarket revolutx tokocrypto toobit upbit weex whitebit woo woofipro xt zaif zebpay
cancelOrderWs
cancel multiple orders
Kind: instance
Returns: object - an list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | No | unified market symbol, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.cancelRestrictions | string, undefined | No | Supported values: ONLY_NEW - Cancel will succeed if the order status is NEW. ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED. |
| params.trigger | boolean | No | set to true if you would like to cancel a conditional order |
Supported exchanges: binance bitvavo bybit cex coinbaseinternational cryptocom gate hyperliquid lighter nado okx pacifica
cancelOrders
cancel multiple orders
Kind: instance
Returns: object - an list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids |
| symbol | string | No | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.origClientOrderIdList | Array<string> | No | max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma |
| params.recvWindow | Array<int> | No |
Supported exchanges: aster binance bingx bitfinex bitget bithumb bitopro bitso bittrade blofin btcmarkets bybit coinbase cryptocom deepcoin digifinex dydx extended gate hashkey hibachi htx hyperliquid kraken krakenfutures kucoin mexc modetrade nado okx onetrading pacifica paradex poloniex polymarket toobit weex woofipro xt
cancelOrdersForSymbols
cancel multiple orders for multiple symbols
Kind: instance
Returns: object - an list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| orders | Array<CancellationRequest> | Yes | list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}] |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bybit cryptocom digifinex gate hyperliquid okx
cancelOrdersRequest
build the request payload for cancelling multiple orders
Kind: instance
Returns: object - the raw request object to be sent to the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids |
| symbol | string | Yes | unified market symbol |
| params | object | No | |
| params.fast | boolean | No | whether to send the cancel with the fast flag, rejected for trigger orders, (default is false) |
Supported exchanges: hyperliquid
cancelOrdersWs
cancel multiple orders
Kind: instance
Returns: object - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids |
| symbol | string | Yes | not used by cancelOrders() |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: cex hyperliquid nado okx pacifica
cancelSpotOrder
helper method for cancelling spot orders
Kind: instance
Returns: Response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | True if cancelling a stop order |
| params.hf | bool | No | false, // true for hf order |
| params.sync | bool | No | false, // true to use the hf sync call |
| params.marginMode | string | No | 'cross' or 'isolated' |
Supported exchanges: kucoin
cancelTwapOrder
cancels a running twap order
Kind: instance
Returns: object - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.expiresAfter | int | No | time in ms after which the twap order expires |
| params.vaultAddress | string | No | the vault address for order |
Supported exchanges: hyperliquid
cancelUtaOrder
helper method for cancelling uta orders
Kind: instance
Returns: Response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.accountMode | string | No | 'unified' or 'classic' (default is 'unified') |
| params.clientOrderId | string | No | client order id, required if id is not provided |
| params.marginMode | string | No | 'cross' or 'isolated', required if fetching a margin order (unified accountMode supports only cross margin) |
Supported exchanges: kucoin
closeAllPositions
closes open positions for a market
Kind: instance
Returns: Array<object> - a list of position structures
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.recvWindow | string | No | request valid time window value |
Supported exchanges: bingx bitget delta mexc weex
closePosition
closes open positions for a market
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Unified CCXT market symbol |
| side | string | No | not used by bingx |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.positionId | string, undefined | No | the id of the position you would like to close, only supported for linear swap |
Supported exchanges: bingx bitget blofin btse coinbase cryptocom deepcoin gate hitbtc htx kucoin mudrex okx weex zebpay
createApiKey
creates an api key for the account
Kind: instance
Returns: object - the api result
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: pacifica
createContractOrder
create a trade order on contract market
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market', 'limit', 'OCO', 'PEG', 'TWAP' or 'TRAILING' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of you want to trade in units of the base currency |
| price | float | No | the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | string | No | a unique id for the order |
| params.postOnly | bool | No | if true, the order will only be posted to the order book and not executed immediately, default is false |
| params.reduceOnly | bool | No | if true, the order will only reduce a current position, not increase it, default is false |
| params.timeInForce | string | No | 'GTC', 'IOC', 'FOK', 'PO', 'HALFSEC', 'HALFMIN', 'FIVEMIN', 'HOUR', 'TWELVEHOUR', 'DAY', 'WEEK' or 'MONTH' |
| params.hedged | bool | No | true for hedged mode, false for one way mode, default is false |
| params.marginMode | string | No | 'cross' or 'isolated', default is 'cross' - the exchange does not have cross/isolated margin modes but instead has 'ONE_WAY', 'HEDGE' and 'ISOLATED' position modes, so this param will be converted to the appropriate position mode |
| params.positionMode | string | No | 'ONE_WAY', 'HEDGE' or 'ISOLATED' - if not provided, it will be derived from the marginMode and hedged params |
| params.triggerPrice | float | No | the price that a trigger order is triggered at, same as takeProfitPrice |
| params.stopLossPrice | float | No | the price that a stop loss order is triggered at |
| params.takeProfitPrice | float | No | the price that a take profit order is triggered at |
| params.triggerPriceType | string | No | 'last', 'mark' or 'index', default is 'mark' |
| params.trailingAmount | float | No | the quote amount to trail away from the current market price |
| params.trailingPercent | float | No | the percent to trail away from the current market price |
| params.takeProfit | object | No | takeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered |
| params.takeProfit.triggerPrice | float | No | take profit trigger price |
| params.takeProfit.priceType | string | No | 'last', 'mark' or 'index', default is 'mark' |
| params.stopLoss | object | No | stopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered |
| params.stopLoss.triggerPrice | float | No | stop loss trigger price |
| params.stopLoss.priceType | string | No | 'last', 'mark' or 'index', default is 'mark' |
| params.deviation | float | No | PEG orders only the offset applied to the pegged reference price |
| params.stealth | float | No | PEG orders only the portion of the order size displayed on the book |
| params.stopPrice | float | No | NB - It is NOT the stopLossPrice!!! OCO orders only the limit price of the stop loss leg |
Supported exchanges: btse kucoin weex
createContractOrders
helper method for creating contract orders in batch
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: kucoin
createConvertTrade
converts between a tokenized stock and its quote currency through a bounded RFQ
Kind: instance
Returns: object - conversion result; RFQ submission may remain open and is not necessarily a fill
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | RFQ identifier when accepting a quote, or a numeric client identifier for a new RFQ |
| fromCode | string | Yes | the currency to convert from |
| toCode | string | Yes | the currency to convert to |
| amount | float | No | amount in units of the from currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.quoteId | string | No | accept this quote for RFQ id supplied as id |
| params.price | float | No | price bound from fetchConvertQuote; required when buying stock |
| params.baseAmount | float | No | stock quantity when converting quote currency to stock |
| params.clientOrderId | int | No | requester client identifier for a newly submitted RFQ |
Supported exchanges: backpack binance bitget bybit coinbase okx phemex whitebit woo
createDepositAddress
create a currency deposit address
Kind: instance
Returns: object - an address structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency for the deposit address |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bitfinex bithumb coinbase coinbaseexchange deribit gemini hitbtc kraken kucoin luno mexc ndax paymium poloniex upbit whitebit
createGiftCode
create gift code
Kind: instance
Returns: object - The gift code id, code, currency and amount
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | gift code |
| amount | float | Yes | amount of currency for the gift |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance
createMarketBuyOrderWithCost
create a market buy order by providing the symbol and cost
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| cost | float | Yes | how much you want to trade in units of the quote currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca bigone binance bingx bitget bithumb bitrue bittrade bybit coinbase deepcoin digifinex gate hashkey htx kraken kucoin lbank mexc okx whitebit woo xt
createMarketOrderWithCost
create a market order by providing the symbol, side and cost
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| side | string | Yes | 'buy' or 'sell' |
| cost | float | Yes | how much you want to trade in units of the quote currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca binance bingx deepcoin kraken kucoin whitebit
createMarketSellOrderWithCost
create a market sell order by providing the symbol and cost
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| cost | float | Yes | how much you want to trade in units of the quote currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca binance bingx bybit deepcoin kucoin mexc okx woo
createOrder
create a trade order
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market', 'limit' or 'stop_limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of currency you want to trade in units of base currency |
| price | float | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.triggerPrice | float | No | The price at which a trigger order is triggered at |
| params.timeInForce | string | No | 'GTC' or 'IOC', the venue supports only these two for crypto orders, defaults to 'GTC' |
| params.cost | float | No | market orders only the cost of the order in units of the quote currency |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bit2c bitbank bitbns bitfinex bitflyer bitget bithumb bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blockchaincom blofin btcbox btcmarkets btcturk btse bullish bybit cex coinbase coinbaseexchange coinbaseinternational coincheck coinmate coinone coinsph coinspot cryptocom cryptomus deepcoin delta deribit derive digifinex dydx extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx hyperliquid independentreserve indodax kraken krakenfutures kucoin latoken lbank lighter luno mercado mexc modetrade mudrex nado ndax okx onetrading p2b pacifica paradex paymium phemex poloniex polymarket revolutx tokocrypto toobit upbit weex whitebit woo woofipro xt zaif zebpay
createOrderWs
create a trade order
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of currency you want to trade in units of base currency |
| price | float, undefined | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.test | boolean | Yes | test order, default false |
| params.returnRateLimits | boolean | Yes | set to true to return rate limit information, default false |
Supported exchanges: binance bitvavo bybit cex coinbaseinternational cryptocom gate hyperliquid lighter nado okx pacifica
createOrders
create a list of trade orders
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster backpack binance bingx bitfinex bitget bithumb blofin bybit cryptocom digifinex foxbit gate hashkey hibachi htx hyperliquid kraken krakenfutures kucoin mexc modetrade okx pacifica paradex poloniex polymarket woofipro
createOrdersRequest
create a list of trade orders
Kind: instance
Returns: object - an order structure
| Param | Type | Description |
|---|---|---|
| orders | Array | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
Supported exchanges: hyperliquid
createOrdersWs
create a list of trade orders
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: gate hyperliquid
createProxyCredentials
provisions fresh trading session credentials - generates a proxy keypair, registers it with an EIP-712 CreateProxy message signed by the wallet key and caches the returned secret, the venue keeps the session valid for the requested lifetime
Kind: instance
Returns: object - the session credentials, holding the proxy address, the proxy private key, the secret and the expiry timestamp
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: polymarket
createSpotOrder
create a trade order on spot market
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market', 'limit', 'OCO', 'PEG', 'TWAP' or 'TRAILING' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of you want to trade in units of the base currency |
| price | float | No | the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | string | No | a unique id for the order |
| params.postOnly | bool | No | if true, the order will only be posted to the order book and not executed immediately, default is false |
| params.timeInForce | string | No | 'GTC', 'IOC' or 'FOK' |
| params.cost | float | No | market buy and trailing buy orders only the quote quantity that can be used as an alternative for the amount |
| params.triggerPrice | float | No | the price that a trigger order is triggered at, same as takeProfitPrice |
| params.stopLossPrice | float | No | the price that a stop loss order is triggered at |
| params.takeProfitPrice | float | No | the price that a take profit order is triggered at |
| params.triggerPriceType | string | No | 'last', 'mark' or 'index', default is 'last' |
| params.trailingAmount | float | No | the quote amount to trail away from the current market price |
| params.trailingPercent | float | No | the percent to trail away from the current market price |
| params.deviation | float | No | PEG orders only how much should the order price deviate from the pegged price, in percent from -10 to 10 |
| params.stealth | float | No | PEG orders only how many percent of the order is to be displayed on the orderbook, from 1 to 100 |
| params.stopPrice | float | No | NB - It is NOT stopLossPrice or triggerPrice!!! OCO orders only the limit price of the stop loss leg |
Supported exchanges: btse hashkey kucoin weex
createSpotOrders
helper method for creating spot orders in batch
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.hf | bool | No | false, // true for hf orders |
| params.sync | bool | No | false, // true to use the hf sync call |
Supported exchanges: kucoin
createSubAccount
creates a sub-account under the main account
Kind: instance
Returns: object - a response object
| Param | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | the name of the sub-account |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.expiresAfter | int | No | time in ms after which the sub-account will expire |
Supported exchanges: hyperliquid pacifica
createSwapOrder
create a trade order on swap market
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' or 'STOP' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of you want to trade in units of the base currency |
| price | float | No | the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.postOnly | bool | No | if true, the order will only be posted to the order book and not executed immediately |
| params.reduceOnly | bool | No | true or false whether the order is reduce only |
| params.triggerPrice | float | No | The price at which a trigger order is triggered at |
| params.timeInForce | string | No | 'GTC', 'FOK', 'IOC', 'LIMIT_MAKER' or 'PO' |
| params.clientOrderId | string | No | a unique id for the order |
Supported exchanges: hashkey
createTrailingAmountOrder
create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much you want to trade in units of the base currency, or number of contracts |
| price | float | No | the price for the order to be filled at, in units of the quote currency, ignored in market orders |
| trailingAmount | float | Yes | the quote amount to trail away from the current market price |
| trailingTriggerPrice | float | Yes | the price to activate a trailing order, default uses the price argument |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: woo
createTrailingPercentOrder
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much you want to trade in units of the base currency, or number of contracts |
| price | float | No | the price for the order to be filled at, in units of the quote currency, ignored in market orders |
| trailingPercent | float | Yes | the percent to trail away from the current market price |
| trailingTriggerPrice | float | Yes | the price to activate a trailing order, default uses the price argument |
| params | object | No | extra parameters specific to the exchange API endpoint |
createTwapOrder
create a trade order that is executed as a TWAP order over a specified duration.
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of currency you want to trade in units of base currency, only required for sale |
| duration | int | Yes | the duration of the TWAP order in milliseconds |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.frequency | string | Yes | required order interval in seconds, 15, 20, 30, 60 or 120 |
| params.price | string | No | order price, required for purchase |
| params.generation | int | No | only generation 2 is supported if you want to use the API generation 1 or 2, default is 2 |
Supported exchanges: bithumb hyperliquid
createUtaOrder
helper method for creating uta orders
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Unified CCXT market symbol |
| type | string | Yes | 'limit' or 'market' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | the amount of currency to trade |
| price | float | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | string | No | client order id, defaults to uuid if not passed |
| params.cost | float | No | the cost of the order in units of quote currency |
| params.timeInForce | string | No | GTC, GTD, IOC, FOK or PO |
| params.postOnly | bool | No | Post only flag, invalid when timeInForce is IOC or FOK (default is false) |
| params.reduceOnly | bool | No | contract markets only A mark to reduce the position size only. Set to false by default |
| params.triggerPrice | float | No | The price a trigger order is triggered at |
| params.triggerDirection | string | No | 'ascending' or 'descending', the direction the triggerPrice is triggered from, requires triggerPrice |
| params.triggerPriceType | string | No | contract markets only "last", "mark", "index" - defaults to "mark" |
| params.stopLossPrice | float | No | price to trigger stop-loss orders |
| params.takeProfitPrice | float | No | price to trigger take-profit orders |
| params.marginMode | string | No | 'cross' or 'isolated', (default is 'cross' for margin orders, default is 'isolated' for contract orders) Exchange-specific parameters ------------------------------------------------- |
| params.accountMode | string | No | 'unified' or 'classic', default is 'unified' |
| params.stp | string | No | '', // self trade prevention, CN, CO, CB or DC |
| params.cancelAfter | int | No | Cancel After N Seconds (Calculated from the time of entering the matching engine), only effective when timeInForce is GTD |
| params.sizeUnit | string | No | contracts only 'BASECCY' (amount of base currency) or 'UNIT' (number of contracts), default is 'UNIT' Classic account parameters |
| params.autoBorrow | bool | No | classic margin orders only |
| params.autoRepay | bool | No | classic margin orders only |
| params.hedged | string | No | classic contract orders only true for hedged mode, false for one way mode, default is false |
| params.leverage | int | No | classic contract orders with isolated marginMode only Leverage size of the order |
Supported exchanges: kucoin
createVault
creates a value
Kind: instance
Returns: object - the api result
| Param | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | The name of the vault |
| description | string | Yes | The description of the vault |
| initialUsd | number | Yes | The initialUsd of the vault |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: hyperliquid
deposit
make a deposit
Kind: instance
Returns: object - a transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | the amount to deposit |
| id | string | Yes | the payment method id to be used for the deposit, can be retrieved from v2PrivateGetPaymentMethods |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.accountId | string | No | the id of the account to deposit into |
Supported exchanges: coinbase
editContractOrder
edit a trade order
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | cancel order id |
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of currency you want to trade in units of base currency |
| price | float | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean | No | set to true if you would like to edit an order in a portfolio margin account |
Supported exchanges: binance
editOrder
edit a trade order
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | No | unified symbol of the market to create an order in |
| type | string | No | 'market', 'limit' or 'stop_limit' |
| side | string | No | 'buy' or 'sell' |
| amount | float | No | how much of the currency you want to trade in units of the base currency |
| price | float | No | the price for the order, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.triggerPrice | string | No | the price to trigger a stop order |
| params.timeInForce | string | No | 'GTC' or 'IOC', the venue supports only these two for crypto orders, defaults to 'GTC' |
| params.clientOrderId | string | No | a unique identifier for the order, automatically generated if not sent |
Supported exchanges: alpaca binance bingx bitfinex bitget bitstamp bitvavo btse bullish bybit coinbase coinbaseinternational cryptocom deepcoin delta deribit derive extended foxbit gate hibachi hyperliquid kraken krakenfutures kucoin lighter modetrade mudrex nado ndax okx pacifica paradex phemex poloniex polymarket revolutx upbit whitebit woo woofipro xt
editOrderWs
edit a trade order
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of the currency you want to trade in units of the base currency |
| price | float, undefined | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bitvavo bybit cex coinbaseinternational cryptocom gate hyperliquid nado okx pacifica
editOrders
edit a list of trade orders
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bybit hibachi hyperliquid okx
enableDemoTrading
enables or disables demo trading mode
Kind: instance
| Param | Type | Required | Description |
|---|---|---|---|
| enable | boolean | No | true if demo trading should be enabled, false otherwise |
Supported exchanges: binance bitget bybit
enableUserDexAbstraction
If set, actions on HIP-3 perps will automatically transfer collateral from validator-operated USDC perps balance for HIP-3 DEXs where USDC is the collateral token, and spot otherwise
Kind: instance
Returns: dictionary response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| enabled | boolean | Yes | whether to enable user dex abstraction |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.type | string | No | 'userDexAbstraction' or 'agentEnableDexAbstraction' default is 'userDexAbstraction' |
Supported exchanges: hyperliquid
fetchADLRank
fetches the auto deleveraging rank and risk percentage for a symbol
Kind: instance
Returns: object - an auto de leverage structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the auto deleveraging rank for |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance
fetchAccount
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance
Returns: object - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: apex extended
fetchAccountIdByType
fetch all the accounts by a type and marginModeassociated with a profile
Kind: instance
Returns: object - a dictionary of account structures indexed by the account type
| Param | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | 'spot', 'swap' or 'future |
| marginMode | string | No | 'cross' or 'isolated' |
| symbol | string | No | unified ccxt market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: htx
fetchAccountSettings
fetch account's market settings. Settings are cached for walletAddress. To refresh the cache, call loadAccountSettings with refresh=true
Kind: instance
Returns: object - Dict repacked from list by symbol key
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.account | string | No | will default to walletAddress if not provided |
Supported exchanges: pacifica
fetchAccounts
fetch all the accounts associated with a profile
Kind: instance
Returns: object - a dictionary of account structures indexed by the account type
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bittrade bitvavo bullish coinbase coinbaseexchange cryptocom deribit derive dydx extended hashkey htx kucoin lighter luno mexc ndax okx whitebit woo
fetchAllGreeks
fetches all option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
Kind: instance
Returns: object - a dictionary of greeks structures indexed by market symbol
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified symbols of the markets to fetch greeks for, all markets are returned if not assigned |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bybit okx paradex
fetchApiKeys
fetches the api keys of the account
Kind: instance
Returns: object - the api result
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: pacifica
fetchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance
Returns: object - a balance structure. note that info is
the composite { account, positions } wrapper of both raw venue payloads, not the bare account payload it was
before crypto positions were included — read info['account']['cash'] where info['cash'] used to be read
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bit2c bitbank bitbns bitfinex bitflyer bitget bithumb bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blockchaincom blofin btcbox btcmarkets btcturk btse bullish bybit cex coinbase coinbaseexchange coinbaseinternational coincheck coinmate coinone coinsph coinspot cryptocom cryptomus deepcoin delta deribit derive digifinex dydx extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx hyperliquid independentreserve indodax kraken krakenfutures kucoin latoken lbank lighter luno mercado mexc modetrade mudrex nado ndax okx onetrading p2b pacifica paradex paymium phemex poloniex polymarket revolutx tokocrypto toobit upbit weex whitebit woo woofipro xt zaif zebpay
fetchBalanceWs
fetch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance
Returns: object - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.type | string, undefined | No | 'spot', 'margin', 'swap', 'future', 'savings' or 'funding', use params.subType 'inverse' for COIN-M |
| params.marginMode | string, undefined | No | 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null |
| params.symbols | Array<string>, undefined | No | unified market symbols, only used in isolated margin mode |
| params.method | string, undefined | No | method to use. Can be account.balance, account.status, v2/account.balance or v2/account.status |
Supported exchanges: binance bitvavo cex coinbaseinternational
fetchBidsAsks
fetches the bid and ask price and volume for multiple markets
Kind: instance
Returns: object - a dictionary of ticker structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string>, undefined | Yes | unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subType | string | No | "linear" or "inverse" |
Supported exchanges: aster binance bingx bitrue bybit coinbase kucoinfutures mexc polymarket tokocrypto toobit weex xt
fetchBorrowInterest
fetch the interest owed by the user for borrowing currency for margin trading
Kind: instance
Returns: Array<object> - a list of borrow interest structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| symbol | string | No | unified market symbol when fetch interest in isolated markets |
| since | int | No | the earliest time in ms to fetch borrrow interest for |
| limit | int | No | the maximum number of structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean | No | set to true if you would like to fetch the borrow interest in a portfolio margin account |
Supported exchanges: binance bitget bybit derive gate htx kucoin okx whitebit
fetchBorrowRateHistories
retrieves a history of a multiple currencies borrow interest rate at specific time slots, returns all currencies if no symbols passed, default is undefined
Kind: instance
Returns: object - a dictionary of borrow rate structures indexed by the market symbol
| Param | Type | Required | Description |
|---|---|---|---|
| codes | Array<string>, undefined | Yes | list of unified currency codes, default is undefined |
| since | int | No | timestamp in ms of the earliest borrowRate, default is undefined |
| limit | int | No | max number of borrow rate prices to return, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'cross' or 'isolated' default is 'cross' |
| params.until | int | No | the latest time in ms to fetch entries for |
Supported exchanges: kucoin okx
fetchBorrowRateHistory
retrieves a history of a currencies borrow interest rate at specific time slots
Kind: instance
Returns: Array<object> - an array of borrow rate structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | timestamp for the earliest borrow rate |
| limit | int | No | the maximum number of borrow rate structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bullish bybit derive kucoin okx
fetchBuilderApprovals
fetches the builder codes approved by an account
Kind: instance
Returns: Array<object> - the api result
| Param | Type | Description |
|---|---|---|
| address | string | the account address |
Supported exchanges: pacifica
fetchCanceledAndClosedOrders
fetches information on multiple canceled orders made by the user
Kind: instance
Returns: Array<object> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the market the orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.portfolioMargin | boolean | No | set to true if you would like to fetch orders in a portfolio margin account |
| params.trigger | boolean | No | set to true if you would like to fetch portfolio margin account trigger or conditional orders |
| params.stock | boolean | No | set to true if you would like to fetch tokenized stock orders |
Supported exchanges: binance bingx bitget bullish bybit deepcoin derive hashkey hyperliquid nado pacifica weex
fetchCanceledOrders
fetches information on multiple canceled orders made by the user
Kind: instance
Returns: Array<object> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the market the orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.portfolioMargin | boolean | No | set to true if you would like to fetch orders in a portfolio margin account |
| params.trigger | boolean | No | set to true if you would like to fetch portfolio margin account trigger or conditional orders |
| params.stock | boolean | No | set to true if you would like to fetch tokenized stock orders |
Supported exchanges: binance bingx bitget bithumb bitteam blockchaincom bullish bybit coinbase deepcoin derive extended hibachi htx hyperliquid krakenfutures mexc nado okx pacifica upbit weex xt
fetchClosedOrder
fetch an open order by it's id
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified market symbol, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bitfinex bybit cex deepcoin
fetchClosedOrders
fetches information on multiple closed orders made by the user
Kind: instance
Returns: Array<Order> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch orders for |
| params.direction | string | No | the ordering of the results, 'asc' or 'desc', defaults to 'asc' when since is set |
Supported exchanges: alpaca bigone binance bingx bitfinex bitflyer bitget bithumb bitopro bitrue bitteam bittrade blockchaincom blofin btcmarkets bullish bybit cex coinbase coinbaseexchange coinsph deepcoin delta deribit derive dydx extended foxbit gate hibachi hitbtc hollaex htx hyperliquid independentreserve indodax kraken krakenfutures kucoin lighter luno mexc modetrade mudrex nado okx onetrading p2b pacifica phemex poloniex revolutx tokocrypto toobit upbit weex whitebit woo woofipro xt zaif
fetchClosedOrdersWs
fetch closed orders
Kind: instance
Returns: Array<object> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch open orders for |
| limit | int | No | the maximum number of open orders structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance gate
fetchContractBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance
Returns: object - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.code | object | No | the unified currency code to fetch the balance for, if not provided, the default .options['fetchBalance']['code'] will be used |
Supported exchanges: kucoin
fetchContractDepositAddress
fetch the deposit address for a currency associated with this account
Kind: instance
Returns: object - an address structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: kucoin
fetchContractDeposits
helper method for fetching deposits for futures accounts
Kind: instance
Returns: Array<object> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | the earliest time in ms to fetch deposits for |
| limit | int | No | the maximum number of deposits structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: kucoin
fetchContractOrder
fetc contract order
Kind: instance
Returns: object - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: kucoin
fetchContractOrdersByStatus
fetches a list of contract orders placed on the exchange
Kind: instance
Returns: An array of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| status | string | Yes | 'active' or 'closed', only 'active' is valid for stop orders |
| symbol | string | Yes | unified symbol for the market to retrieve orders from |
| since | int | No | timestamp in ms of the earliest order to retrieve |
| limit | int | No | The maximum number of orders to retrieve |
| params | object | No | exchange specific parameters |
| params.trigger | bool | No | set to true to retrieve untriggered stop orders |
| params.until | int | No | End time in ms |
| params.side | string | No | buy or sell |
| params.type | string | No | limit or market |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
Supported exchanges: kucoin
fetchContractWithdrawals
helper method for fetching withdrawals for futures accounts
Kind: instance
Returns: Array<object> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | the earliest time in ms to fetch withdrawals for |
| limit | int | No | the maximum number of withdrawals structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: kucoin
fetchConvertCurrencies
fetches all available currencies that can be converted
Kind: instance
Returns: object - an associative dictionary of currencies
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bitget bybit okx woo
fetchConvertQuote
fetches an indicative quote for converting between a tokenized stock and its quote currency
Kind: instance
Returns: object - indicative conversion estimate; the price is a bound and is not guaranteed
| Param | Type | Required | Description |
|---|---|---|---|
| fromCode | string | Yes | the currency to convert from |
| toCode | string | Yes | the currency to convert to |
| amount | float | Yes | amount in units of the from currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.price | float | No | optional limit price when converting quote currency to stock |
Supported exchanges: backpack binance bitget bybit coinbase okx phemex whitebit woo
fetchConvertTrade
fetch the data for a conversion trade
Kind: instance
Returns: object - a conversion structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the id of the trade that you want to fetch |
| code | string | No | the unified currency code of the conversion trade |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bybit coinbase okx woo
fetchConvertTradeHistory
fetch the users history of conversion trades
Kind: instance
Returns: Array<object> - a list of conversion structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | the unified currency code |
| since | int | No | the earliest time in ms to fetch conversions for |
| limit | int | No | the maximum number of conversion structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest conversion to fetch |
Supported exchanges: binance bitget bybit okx phemex whitebit woo
fetchCrossBorrowRate
fetch the rate of interest to borrow a currency for margin trading
Kind: instance
Returns: object - a borrow rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bitget bybit digifinex kucoin okx
fetchCrossBorrowRates
fetch the borrow interest rates of all currencies
Kind: instance
Returns: object - a list of borrow rate structures
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: digifinex okx
fetchCurrencies
fetches all available currencies on an exchange
Kind: instance
Returns: object - an associative dictionary of currencies
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: apex aster backpack bigone binance bingx bitfinex bitget bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blofin bullish bybit cex coinbase coinbaseexchange coinbaseinternational coinone coinsph cryptocom cryptomus delta deribit derive digifinex extended gate gemini grvt hashkey hitbtc hollaex htx hyperliquid kraken kucoin latoken lbank lighter luno mexc modetrade nado ndax okx onetrading phemex poloniex polymarket revolutx toobit weex whitebit woo woofipro xt zebpay
fetchCurrenciesWs
fetches all available currencies on an exchange
Kind: instance
Returns: object - an associative dictionary of currencies
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bitvavo
fetchDeposit
fetch data on a currency deposit via the deposit id, looks back 30 days for uta accounts and 90 days otherwise
Kind: instance
Returns: object - a transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | deposit id |
| code | string | No | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
Supported exchanges: bitget bithumb bitso blockchaincom blofin coinbase okx upbit whitebit
fetchDepositAddress
fetch the deposit address for a currency associated with this account
Kind: instance
Returns: object - an address structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca backpack bigone binance bingx bit2c bitbank bitbns bitfinex bitget bithumb bitso bitstamp bitvavo blockchaincom blofin bullish bybit cex coinbase coinsph cryptocom deepcoin delta deribit digifinex foxbit gate gemini hashkey hibachi hitbtc htx independentreserve kraken kucoin lbank luno mexc ndax okx paymium phemex poloniex tokocrypto toobit upbit whitebit woo xt
fetchDepositAddresses
fetch deposit addresses for multiple currencies (when available)
Kind: instance
Returns: object - a dictionary of address structures indexed by currency code
| Param | Type | Required | Description |
|---|---|---|---|
| codes | Array<string> | No | list of unified currency codes, default is undefined (all currencies) |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.generation | int | No | only generation 2 is supported if you want to use the API generation 1 or 2, default is 2 |
Supported exchanges: bithumb coinbase coinone deepcoin hollaex indodax paymium upbit
fetchDepositAddressesByNetwork
fetch the deposit addresses for a currency associated with this account
Kind: instance
Returns: object - a dictionary address structures, indexed by the network
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bingx bybit cryptocom gate gemini htx kucoin mexc okx
fetchDepositMethodId
fetch the deposit id for a fiat currency associated with this account
Kind: instance
Returns: object - a deposit id structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the deposit payment method id |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: coinbase
fetchDepositMethodIds
fetch the deposit id for a fiat currency associated with this account
Kind: instance
Returns: object - an array of deposit id structures
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: coinbase
fetchDepositMethods
fetch deposit methods for a currency associated with this account
Kind: instance
Returns: object - of deposit methods
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: kraken
fetchDepositWithdrawFee
fetch the withdrawal fee for a currency; indodax charges no crypto deposit fees, see https://github.com/ccxt/ccxt/issues/25800
Kind: instance
Returns: object - a fee structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: indodax kucoin luno
fetchDepositWithdrawFees
fetch deposit and withdraw fees
Kind: instance
Returns: Array<object> - a list of fee structures
| Param | Type | Required | Description |
|---|---|---|---|
| codes | Array<string>, undefined | Yes | not used by fetchDepositWithdrawFees () |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bingx bitget bitopro bitrue bitso bitstamp bitvavo blofin bybit cryptocom deribit digifinex gate hitbtc hollaex htx kucoin lbank mexc okx poloniex whitebit
fetchDeposits
fetch all deposits made to an account
Kind: instance
Returns: Array<object> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| since | int | No | the earliest time in ms to fetch deposits for |
| limit | int | No | the maximum number of deposit structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca backpack bigone binance bingx bitbns bitflyer bitget bithumb bitopro bitrue bitso bittrade bitvavo blockchaincom blofin btcmarkets btse bybit coinbase coinbaseexchange coinbaseinternational coincheck coinsph cryptocom deepcoin deribit derive digifinex dydx extended foxbit gate grvt hashkey hibachi hitbtc hollaex htx hyperliquid kraken kucoin lbank lighter mexc modetrade nado ndax okx pacifica paradex phemex poloniex polymarket tokocrypto toobit upbit whitebit woo woofipro xt
fetchDepositsWithdrawals
fetch history of deposits and withdrawals
Kind: instance
Returns: object - a list of transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code for the currency of the deposit/withdrawals, default is undefined |
| since | int | No | timestamp in ms of the earliest deposit/withdrawal, default is undefined |
| limit | int | No | max number of deposit/withdrawals to return, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca bitfinex bitstamp bitteam btcmarkets btse bullish cex coinbase coinbaseexchange coinbaseinternational coinmate dydx gemini hibachi hitbtc indodax modetrade poloniex whitebit woo woofipro
fetchDepositsWs
fetch all deposits made to an account
Kind: instance
Returns: Array<object> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | the earliest time in ms to fetch deposits for |
| limit | int | No | the maximum number of deposits structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bitvavo
fetchFundingHistory
fetches information on multiple orders made by the user classic accounts only
Kind: instance
Returns: Array<Trade> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve, default 100 |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | object | No | end time, ms |
| params.side | boolean | No | BUY or SELL |
| params.page | boolean | No | Page numbers start from 0 |
Supported exchanges: apex aster backpack binance bingx bitget bybit derive digifinex extended gate grvt htx hyperliquid krakenfutures kucoin mexc modetrade nado okx pacifica paradex phemex polymarket weex whitebit woo woofipro xt
fetchFundingInterval
fetch the current funding rate interval
Kind: instance
Returns: object - a funding rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
Supported exchanges: bitget digifinex kucoin mexc modetrade okx woo woofipro xt
fetchFundingIntervals
fetch the funding rate interval for multiple markets
Kind: instance
Returns: Array<object> - a list of funding rate structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster binance bitget
fetchFundingLimits
fetch the deposit and withdrawal limits for a currency
Kind: instance
Returns: object - a funding limits structure
| Param | Type | Required | Description |
|---|---|---|---|
| codes | Array<string>, undefined | Yes | unified currency codes |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: whitebit
fetchFundingRate
fetch the current funding rate
Kind: instance
Returns: object - a funding rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster backpack binance bingx bitflyer bitget bitstamp blofin btse cryptocom deepcoin delta deribit derive digifinex gate hashkey hibachi hitbtc htx hyperliquid kucoin lbank mexc modetrade nado okx paradex phemex polymarket whitebit woo woofipro xt
fetchFundingRateHistory
fetches historical funding rate prices
Kind: instance
Returns: Array<object> - a list of funding rate structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the funding rate history for |
| since | int | No | timestamp in ms of the earliest funding rate to fetch |
| limit | int | No | the maximum amount of funding rate structures to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest funding rate |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
Supported exchanges: apex aster backpack binance bingx bitfinex bitget bitstamp blofin btse bullish bybit coinbaseinternational cryptocom deepcoin deribit derive digifinex dydx extended gate grvt hashkey hibachi hitbtc htx hyperliquid krakenfutures kucoin mexc modetrade okx pacifica paradex phemex polymarket toobit weex whitebit woo woofipro xt
fetchFundingRates
fetch the current funding rate for multiple symbols
Kind: instance
Returns: Array<object> - a list of funding rate structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster binance bingx bitfinex bitget btse bybit deepcoin delta gate hashkey hitbtc htx hyperliquid krakenfutures kucoin lbank lighter modetrade nado okx pacifica paradex polymarket toobit weex whitebit woo woofipro
fetchGreeks
fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
Kind: instance
Returns: object - a greeks structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch greeks for |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bybit delta deribit derive gate okx paradex
fetchHip3Markets
retrieves data on all hip3 markets for hyperliquid
Kind: instance
Returns: Array<object> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: hyperliquid
fetchIsolatedBorrowRate
fetch the rate of interest to borrow a currency for margin trading
Kind: instance
Returns: object - an isolated borrow rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.vipLevel | object | No | user's current specific margin data will be returned if viplevel is omitted |
Supported exchanges: binance bitget
fetchIsolatedBorrowRates
fetch the borrow interest rates of all currencies
Kind: instance
Returns: object - a borrow rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.symbol | object | No | unified market symbol EXCHANGE SPECIFIC PARAMETERS |
| params.vipLevel | object | No | user's current specific margin data will be returned if viplevel is omitted |
Supported exchanges: binance htx
fetchL3OrderBook
fetches level 3 information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance
Returns: object - an order book structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| limit | int | No | max number of orders to return, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: blockchaincom
fetchLastPrices
fetches the last price for multiple markets
Kind: instance
Returns: object - a dictionary of lastprices structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string>, undefined | Yes | unified symbols of the markets to fetch the last prices |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subType | string | No | "linear" or "inverse" |
Supported exchanges: aster binance hashkey htx toobit weex
fetchLedger
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance
Returns: object - a ledger structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| since | int | No | timestamp in ms of the earliest ledger entry |
| limit | int | No | max number of ledger entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest ledger entry |
Supported exchanges: aster binance bitfinex bitget bitso bitstamp bitvavo blofin btse bybit cex coinbase coinbaseexchange cryptocom deepcoin delta digifinex dydx extended foxbit gate hashkey hibachi htx hyperliquid kraken krakenfutures kucoin luno modetrade ndax okx pacifica toobit weex woo woofipro xt
fetchLedgerEntry
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance
Returns: object - a ledger structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the identification number of the ledger entry |
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance
fetchLeverage
fetch the set leverage for a market
Kind: instance
Returns: object - a leverage structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bingx bitget blofin btse bybit coinbaseinternational delta extended gate hashkey hitbtc krakenfutures kucoin mexc modetrade mudrex okx pacifica paradex poloniex polymarket toobit weex woo woofipro zebpay
fetchLeverageTiers
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
Kind: instance
Returns: object - a dictionary of leverage tiers structures, indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string>, undefined | Yes | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean | No | set to true if you would like to fetch the leverage tiers for a portfolio margin account |
| params.subType | string | No | "linear" or "inverse" |
Supported exchanges: binance btse bybit digifinex gate hashkey htx krakenfutures kucoin mexc phemex xt
fetchLeverages
fetch the set leverage for all markets
Kind: instance
Returns: object - a list of leverage structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | a list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster binance blofin gate grvt krakenfutures weex zebpay
fetchLiquidations
retrieves the public liquidations of a trading pair
Kind: instance
Returns: object - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| since | int | No | the earliest time in ms to fetch liquidations for |
| limit | int | No | the maximum number of liquidation structures to retrieve |
| params | object | No | exchange specific parameters |
| params.until | int | No | timestamp in ms of the latest liquidation |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
Supported exchanges: bitfinex deribit gate htx
fetchLongShortRatioHistory
fetches the long short ratio history for a unified market symbol
Kind: instance
Returns: Array<object> - an array of long short ratio structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the long short ratio for |
| timeframe | string | No | the period for the ratio, default is 24 hours |
| since | int | No | the earliest time in ms to fetch ratios for |
| limit | int | No | the maximum number of long short ratio structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest ratio to fetch |
Supported exchanges: binance bitget bybit okx
fetchMarginAdjustmentHistory
fetches the history of margin added or reduced from contract isolated positions
Kind: instance
Returns: Array<object> - a list of margin structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| type | string | No | "add" or "reduce" |
| since | int | No | timestamp in ms of the earliest change to fetch |
| limit | int | No | the maximum amount of changes to fetch |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest change to fetch |
Supported exchanges: aster binance okx
fetchMarginMode
fetches the margin mode of a specific symbol
Kind: instance
Returns: object - a margin mode structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subType | string | No | "linear" or "inverse" |
Supported exchanges: binance bingx bitget blofin btse bybit delta kucoin pacifica paradex polymarket weex woofipro
fetchMarginModes
fetches margin mode of the user
Kind: instance
Returns: object - a list of margin mode structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster binance grvt hitbtc weex woofipro
fetchMarkOHLCV
fetches historical mark price candlestick data containing the open, high, low, and close price of a market
Kind: instance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: mudrex
fetchMarkPrice
fetches mark price for the market
Kind: instance
Returns: object - a dictionary of ticker structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subType | string | No | "linear" or "inverse" |
Supported exchanges: binance bingx bitget blofin kucoin okx weex
fetchMarkPrices
fetches mark prices for multiple markets
Kind: instance
Returns: object - a dictionary of ticker structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subType | string | No | "linear" or "inverse" |
Supported exchanges: binance bingx kucoin okx weex
fetchMarketLeverageTiers
retrieve information on the maximum leverage, for different trade sizes for a single market
Kind: instance
Returns: object - a leverage tiers structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol, inverse (Coin-M) markets are not supported |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bingx bitget btse bybit digifinex gate kucoin okx xt
fetchMarkets
retrieves data on all markets for alpaca
Kind: instance
Returns: Array<object> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bitbank bitbns bitfinex bitflyer bitget bithumb bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blockchaincom blofin btcbox btcmarkets btcturk btse bullish bybit cex coinbase coinbaseexchange coinbaseinternational coinmate coinone coinsph cryptocom cryptomus deepcoin delta deribit derive digifinex dydx extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx hyperliquid independentreserve indodax kraken krakenfutures kucoin latoken lbank lighter luno mercado mexc modetrade mudrex nado ndax okx onetrading p2b pacifica paradex phemex poloniex polymarket revolutx tokocrypto toobit upbit weex whitebit woo woofipro xt zaif zebpay
fetchMarketsWs
retrieves data on all markets for bitvavo
Kind: instance
Returns: Array<object> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bitvavo
fetchMyContractTrades
fetch all contract trades made by the user
Kind: instance
Returns: Array<Trade> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | End time in ms |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
Supported exchanges: kucoin
fetchMyDustTrades
fetch all dust trades made by the user
Kind: instance
Returns: Array<object> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | not used by fetchMyDustTrades () |
| since | int | No | the earliest time in ms to fetch my dust trades for |
| limit | int | No | the maximum number of dust trades to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.type | string | No | 'spot' or 'margin', default spot |
Supported exchanges: binance
fetchMyLiquidations
retrieves the users liquidated positions
Kind: instance
Returns: object - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified CCXT market symbol |
| since | int | No | the earliest time in ms to fetch liquidations for |
| limit | int | No | the maximum number of liquidation structures to retrieve |
| params | object | No | exchange specific parameters for the binance api endpoint |
| params.until | int | No | timestamp in ms of the latest liquidation |
| params.paginate | boolean | No | spot only default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.portfolioMargin | boolean | No | set to true if you would like to fetch liquidations in a portfolio margin account |
| params.type | string | No | "spot" |
| params.subType | string | No | "linear" or "inverse" |
Supported exchanges: binance bingx bitget bybit deribit gate hyperliquid paradex
fetchMySettlementHistory
fetches historical settlement records of the user
Kind: instance
Returns: Array<object> - a list of [settlement history objects]
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the settlement history |
| since | int | No | timestamp in ms |
| limit | int | No | number of records |
| params | object | No | exchange specific params |
Supported exchanges: binance bybit derive gate hibachi okx
fetchMySpotTrades
fetch all spot trades made by the user
Kind: instance
Returns: Array<Trade> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch entries for |
| params.hf | bool | No | false, // true for hf order |
| params.marginMode | string | No | 'cross' or 'isolated', only for margin trades |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
Supported exchanges: kucoin
fetchMyTrades
fetch all trades made by the user
Kind: instance
Returns: Array<Trade> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trade structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch trades for |
| params.page_token | string | No | page_token - used for paging |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bit2c bitbank bitbns bitfinex bitflyer bitget bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blockchaincom blofin btcmarkets btcturk btse bullish bybit coinbase coinbaseexchange coinbaseinternational coincheck coinmate coinone coinsph coinspot cryptocom deepcoin delta deribit derive digifinex extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx hyperliquid independentreserve kraken krakenfutures kucoin latoken lbank lighter luno mercado mexc modetrade mudrex nado ndax okx onetrading p2b pacifica paradex phemex poloniex polymarket revolutx tokocrypto toobit weex whitebit woo woofipro xt zebpay
fetchMyTradesWs
fetch all trades made by the user
Kind: instance
Returns: Array<object> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int, undefined | No | the earliest time in ms to fetch trades for |
| limit | int, undefined | No | the maximum number of trades structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.endTime | int | No | the latest time in ms to fetch trades for |
| params.fromId | int | No | first trade Id to fetch |
Supported exchanges: binance bitvavo coinbaseinternational
fetchMyUtaTrades
fetch all trades made by the user
Kind: instance
Returns: Array<Trade> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades structures to retrieve (default is 50, max is 200) |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch entries for |
| params.accountMode | string | No | 'unified' or 'classic', defaults to 'unified' |
| params.marginMode | string | No | 'cross' or 'isolated', only for margin trades (unified accountMode support only cross margin) |
| params.side | string | No | 'BUY' or 'SELL' (both if not provided) |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
Supported exchanges: kucoin
fetchOHLCV
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest candle to fetch |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.paginationCalls | int | No | the maximum number of requests while following next_page_token, default 10 — when the cap is reached the result is silently truncated to the pages already fetched, so raise it for long ranges, 10 requests cover roughly 30 days of 1h candles |
| params.loc | string | No | crypto location, default: us |
| params.method | string | No | method, default: marketPublicGetV1beta3CryptoLocBars |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bitbank bitfinex bitget bithumb bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blofin btcmarkets btcturk btse bullish bybit cex coinbase coinbaseexchange coinbaseinternational coinsph cryptocom deepcoin delta deribit derive digifinex dydx extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx hyperliquid indodax kraken krakenfutures kucoin lbank lighter luno mercado mexc modetrade mudrex nado ndax okx onetrading p2b pacifica paradex phemex poloniex polymarket revolutx tokocrypto toobit upbit weex whitebit woo woofipro xt zebpay
fetchOHLCVWs
query historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Description |
|---|---|---|
| symbol | string | unified symbol of the market to query OHLCV data for |
| timeframe | string | the length of time each candle represents |
| since | int | timestamp in ms of the earliest candle to fetch |
| limit | int | the maximum amount of candles to fetch |
| params | object | extra parameters specific to the exchange API endpoint |
| params.until | int | timestamp in ms of the earliest candle to fetch EXCHANGE SPECIFIC PARAMETERS |
| params.timeZone | string | default=0 (UTC) |
Supported exchanges: binance bitvavo
fetchOpenInterest
retrieves the open interest of a contract trading pair
Kind: instance
Returns: object - an open interest structure/docs/manual#open-interest-structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| params | object | No | exchange specific parameters |
Supported exchanges: apex backpack binance bingx bitfinex bitget btse bullish bybit delta deribit derive gemini hibachi hitbtc htx hyperliquid modetrade nado okx pacifica paradex phemex polymarket weex woofipro xt
fetchOpenInterestHistory
Retrieves the open interest history of a currency
Kind: instance
Returns: object - an array of open interest structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Unified CCXT market symbol |
| timeframe | string | Yes | "5m","15m","30m","1h","2h","4h","6h","12h", or "1d" |
| since | int | No | the time(ms) of the earliest record to retrieve as a unix timestamp |
| limit | int | No | default 30, max 500 |
| params | object | No | exchange specific parameters |
| params.until | int | No | the time(ms) of the latest record to retrieve as a unix timestamp |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
Supported exchanges: binance bitfinex bybit extended gate htx kucoin okx
fetchOpenInterests
Retrieves the open interest for a list of symbols
Kind: instance
Returns: Array<object> - a list of open interest structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | a list of unified CCXT market symbols |
| params | object | No | exchange specific parameters |
Supported exchanges: bitfinex btse hitbtc htx hyperliquid kucoin modetrade nado okx pacifica polymarket woofipro
fetchOpenOrder
fetch an open order by the id
Kind: instance
Returns: object - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster backpack binance bitfinex btse bybit cex deepcoin hitbtc hollaex
fetchOpenOrders
fetch all unfilled currently open orders
Kind: instance
Returns: Array<Order> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch orders for |
| params.direction | string | No | the ordering of the results, 'asc' or 'desc', defaults to 'asc' when since is set |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bit2c bitbank bitbns bitfinex bitflyer bitget bithumb bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blockchaincom blofin btcbox btcmarkets btcturk btse bullish bybit cex coinbase coinbaseexchange coinbaseinternational coincheck coinmate coinone coinsph cryptocom cryptomus deepcoin delta deribit derive digifinex dydx extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx hyperliquid independentreserve indodax kraken krakenfutures kucoin latoken lbank lighter luno mercado mexc modetrade mudrex nado ndax okx onetrading p2b pacifica paradex phemex poloniex polymarket revolutx tokocrypto toobit upbit weex whitebit woo woofipro xt zaif zebpay
fetchOpenOrdersWs
fetch all unfilled currently open orders
Kind: instance
Returns: Array<object> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int, undefined | No | the earliest time in ms to fetch open orders for |
| limit | int, undefined | No | the maximum number of open orders structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bitvavo cex coinbaseinternational gate
fetchOption
fetches option data that is commonly found in an option chain
Kind: instance
Returns: object - an option chain structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bybit delta deribit derive gate okx
fetchOptionChain
fetches data for an underlying asset that is commonly found in an option chain
Kind: instance
Returns: object - a list of option chain structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | base currency to fetch an option chain for |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bybit deribit gate okx
fetchOptionPositions
fetch data on open options positions
Kind: instance
Returns: Array<object> - a list of position structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string>, undefined | Yes | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance
fetchOrder
fetches information on an order made by the user
Kind: instance
Returns: object - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bit2c bitbank bitbns bitfinex bitflyer bitget bithumb bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blockchaincom blofin btcbox btcmarkets bullish bybit coinbase coinbaseexchange coinbaseinternational coinmate coinone coinsph cryptocom delta deribit derive digifinex dydx extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx hyperliquid independentreserve indodax kraken krakenfutures kucoin latoken lbank luno mercado mexc modetrade mudrex nado ndax okx onetrading pacifica paradex phemex poloniex polymarket revolutx tokocrypto toobit upbit weex whitebit woo woofipro xt zebpay
fetchOrderBook
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance
Returns: object - an order book structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.loc | string | No | crypto location, default: us |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bit2c bitbank bitbns bitfinex bitflyer bitget bithumb bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blockchaincom blofin btcbox btcmarkets btcturk btse bullish bybit cex coinbase coinbaseexchange coinbaseinternational coincheck coinmate coinone coinsph coinspot cryptocom cryptomus deepcoin delta deribit digifinex dydx extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx hyperliquid independentreserve indodax kraken krakenfutures kucoin latoken lbank lighter luno mercado mexc modetrade nado ndax okx onetrading p2b pacifica paradex paymium phemex poloniex polymarket revolutx tokocrypto toobit upbit weex whitebit woo woofipro xt zaif zebpay
fetchOrderBookWs
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance
Returns: object - A dictionary of order book structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance
fetchOrderBooks
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data for multiple markets
Kind: instance
Returns: object - a dictionary of order book structures indexed by market symbol
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols, all symbols fetched if undefined, default is undefined |
| limit | int | No | max number of entries per orderbook to return, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: hitbtc hollaex upbit
fetchOrderClassic
fetches information on an order made by the user classic accounts only
Kind: instance
Returns: object - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bybit
fetchOrderTrades
fetch all the trades made from a single order
Kind: instance
Returns: Array<object> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: apex binance bitfinex bitso bittrade btse bullish bybit coinbaseexchange coinsph deepcoin deribit derive gate hitbtc htx kraken kucoin mexc modetrade ndax okx onetrading p2b poloniex weex whitebit woo woofipro zebpay
fetchOrderWs
fetches information on an order made by the user
Kind: instance
Returns: object - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | No | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bitvavo cex coinbaseinternational gate
fetchOrders
fetches information on multiple orders made by the user
Kind: instance
Returns: Array<Order> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch orders for |
| params.direction | string | No | the ordering of the results, 'asc' or 'desc', defaults to 'asc' when since is set |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bitflyer bithumb bitopro bitteam bittrade bitvavo blockchaincom btcbox btcmarkets btcturk bullish cex coinbase coinbaseexchange coinmate cryptocom cryptomus digifinex dydx extended foxbit gemini grvt hollaex htx hyperliquid krakenfutures latoken lbank luno mercado mexc modetrade mudrex nado ndax pacifica paradex phemex polymarket revolutx tokocrypto toobit weex whitebit woo woofipro xt
fetchOrdersByIds
fetch orders by the list of order id
Kind: instance
Returns: Array<object> - a list of order structure
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | No | list of order id |
| symbol | string | No | unified ccxt market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: kraken
fetchOrdersByStatus
fetches a list of orders placed on the exchange
Kind: instance
Returns: An array of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| status | string | Yes | 'active' or 'closed', only 'active' is valid for stop orders |
| symbol | string | Yes | unified symbol for the market to retrieve orders from |
| since | int | No | timestamp in ms of the earliest order to retrieve |
| limit | int | No | The maximum number of orders to retrieve |
| params | object | No | exchange specific parameters |
| params.uta | boolean | 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 |
Supported exchanges: kucoin
fetchOrdersClassic
fetches information on multiple orders made by the user classic accounts only
Kind: instance
Returns: Array<Order> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | boolean | No | true if trigger order |
| params.stop | boolean | No | alias for trigger |
| params.type | string | No | market type, ['swap', 'option', 'spot'] |
| params.subType | string | No | market subType, ['linear', 'inverse'] |
| params.orderFilter | string | No | 'Order' or 'StopOrder' or 'tpslOrder' |
| params.until | int | No | the latest time in ms to fetch entries for |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
Supported exchanges: bybit
fetchOrdersWs
fetches information on multiple orders made by the user
Kind: instance
Returns: Array<object> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int, undefined | No | the earliest time in ms to fetch orders for |
| limit | int, undefined | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.orderId | int | No | order id to begin at |
| params.startTime | int | No | earliest time in ms to retrieve orders for |
| params.endTime | int | No | latest time in ms to retrieve orders for |
| params.limit | int | No | the maximum number of order structures to retrieve |
Supported exchanges: binance bitvavo coinbaseinternational gate
fetchPortfolioDetails
Fetch details for a specific portfolio by UUID
Kind: instance
Returns: Array<any> - An account structure </docs/manual#account-structure>
| Param | Type | Required | Description |
|---|---|---|---|
| portfolioUuid | string | Yes | The unique identifier of the portfolio to fetch |
| params | Dict | No | Extra parameters specific to the exchange API endpoint |
Supported exchanges: coinbase
fetchPortfolios
fetch all the portfolios
Kind: instance
Returns: object - a dictionary of account structures indexed by the account type
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: coinbase
fetchPosition
fetch data on an open position
Kind: instance
Returns: object - a position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market the position is held in |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bingx bitget blofin bybit coinbase coinbaseinternational cryptocom delta deribit digifinex dydx extended gate hitbtc htx hyperliquid kucoin lighter mexc modetrade okx pacifica paradex polymarket weex whitebit woo woofipro xt
fetchPositionHistory
fetches historical positions
Kind: instance
Returns: Array<object> - a list of position structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified contract symbol |
| since | int | No | the earliest time in ms to fetch positions for |
| limit | int | No | the maximum amount of records to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch positions for |
Supported exchanges: bingx phemex whitebit
fetchPositionMode
fetchs the position mode, hedged or one way, hedged for aster is set identically for all linear markets or all inverse markets
Kind: instance
Returns: object - an object detailing whether the market is in hedged or one-way mode
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster binance bingx blofin btse kucoin mexc okx poloniex weex
fetchPositionWs
fetch data on an open position
Kind: instance
Returns: object - a position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market the position is held in |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance
fetchPositions
fetch all open positions
Kind: instance
Returns: Array<object> - a list of position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: apex aster backpack binance bingx bitfinex bitflyer bitget blofin btse bullish bybit coinbase coinbaseinternational cryptocom deepcoin delta deribit derive digifinex dydx extended gate grvt hashkey hibachi hitbtc htx hyperliquid kraken krakenfutures kucoin lighter mexc modetrade mudrex nado okx pacifica paradex phemex poloniex polymarket toobit weex whitebit woo woofipro xt zebpay
fetchPositionsADLRank
fetches the auto deleveraging rank and risk percentage for a list of symbols that have open positions
Kind: instance
Returns: Array<object> - an array of auto de leverage structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean | No | set to true for the portfolio margin account |
Supported exchanges: binance blofin bybit delta htx kucoin phemex woo
fetchPositionsForSymbol
fetch all open positions for specific symbol
Kind: instance
Returns: Array<object> - a list of position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: btse deepcoin hashkey okx weex
fetchPositionsHistory
fetches historical positions
Kind: instance
Returns: Array<object> - a list of position structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified contract symbols |
| since | int | No | timestamp in ms of the earliest position to fetch, default=3 months ago, max range for params["until"] - since is 3 months |
| limit | int | No | the maximum amount of records to fetch, default=20, max=100 |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest position to fetch, max range for params["until"] - since is 3 months |
| params.productType | string | No | USDT-FUTURES (default), COIN-FUTURES, USDC-FUTURES, SUSDT-FUTURES, SCOIN-FUTURES, or SUSDC-FUTURES |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
Supported exchanges: bitget blofin bybit extended gate krakenfutures kucoin mexc mudrex okx xt
fetchPositionsRisk
fetch positions risk
Kind: instance
Returns: object - data on the positions risk
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string>, undefined | Yes | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster
fetchPositionsWs
fetch all open positions
Kind: instance
Returns: Array<object> - a list of position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.returnRateLimits | boolean | No | set to true to return rate limit informations, defaults to false. |
| params.method | string, undefined | No | method to use. Can be account.position or v2/account.position |
Supported exchanges: binance coinbaseinternational
fetchSettlementHistory
fetches historical settlement records
Kind: instance
Returns: Array<object> - a list of settlement history objects
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the settlement history |
| since | int | No | timestamp in ms |
| limit | int | No | number of records, default 100, max 100 |
| params | object | No | exchange specific params |
Supported exchanges: binance bybit cryptocom delta derive gate htx okx
fetchSpotMarkets
retrieves data on all spot markets for hyperliquid
Kind: instance
Returns: Array<object> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: hyperliquid
fetchSpotOrder
fetch a spot order
Kind: instance
Returns: An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Order id |
| symbol | string | Yes | not sent to exchange except for trigger orders with clientOid, but used internally by CCXT to filter |
| params | object | No | exchange specific parameters |
| params.trigger | bool | No | true if fetching a trigger order |
| params.hf | bool | No | false, // true for hf order |
| params.clientOid | bool | No | unique order id created by users to identify their orders |
| params.marginMode | object | No | 'cross' or 'isolated' |
Supported exchanges: kucoin
fetchSpotOrdersByStatus
fetch a list of spot orders
Kind: instance
Returns: An array of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| status | string | Yes | not used for stop orders 'open' or 'closed' |
| symbol | string | Yes | unified market symbol |
| since | int | No | timestamp in ms of the earliest order |
| limit | int | No | max number of orders to return |
| params | object | No | exchange specific params |
| params.until | int | No | end time in ms |
| params.side | string | No | buy or sell |
| params.type | string | No | limit, market, limit_stop or market_stop |
| params.tradeType | string | No | TRADE for spot trading, MARGIN_TRADE or MARGIN_ISOLATED_TRADE for Margin Trading |
| params.currentPage | int | No | trigger orders only current page |
| params.orderIds | string | No | trigger orders only comma separated order ID list |
| params.trigger | bool | No | True if fetching a trigger order |
| params.hf | bool | No | false, // true for hf order |
| params.marginMode | string | No | 'cross' or 'isolated', only for margin orders |
Supported exchanges: kucoin
fetchStatus
the latest known information on the availability of the exchange API
Kind: instance
Returns: object - a status structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: backpack binance bitbns bitfinex bitrue bybit coincheck coinsph delta deribit digifinex foxbit hashkey htx hyperliquid kraken kucoin lighter mexc modetrade nado ndax okx paradex polymarket toobit weex whitebit woo woofipro zebpay
fetchSwapMarkets
retrieves data on all swap markets for hyperliquid
Kind: instance
Returns: Array<object> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: hyperliquid pacifica
fetchTicker
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.loc | string | No | crypto location, default: us |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bit2c bitbank bitfinex bitflyer bitget bithumb bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blockchaincom blofin btcbox btcmarkets btcturk btse bullish bybit cex coinbase coinbaseexchange coinbaseinternational coincheck coinmate coinone coinsph coinspot cryptocom cryptomus delta deribit derive digifinex extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx independentreserve indodax kraken krakenfutures kucoin latoken lbank lighter luno mercado mexc modetrade mudrex nado ndax okx onetrading p2b paradex paymium phemex poloniex polymarket revolutx tokocrypto upbit whitebit woo woofipro xt zaif zebpay
fetchTickerWs
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.method | string | No | method to use can be ticker.price or ticker.book |
| params.returnRateLimits | boolean | No | return the rate limits for the exchange |
Supported exchanges: binance cex
fetchTickers
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance
Returns: object - a dictionary of ticker structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified symbols of the markets to fetch tickers for, defaults to all markets |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.loc | string | No | crypto location, default: us |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bitbns bitfinex bitget bithumb bitopro bitrue bitstamp bitteam bittrade bitvavo blockchaincom blofin btcbox btcturk btse bybit cex coinbase coinbaseexchange coinbaseinternational coinmate coinone coinsph coinspot cryptocom deepcoin delta deribit digifinex extended foxbit gate gemini hashkey hitbtc hollaex htx hyperliquid indodax kraken krakenfutures kucoin latoken lbank lighter luno mexc modetrade mudrex nado ndax okx onetrading p2b pacifica paradex phemex poloniex polymarket revolutx tokocrypto toobit upbit weex whitebit woo woofipro xt zebpay
fetchTime
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance
Returns: int - the current integer timestamp in milliseconds from the exchange server
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bitget bitrue bittrade bitvavo btcmarkets btse bullish bybit cex coinbase coinbaseexchange coinbaseinternational coinmate coinsph delta deribit derive digifinex dydx gate hashkey hibachi htx hyperliquid indodax kraken kucoin latoken lbank lighter mexc modetrade nado okx onetrading paradex poloniex polymarket tokocrypto toobit weex whitebit woo woofipro xt zebpay
fetchTrades
get the list of most recent trades for a particular symbol
Kind: instance
Returns: Array<Trade> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch trades for |
| since | int | No | timestamp in ms of the earliest trade to fetch |
| limit | int | No | the maximum amount of trades to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.loc | string | No | crypto location, default: us |
| params.method | string | No | method, default: marketPublicGetV1beta3CryptoLocTrades |
Supported exchanges: alpaca apex aster backpack bigone binance bingx bit2c bitbank bitbns bitfinex bitflyer bitget bithumb bitopro bitrue bitso bitstamp bitteam bittrade bitvavo blofin btcbox btcmarkets btcturk btse bullish bybit cex coinbase coinbaseexchange coincheck coinmate coinone coinsph coinspot cryptocom cryptomus deepcoin delta deribit derive digifinex dydx extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx hyperliquid independentreserve indodax kraken krakenfutures kucoin latoken lbank lighter luno mercado mexc modetrade nado ndax okx p2b pacifica paradex paymium phemex poloniex polymarket revolutx tokocrypto toobit upbit weex whitebit woo woofipro xt zaif zebpay
fetchTradesWs
fetch all trades made by the user
Kind: instance
Returns: Array<object> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trades structures to retrieve, default=500, max=1000 |
| params | object | No | extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.fromId | int | No | trade ID to begin at |
Supported exchanges: binance
fetchTradingFee
fetch the trading fees for a market
Kind: instance
Returns: object - a fee structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster binance bingx bitflyer bitget bitstamp bitvavo btse bybit coinmate coinsph cryptocom digifinex extended gate hashkey hitbtc htx hyperliquid kraken kucoin latoken lbank luno mexc okx pacifica paradex upbit weex woo xt zebpay
fetchTradingFees
fetch the trading fees for multiple markets
Kind: instance
Returns: object - a dictionary of fee structures indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subType | string | No | "linear" or "inverse" |
Supported exchanges: binance bit2c bitbank bitfinex bitget bitopro bitso bitstamp bitvavo blockchaincom btse bybit cex coinbase coinbaseexchange coincheck coinsph cryptocom cryptomus deribit extended foxbit gate gemini hashkey hibachi hitbtc hollaex independentreserve krakenfutures lbank modetrade onetrading pacifica paradex poloniex polymarket toobit upbit whitebit woo woofipro xt zebpay
fetchTradingFeesWs
fetch the trading fees for multiple markets
Kind: instance
Returns: object - a dictionary of fee structures indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bitvavo
fetchTradingLimits
fetch the trading limits for a market
Kind: instance
Returns: object - a trading limits structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string>, undefined | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: whitebit
fetchTransactionFee
fetch the fee for a transaction
Kind: instance
Returns: object - a fee structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: indodax kucoin
fetchTransactionFees
please use fetchDepositWithdrawFees instead
Kind: instance
Returns: Array<object> - a list of fee structures
| Param | Type | Required | Description |
|---|---|---|---|
| codes | Array<string>, undefined | Yes | not used by fetchTransactionFees () |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bitso bitstamp gate lbank mexc whitebit
fetchTransactions
fetch history of deposits, withdrawals, and transfers
Kind: instance
Returns: Array<Transaction> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| since | int | No | the earliest time in ms to fetch transactions for |
| limit | int | No | the maximum number of transaction structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
Supported exchanges: extended foxbit latoken whitebit
fetchTransfer
fetches a transfer
Kind: instance
Returns: object - a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | transfer id |
| code | string | No | unified currency code of the currency transferred |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bitvavo mexc okx poloniex
fetchTransfers
fetch a history of internal transfers made on an account
Kind: instance
Returns: Array<object> - a list of transfer structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency transferred |
| since | int | No | the earliest time in ms to fetch transfers for |
| limit | int | No | the maximum number of transfers structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch transfers for |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.internal | boolean | No | default false, when true will fetch pay trade history |
Supported exchanges: binance bingx bitget bitrue bitvavo bullish bybit coinbaseinternational deribit derive digifinex dydx extended grvt htx kucoin latoken lighter mexc okx paradex phemex poloniex weex woo
fetchUnderlyingAssets
fetches the market ids of underlying assets for a specific contract market type
Kind: instance
Returns: Array<object> - a list of underlying assets
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | exchange specific params |
| params.type | string | No | the contract market type, 'option', 'swap' or 'future', the default is 'option' |
fetchUtaBalance
helper method for fetching balance with unified trading account (uta) endpoint
Kind: instance
Returns: object - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.type | string | No | 'unified', 'spot', 'funding', 'cross', 'isolated' or 'swap' (default is 'unified') |
| params.marginMode | string | No | 'cross' or 'isolated', margin type for fetching margin balance, only applicable if type is margin (default is cross) |
Supported exchanges: kucoin
fetchUtaOrder
fetch uta order
Kind: instance
Returns: object - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.accountMode | string | No | 'unified' or 'classic' (default is 'unified') |
| params.clientOrderId | string | No | client order id, required if id is not provided |
| params.marginMode | string | No | 'cross' or 'isolated', required if fetching a margin order (unified accountMode supports only cross margin) |
Supported exchanges: kucoin
fetchUtaOrdersByStatus
helper method for fetching orders by status with uta endpoint
Kind: instance
Returns: An array of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| status | string | Yes | 'active' or 'closed', only 'active' is valid for stop orders |
| symbol | string | Yes | unified symbol for the market to retrieve orders from |
| since | int | No | timestamp in ms of the earliest order to retrieve |
| limit | int | No | The maximum number of orders to retrieve |
| params | object | No | exchange specific parameters |
| params.until | int | No | End time in ms |
| params.side | string | No | closed orders only 'BUY' or 'SELL' |
| params.accountMode | string | No | 'unified' or 'classic' (default is unified) |
| params.marginMode | string | No | 'cross' or 'isolated', only for margin orders (unified accountMode supports only cross margin) |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
Supported exchanges: kucoin
fetchVolatilityHistory
fetch the historical volatility of an option market based on an underlying asset
Kind: instance
Returns: Array<object> - a list of volatility history objects
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.period | int | No | the period in days to fetch the volatility for: 7,14,21,30,60,90,180,270 |
Supported exchanges: bybit deribit
fetchWithdrawal
fetch data on a currency withdrawal via the withdrawal id, looks back 30 days for uta accounts and 90 days otherwise
Kind: instance
Returns: object - a transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | withdrawal id |
| code | string | No | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
Supported exchanges: bitget bithumb bitopro blockchaincom blofin hollaex okx upbit
fetchWithdrawalWhitelist
fetch a list of allowed withdrawal addresses
Kind: instance
Returns: Array<object> - a list response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.generation | int | No | only generation 2 is supported if you want to use the API generation 1 or 2, default is 2 |
Supported exchanges: bithumb
fetchWithdrawals
fetch all withdrawals made from an account
Kind: instance
Returns: Array<object> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| since | int | No | the earliest time in ms to fetch withdrawals for |
| limit | int | No | the maximum number of withdrawal structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca backpack bigone binance bingx bitbns bitflyer bitget bithumb bitopro bitrue bitstamp bittrade bitvavo blockchaincom blofin btcmarkets btse bybit coinbase coinbaseexchange coinbaseinternational coincheck coinsph cryptocom deepcoin deribit derive digifinex dydx extended foxbit gate grvt hashkey hibachi hitbtc hollaex htx hyperliquid kraken kucoin lbank lighter mexc modetrade nado ndax okx pacifica paradex phemex poloniex polymarket tokocrypto toobit upbit whitebit woo woofipro xt
fetchWithdrawalsWs
fetch all withdrawals made from an account
Kind: instance
Returns: Array<object> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| since | int | No | the earliest time in ms to fetch withdrawals for |
| limit | int | No | the maximum number of withdrawals structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bitvavo
isUTAEnabled
returns true or false so the user can check if unified account is enabled
Kind: instance
Returns: boolean - true if unified account is enabled, false otherwise
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: kucoin
isUnifiedEnabled
returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
Kind: instance
Returns: any - [enableUnifiedMargin, enableUnifiedAccount]
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bybit hyperliquid
loadMigrationStatus
loads the migration status for the account (hf or not)
Kind: instance
Returns: any - ignore
| Param | Type | Description |
|---|---|---|
| force | boolean | load account state for non hf |
Supported exchanges: kucoin
loadUnifiedStatus
returns unifiedAccount so the user can check if the unified account is enabled
Kind: instance
Returns: boolean - true or false if the enabled unified account is enabled or not and sets the unifiedAccount option if it is undefined
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: gate
parseMarket
parses a classic or uta instrument into a unified market
Kind: instance
Returns: object - a market structure
| Param | Type | Description |
|---|---|---|
| market | object | the exchange instrument |
Supported exchanges: bitget
preLoadLighterLibrary
if the required credentials are available in options, it will pre-load the lighter Signer to avoid delaying sensitive calls like createOrder the first time they're executed
Kind: instance
Returns: boolean - true if the signer was loaded, false otherwise
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: lighter
redeemGiftCode
redeem gift code
Kind: instance
Returns: object - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| giftcardCode | string | Yes | |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance
reduceMargin
remove margin from a position
Kind: instance
Returns: object - a margin structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| amount | float | Yes | the amount of margin to remove |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster binance bitget delta digifinex gate hashkey hitbtc hyperliquid kucoin lighter mexc mudrex okx poloniex polymarket weex woo woofipro xt zebpay
repayCrossMargin
repay borrowed margin and interest
Kind: instance
Returns: object - a margin loan structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency to repay |
| amount | float | Yes | the amount to repay |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean | No | set to true if you would like to repay margin in a portfolio margin account |
| params.repayCrossMarginMethod | string | No | portfolio margin only 'papiPostRepayLoan' (default), 'papiPostMarginRepayDebt' (alternative) |
| params.specifyRepayAssets | string | No | portfolio margin papiPostMarginRepayDebt only specific asset list to repay debt |
Supported exchanges: binance bitget bybit gate htx kucoin okx
repayIsolatedMargin
repay borrowed margin and interest
Kind: instance
Returns: object - a margin loan structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol, required for isolated margin |
| code | string | Yes | unified currency code of the currency to repay |
| amount | float | Yes | the amount to repay |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bitget gate htx kucoin
repayMargin
repay borrowed margin and interest
Kind: instance
Returns: object - a margin loan structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency to repay |
| amount | float | Yes | the amount to repay |
| symbol | string | Yes | not used by woo.repayMargin () |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: woo
reserveRequestWeight
Instead of trading to increase the address based rate limits, this action allows reserving additional actions for 0.0005 USDC per request. The cost is paid from the Perps balance.
Kind: instance
Returns: object - a response object
| Param | Type | Required | Description |
|---|---|---|---|
| weight | number | Yes | the weight to reserve, 1 weight = 1 action, 0.0005 USDC per action |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: hyperliquid
revokeApiKey
revokes an api key of the account
Kind: instance
Returns: object - the api result
| Param | Type | Required | Description |
|---|---|---|---|
| apiKey | string | Yes | the api key to revoke |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: pacifica
revokeBuilderCode
revokes a previously approved builder code
Kind: instance
Returns: object - the api result
| Param | Type | Required | Description |
|---|---|---|---|
| builderCode | string | Yes | the builder code to revoke |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: pacifica
setAgentAbstraction
set agent abstraction mode
Kind: instance
Returns: dictionary response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| abstraction | string | Yes | one of the strings ["i", "u", "p"] where "i" is "disabled", "u" is "unifiedAccount", and "p" is "portfolioMargin" |
| params | object | No |
Supported exchanges: hyperliquid
setContractLeverage
set the level of leverage for a market
Kind: instance
Returns: object - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | float | Yes | the rate of leverage |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.uta | boolean | No | set to true for the unified trading account (uta) |
Supported exchanges: kucoin
setLeverage
set the level of leverage for a market
Kind: instance
Returns: object - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | float | Yes | the rate of leverage |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: apex aster binance bingx bitget bitrue blofin btse bybit coinbaseinternational deepcoin delta digifinex extended gate grvt hashkey hitbtc htx hyperliquid krakenfutures kucoin lighter mexc modetrade mudrex okx pacifica paradex phemex poloniex polymarket toobit weex whitebit woo woofipro xt zebpay
setMargin
Either adds or reduces margin in an isolated position in order to set the margin to a specific value
Kind: instance
Returns: object - A margin structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market to set margin in |
| amount | float | Yes | the amount to set the margin to |
| params | object | No | parameters specific to the exchange API endpoint |
| params.positionSide | string | No | "LONG" or "SHORT", required for Coin-M |
Supported exchanges: bingx bitfinex bitrue lighter phemex
setMarginMode
set margin mode to 'cross' or 'isolated'
Kind: instance
Returns: object - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | string | Yes | 'cross' or 'isolated' |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster binance bingx bitget blofin btse bybit delta digifinex hashkey hyperliquid kucoin lighter mexc okx pacifica paradex phemex polymarket toobit weex woofipro xt
setPositionMode
set hedged to true or false for a market
Kind: instance
Returns: object - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| hedged | bool | Yes | set to true to use dualSidePosition |
| symbol | string | Yes | not used by setPositionMode () |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster binance bingx bitget blofin btse bybit gate htx kucoin mexc okx phemex poloniex weex woo
setSandboxMode
enables or disables demo trading mode, if enabled will send PAPTRADING=1 in headers
Kind: instance
| Param |
|---|
| enabled |
Supported exchanges: bitget
setUserAbstraction
set user abstraction mode
Kind: instance
Returns: dictionary response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| abstraction | string | Yes | one of the strings ["disabled", "unifiedAccount", "portfolioMargin"], |
| params | object | No | |
| params.type | string | No | 'userSetAbstraction' or 'agentSetAbstraction' default is 'userSetAbstraction' |
Supported exchanges: hyperliquid
signIn
sign in, must be called prior to using other authenticated methods
Kind: instance
Returns: response from exchange
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster bullish grvt ndax
transfer
transfer currency internally between wallets on the same account
Kind: instance
Returns: object - a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | amount to transfer |
| fromAccount | string | Yes | account to transfer from |
| toAccount | string | Yes | account to transfer to |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.transferId | string | No | UUID, which is unique across the platform |
Supported exchanges: apex aster bigone binance bingx bitfinex bitget bitrue bitstamp bitvavo blofin bullish bybit cex coinbase deepcoin deribit derive digifinex dydx extended gate grvt hashkey hitbtc htx hyperliquid kraken krakenfutures kucoin kucoinfutures latoken lighter mexc mudrex okx pacifica paymium phemex poloniex toobit whitebit woo xt
transferClassic
transfer currency internally between wallets on the same account with classic endpoints
Kind: instance
Returns: object - a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | amount to transfer |
| fromAccount | string | Yes | account to transfer from |
| toAccount | string | Yes | account to transfer to |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.transferType | string | No | INTERNAL, PARENT_TO_SUB, SUB_TO_PARENT (default is INTERNAL) |
| params.fromUserId | string | No | required if transferType is SUB_TO_PARENT |
| params.toUserId | string | No | required if transferType is PARENT_TO_SUB |
Supported exchanges: kucoin
transferOut
transfer from spot wallet to futures wallet
Kind: instance
Returns: a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | str | Yes | Unified currency code |
| amount | float | Yes | Size of the transfer |
| params | dict | No | Exchange specific parameters |
Supported exchanges: kraken krakenfutures
transferUta
transfer currency internally between wallets on the same account with uta endpoint
Kind: instance
Returns: object - a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | amount to transfer |
| fromAccount | string | Yes | account to transfer from |
| toAccount | string | Yes | account to transfer to |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.transferType | string | No | INTERNAL, PARENT_TO_SUB, SUB_TO_PARENT, SUB_TO_SUB (default is INTERNAL) |
| params.fromUserId | string | No | required if transferType is SUB_TO_PARENT or SUB_TO_SUB |
| params.toUserId | string | No | required if transferType is PARENT_TO_SUB or SUB_TO_SUB |
Supported exchanges: kucoin
unWatchBalance
unsubscribes from all capital-account asset updates
Kind: instance
Returns: object - unsubscription result
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra exchange-specific parameters |
| params.stock | boolean | No | accepts the tokenized stock view selector; explicit because this method has no symbol |
Supported exchanges: backpack hyperliquid
unWatchBidsAsks
unWatches best bid & ask for symbols
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster backpack binance coinbaseinternational mexc nado weex woo
unWatchFundingRate
stops watching the funding rate for a symbol
Kind: instance
Returns: object - the exchange response
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.route | string | No | auto (default), deribit, or coinbase; overrides options.route |
Supported exchanges: coinbaseinternational kucoin mexc
unWatchFundingRates
stops watching funding rates for multiple symbols
Kind: instance
Returns: object - the exchange response
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.route | string | No | auto (default), deribit, or coinbase; overrides options.route |
Supported exchanges: coinbaseinternational
unWatchMarkPrice
unWatches a mark price for a specific market
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.use1sFreq | boolean | No | default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds |
Supported exchanges: aster binance coinbaseinternational kucoin lighter
unWatchMarkPrices
watches the mark price for all markets
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.use1sFreq | boolean | No | default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds |
Supported exchanges: aster binance coinbaseinternational lighter
unWatchMyTrades
unWatches information on multiple trades made by the user
Kind: instance
Returns: Array<object> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.unifiedMargin | boolean | No | use unified margin account |
| params.executionFast | boolean | No | use fast execution |
Supported exchanges: bybit coinbaseinternational derive hyperliquid lighter nado pacifica weex
unWatchOHLCV
unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster backpack binance bingx bitfinex bitget bitvavo blofin bybit coinbaseinternational cryptocom deepcoin dydx gate htx hyperliquid kucoin mexc nado okx pacifica phemex weex woo
unWatchOHLCVForSymbols
unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbolsAndTimeframes | Array<Array<string>> | Yes | array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']] |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster backpack binance bitvavo blofin bybit coinbaseinternational nado okx weex
unWatchOrderBook
unsubscribe from the orderbook channel
Kind: instance
Returns: object - A dictionary of order book structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | symbol of the market to unwatch the trades for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.limit | int | No | orderbook limit, default is undefined |
Supported exchanges: aster backpack binance bingx bitget bitvavo bybit coinbaseinternational cryptocom deepcoin derive dydx gate htx hyperliquid kucoin lighter mexc nado okx pacifica weex woo
unWatchOrderBookForSymbols
unsubscribe from the orderbook channel
Kind: instance
Returns: object - A dictionary of order book structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to unwatch the trades for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.limit | int | No | orderbook limit, default is undefined |
Supported exchanges: aster backpack binance bitvavo bybit coinbaseinternational cryptocom kucoin nado okx weex
unWatchOrders
unWatches information on multiple orders made by the user
Kind: instance
Returns: Array<object> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the market orders were made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.stock | boolean | No | selects tokenized stock order subscriptions |
Supported exchanges: backpack bybit coinbaseinternational derive hyperliquid lighter nado pacifica weex
unWatchPositions
unWatches from the stream channel
Kind: instance
Returns: Array<object> - a list of position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols to watch positions for |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
Supported exchanges: backpack bybit coinbaseinternational hyperliquid nado weex
unWatchTicker
unWatches a price ticker
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster backpack binance bingx bitfinex bitget bybit coinbaseinternational cryptocom deepcoin derive htx hyperliquid kucoin lighter mexc nado okx weex woo
unWatchTickers
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster backpack binance bybit coinbaseinternational cryptocom hyperliquid lighter mexc nado okx pacifica weex woo
unWatchTrades
unsubscribe from the trades channel
Kind: instance
Returns: Array<object> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market trades were made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster backpack binance bingx bitfinex bitget bitvavo blofin bybit coinbaseinternational cryptocom deepcoin derive dydx gate htx hyperliquid kucoin lighter mexc nado okx pacifica phemex weex woo
unWatchTradesForSymbols
unsubscribe from the trades channel
Kind: instance
Returns: Array<object> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch trades for |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster backpack binance bitvavo blofin bybit coinbaseinternational cryptocom gate kucoin nado okx weex
upgradeUnifiedTradeAccount
upgrades the account to unified trade account warning this is irreversible
Kind: instance
Returns: any - nothing
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: bybit
verifyGiftCode
verify gift code
Kind: instance
Returns: object - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | reference number id |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance
watchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance
Returns: object - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.type | string | No | 'spot' or 'swap', default is 'spot' |
Supported exchanges: aster backpack binance bingx bitfinex bitget bithumb bitopro blockchaincom blofin bullish bybit cex coinbaseinternational cryptocom deribit derive extended gate hashkey hollaex htx hyperliquid kucoin lighter mexc modetrade okx onetrading phemex toobit upbit weex whitebit woo woofipro
watchBidsAsks
watches best bid & ask for symbols
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: aster backpack binance bitget bitvavo blofin bybit coinbaseinternational cryptocom deribit derive gate gemini kucoin mexc modetrade nado okx weex woo woofipro
watchFundingRate
watch the current funding rate
Kind: instance
Returns: object - a funding rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: blofin coinbaseinternational extended kucoin mexc okx woo
watchFundingRates
watch the funding rate for multiple markets
Kind: instance
Returns: object - a dictionary of funding rates structures, indexe by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | a list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.route | string | No | auto (default), deribit, or coinbase; overrides options.route |
Supported exchanges: coinbaseinternational okx
watchLiquidations
watch the public liquidations of a trading pair
Kind: instance
Returns: object - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| since | int | No | the earliest time in ms to fetch liquidations for |
| limit | int | No | the maximum number of liquidation structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance bybit lighter
watchLiquidationsForSymbols
watch the public liquidations of a trading pair
Kind: instance
Returns: object - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | list of unified market symbols |
| since | int | No | the earliest time in ms to fetch liquidations for |
| limit | int | No | the maximum number of liquidation structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance okx
watchMarkPrice
watches a mark price for a specific market
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.use1sFreq | boolean | No | default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds |
Supported exchanges: aster binance coinbaseinternational extended kucoin lighter okx
watchMarkPrices
watches the mark price for all markets
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.use1sFreq | boolean | No | default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds |
Supported exchanges: aster binance coinbaseinternational lighter okx
watchMyLiquidations
watch the private liquidations of a trading pair
Kind: instance
Returns: object - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| since | int | No | the earliest time in ms to fetch liquidations for |
| limit | int | No | the maximum number of liquidation structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance gate hyperliquid
watchMyLiquidationsForSymbols
watch the private liquidations of a trading pair
Kind: instance
Returns: object - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | list of unified market symbols |
| since | int | No | the earliest time in ms to fetch liquidations for |
| limit | int | No | the maximum number of liquidation structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: binance gate hyperliquid okx
watchMyTrades
watches information on multiple trades made by the user
Kind: instance
Returns: Array<object> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market trades were made in |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trade structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.unifiedMargin | boolean | No | use unified margin account |
Supported exchanges: alpaca apex aster binance bingx bitfinex bitget bitopro bitvavo bullish bybit cex coinbaseinternational cryptocom deepcoin deribit derive extended gate grvt hashkey hollaex htx hyperliquid kucoin lighter mexc modetrade nado okx onetrading pacifica phemex toobit upbit weex whitebit woo woofipro
watchOHLCV
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca apex aster backpack binance bingx bitfinex bitget bittrade bitvavo blockchaincom blofin bybit cex coinbaseinternational cryptocom deepcoin deribit dydx extended gate gemini grvt hashkey htx hyperliquid kucoin mexc modetrade nado ndax okx onetrading pacifica phemex toobit upbit weex whitebit woo woofipro
watchOHLCVForSymbols
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: object - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbolsAndTimeframes | Array<Array<string>> | Yes | array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']] |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: apex aster backpack binance bitvavo blofin bybit coinbaseinternational deribit grvt nado okx toobit weex
watchOrderBook
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance
Returns: object - an order book structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| limit | int | No | the maximum amount of order book entries to return. |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca apex aster backpack binance bingx bitfinex bitget bithumb bitopro bittrade bitvavo blockchaincom blofin bullish bybit cex coinbaseinternational coincheck coinone cryptocom deepcoin deribit derive dydx extended gate gemini grvt hashkey hollaex htx hyperliquid independentreserve kucoin lighter luno mexc modetrade nado ndax okx onetrading pacifica phemex toobit upbit weex whitebit woo woofipro
watchOrderBookForSymbols
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance
Returns: object - an order book structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified array of symbols |
| limit | int | No | the maximum amount of order book entries to return. |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: apex aster backpack binance bitget bitvavo blofin bybit coinbaseinternational cryptocom deribit gemini grvt kucoin nado okx toobit weex
watchOrders
watches information on multiple orders made by the user
Kind: instance
Returns: Array<object> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca apex aster backpack binance bingx bitfinex bitget bithumb bitvavo blofin bullish bybit cex coinbaseinternational cryptocom deepcoin deribit derive extended gate grvt hashkey hollaex htx hyperliquid kucoin mexc modetrade nado okx onetrading pacifica phemex toobit upbit weex whitebit woo woofipro
watchOrdersForSymbols
watches information on multiple orders made by the user across multiple symbols
Kind: instance
Returns: Array<object> - a list of [order structures]{@link /docs/manual#order-structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | boolean | No | set to true for trigger orders |
Supported exchanges: blofin coinbaseinternational
watchPosition
watch open positions for a specific symbol
Kind: instance
Returns: object - a position structure
| Param | Type | Description |
|---|---|---|
| symbol | string, undefined | unified market symbol |
| params | object | extra parameters specific to the exchange API endpoint |
Supported exchanges: kucoin
watchPositions
watch all open positions
Kind: instance
Returns: Array<object> - a list of position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| since | int | No | the earliest time in ms to fetch positions for |
| limit | int | No | the maximum number of positions to retrieve |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
Supported exchanges: apex aster backpack binance bingx bitget blofin bullish bybit coinbaseinternational cryptocom deepcoin derive extended gate grvt hashkey htx hyperliquid kucoin modetrade nado okx toobit weex woo woofipro
watchTicker
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca apex aster backpack binance bingx bitfinex bitget bithumb bitopro bittrade bitvavo blockchaincom blofin bullish bybit cex coinbaseinternational coinone cryptocom deepcoin deribit derive gate grvt hashkey htx hyperliquid kucoin lighter mexc modetrade nado ndax okx onetrading pacifica phemex toobit upbit weex whitebit woo woofipro
watchTickers
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance
Returns: object - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: apex aster backpack binance bitget bithumb bitvavo blofin bybit cex coinbaseinternational cryptocom deribit gate grvt hyperliquid kucoin lighter mexc modetrade nado okx onetrading pacifica phemex toobit upbit weex whitebit woo woofipro
watchTrades
watches information on multiple trades made in a market
Kind: instance
Returns: Array<object> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market trades were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of trade structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: alpaca apex aster backpack binance bingx bitfinex bitget bithumb bitopro bittrade bitvavo blockchaincom blofin bullish bybit cex coinbaseinternational coincheck coinone cryptocom deepcoin deribit derive dydx extended gate gemini grvt hashkey hollaex htx hyperliquid independentreserve kucoin lighter luno mexc modetrade nado ndax okx pacifica phemex toobit upbit weex whitebit woo woofipro
watchTradesForSymbols
get the list of most recent trades for a list of symbols
Kind: instance
Returns: Array<object> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | unified symbol of the market to fetch trades for |
| since | int | No | timestamp in ms of the earliest trade to fetch |
| limit | int | No | the maximum amount of trades to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
Supported exchanges: apex aster backpack binance bitget bitvavo blofin bybit coinbaseinternational cryptocom deribit gate gemini grvt kucoin nado okx toobit upbit weex
withdraw
make a withdrawal
Kind: instance
Returns: object - a transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | the amount to withdraw |
| address | string | Yes | the address to withdraw to |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.tag | string | No | memo / destination tag, required for currencies in options['withdrawTagRequiredCurrencies'] |
Supported exchanges: alpaca aster backpack bigone binance bingx bitbank bitfinex bitflyer bitget bithumb bitopro bitrue bitso bitstamp bittrade bitvavo blockchaincom blofin btcmarkets bullish bybit coinbase coinbaseexchange coinmate coinsph cryptocom deribit derive digifinex dydx extended foxbit gate gemini grvt hashkey hibachi hitbtc hollaex htx hyperliquid independentreserve indodax kraken kucoin lbank lighter mercado mexc modetrade ndax okx pacifica phemex poloniex polymarket tokocrypto toobit upbit whitebit woo woofipro xt zaif
withdrawWs
make a withdrawal
Kind: instance
Returns: object - a transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | the amount to withdraw |
| address | string | Yes | the address to withdraw to |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.tag | string | No | memo / destination tag, required for currencies in options['withdrawTagRequiredCurrencies'] |
Supported exchanges: bitvavo