wiki/baseSpec.md
<a name="addMargin" id="addmargin"></a>
add margin
Kind: instance
Returns: <code>object</code> - a margin structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| amount | <code>float</code> | Yes | amount of margin to add |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.account | <code>Account</code> | No | account id to use, required |
<a name="borrowCrossMargin" id="borrowcrossmargin"></a>
create a loan to borrow margin
Kind: instance
Returns: <code>object</code> - a margin loan structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency to borrow |
| amount | <code>float</code> | Yes | the amount to borrow |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to borrow margin in a portfolio margin account |
<a name="borrowIsolatedMargin" id="borrowisolatedmargin"></a>
create a loan to borrow margin
Kind: instance
Returns: <code>object</code> - a margin loan structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, required for isolated margin |
| code | <code>string</code> | Yes | unified currency code of the currency to borrow |
| amount | <code>float</code> | Yes | the amount to borrow |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="calculatePricePrecision" id="calculatepriceprecision"></a>
Helper function to calculate the Hyperliquid DECIMAL_PLACES price precision
Kind: instance
Returns: <code>int</code> - The calculated price precision
| Param | Type | Description |
|---|---|---|
| price | <code>float</code> | the price to use in the calculation |
| amountPrecision | <code>int</code> | the amountPrecision to use in the calculation |
| maxDecimals | <code>int</code> | the maxDecimals to use in the calculation |
<a name="cancelAllContractOrders" id="cancelallcontractorders"></a>
helper method for cancelling all contract orders
Kind: instance
Returns: Response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>object</code> | No | When true, all the trigger orders will be cancelled |
<a name="cancelAllOrders" id="cancelallorders"></a>
cancel all open orders in a market
Kind: instance
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | alpaca cancelAllOrders cannot setting symbol, it will cancel all open orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="cancelAllOrdersAfter" id="cancelallordersafter"></a>
dead man's switch, cancel all orders after the given timeout
Kind: instance
Returns: <code>object</code> - the api result
| Param | Type | Required | Description |
|---|---|---|---|
| timeout | <code>number</code> | Yes | time in milliseconds, 0 represents cancel the timer |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | spot or swap market |
<a name="cancelAllOrdersWs" id="cancelallordersws"></a>
cancel all open orders in a market
Kind: instance
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified market symbol of the market to cancel orders in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="cancelAllSpotOrders" id="cancelallspotorders"></a>
helper method for cancelling all spot orders
Kind: instance
Returns: Response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>bool</code> | No | invalid for isolated margin true if cancelling all stop orders |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' |
| params.orderIds | <code>string</code> | No | stop orders only Comma separated order IDs |
| params.hf | <code>bool</code> | No | false, // true for hf order |
<a name="cancelAllUtaOrders" id="cancelallutaorders"></a>
helper method for cancelling all uta orders
Kind: instance
Returns: Response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>bool</code> | No | true if cancelling all stop orders |
| params.marginMode | <code>string</code> | No | 'CROSS' or 'ISOLATED' |
<a name="cancelContractOrder" id="cancelcontractorder"></a>
helper method for cancelling contract orders
Kind: instance
Returns: <code>object</code> - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | <code>string</code> | No | cancel order by client order id |
<a name="cancelOrder" id="cancelorder"></a>
cancels an open order
Kind: instance
Returns: <code>object</code> - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="cancelOrderWs" id="cancelorderws"></a>
cancel multiple orders
Kind: instance
Returns: <code>object</code> - an list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | No | unified market symbol, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.cancelRestrictions | <code>string</code>, <code>undefined</code> | 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 | <code>boolean</code> | No | set to true if you would like to cancel a conditional order |
<a name="cancelOrders" id="cancelorders"></a>
cancel multiple orders
Kind: instance
Returns: <code>Array<Order></code> - an list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| ids | <code>Array<string></code> | Yes | order ids |
| symbol | <code>string</code> | No | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.account | <code>Account</code> | No | account to cancel orders for, required |
<a name="cancelOrdersForSymbols" id="cancelordersforsymbols"></a>
cancel multiple orders for multiple symbols
Kind: instance
Returns: <code>object</code> - an list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array<CancellationRequest></code> | Yes | list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}] |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="cancelOrdersRequest" id="cancelordersrequest"></a>
build the request payload for cancelling multiple orders
Kind: instance
Returns: <code>object</code> - the raw request object to be sent to the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| ids | <code>Array<string></code> | Yes | order ids |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No |
<a name="cancelOrdersWs" id="cancelordersws"></a>
cancel multiple orders
Kind: instance
Returns: <code>object</code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| ids | <code>Array<string></code> | Yes | order ids |
| symbol | <code>string</code> | Yes | not used by cex cancelOrders() |
| params | <code>object</code> | No | extra parameters specific to the cex api endpoint |
<a name="cancelSpotOrder" id="cancelspotorder"></a>
helper method for cancelling spot orders
Kind: instance
Returns: Response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>bool</code> | No | True if cancelling a stop order |
| params.hf | <code>bool</code> | No | false, // true for hf order |
| params.sync | <code>bool</code> | No | false, // true to use the hf sync call |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' |
<a name="cancelTwapOrder" id="canceltwaporder"></a>
cancels a running twap order
Kind: instance
Returns: <code>object</code> - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.expiresAfter | <code>int</code> | No | time in ms after which the twap order expires |
| params.vaultAddress | <code>string</code> | No | the vault address for order |
<a name="cancelUtaOrder" id="cancelutaorder"></a>
helper method for cancelling uta orders
Kind: instance
Returns: Response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountMode | <code>string</code> | No | 'unified' or 'classic' (default is 'unified') |
| params.clientOrderId | <code>string</code> | No | client order id, required if id is not provided |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', required if fetching a margin order (unified accountMode supports only cross margin) |
<a name="closeAllPositions" id="closeallpositions"></a>
closes all open positions for a market type
Kind: instance
Returns: <code>Array<object></code> - A list of position structures
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.productType | <code>string</code> | No | 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES' |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
<a name="closePosition" id="closeposition"></a>
closes open positions for a market
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| side | <code>string</code> | No | not used by bingx |
| params | <code>object</code> | No | extra parameters specific to the bingx api endpoint |
| params.positionId | <code>string</code>, <code>undefined</code> | No | the id of the position you would like to close |
<a name="closePositions" id="closepositions"></a>
closes open positions for a market
Kind: instance
Returns: <code>Array<object></code> - a list of position structures
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the bingx api endpoint |
| params.recvWindow | <code>string</code> | No | request valid time window value |
<a name="createAccount" id="createaccount"></a>
creates a sub-account under the main account
Kind: instance
Returns: <code>object</code> - a response object
| Param | Type | Required | Description |
|---|---|---|---|
| name | <code>string</code> | Yes | the name of the sub-account |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.expiresAfter | <code>int</code> | No | time in ms after which the sub-account will expire |
<a name="createContractOrder" id="createcontractorder"></a>
helper method for creating contract orders
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| type | <code>string</code> | Yes | 'limit' or 'market' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | the amount of currency to trade |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.takeProfit | <code>object</code> | No | takeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered and the triggerPriceType |
| params.stopLoss | <code>object</code> | No | stopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered and the triggerPriceType |
| params.triggerPrice | <code>float</code> | No | The price a trigger order is triggered at |
| params.stopLossPrice | <code>float</code> | No | price to trigger stop-loss orders |
| params.takeProfitPrice | <code>float</code> | No | price to trigger take-profit orders |
| params.reduceOnly | <code>bool</code> | No | A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true. |
| params.timeInForce | <code>string</code> | No | GTC, GTT, IOC, or FOK, default is GTC, limit orders only |
| params.postOnly | <code>bool</code> | No | Post only flag, invalid when timeInForce is IOC or FOK |
| params.cost | <code>float</code> | No | the cost of the order in units of USDT |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', default is 'isolated' |
| params.hedged | <code>bool</code> | No | swap and future only true for hedged mode, false for one way mode, default is false ----------------- Exchange Specific Parameters ----------------- |
| params.leverage | <code>float</code> | No | Leverage size of the order (mandatory param in request, default is 1) |
| params.clientOid | <code>string</code> | No | client order id, defaults to uuid if not passed |
| params.remark | <code>string</code> | No | remark for the order, length cannot exceed 100 utf8 characters |
| params.stop | <code>string</code> | No | 'up' or 'down', the direction the triggerPrice is triggered from, requires triggerPrice. down: Triggers when the price reaches or goes below the triggerPrice. up: Triggers when the price reaches or goes above the triggerPrice. |
| params.triggerPriceType | <code>string</code> | No | "last", "mark", "index" - defaults to "mark" |
| params.stopPriceType | <code>string</code> | No | exchange-specific alternative for triggerPriceType: TP, IP or MP |
| params.closeOrder | <code>bool</code> | No | set to true to close position |
| params.test | <code>bool</code> | No | set to true to use the test order endpoint (does not submit order, use to validate params) |
| params.forceHold | <code>bool</code> | No | A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default.\ |
| params.positionSide | <code>string</code> | No | swap and future only hedged two-way position side, LONG or SHORT |
<a name="createContractOrders" id="createcontractorders"></a>
helper method for creating contract orders in batch
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="createConvertTrade" id="createconverttrade"></a>
convert from one currency to another
Kind: instance
Returns: <code>object</code> - a conversion structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the id of the trade that you want to make |
| fromCode | <code>string</code> | Yes | the currency that you want to sell and convert from |
| toCode | <code>string</code> | Yes | the currency that you want to buy and convert into |
| amount | <code>float</code> | No | how much you want to trade in units of the from currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="createDepositAddress" id="createdepositaddress"></a>
create a currency deposit address
Kind: instance
Returns: <code>object</code> - an address structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency for the deposit address |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="createGiftCode" id="creategiftcode"></a>
create gift code
Kind: instance
Returns: <code>object</code> - The gift code id, code, currency and amount
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | gift code |
| amount | <code>float</code> | Yes | amount of currency for the gift |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="createMarkeSellOrderWithCost" id="createmarkesellorderwithcost"></a>
create a market sell order by providing the symbol and cost
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| cost | <code>float</code> | Yes | how much you want to trade in units of the quote currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="createMarketBuyOrderWithCost" id="createmarketbuyorderwithcost"></a>
create a market buy order by providing the symbol and cost
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| cost | <code>float</code> | Yes | how much you want to trade in units of the quote currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="createMarketOrderWithCost" id="createmarketorderwithcost"></a>
create a market order by providing the symbol, side and cost
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| cost | <code>float</code> | Yes | how much you want to trade in units of the quote currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="createMarketSellOrderWithCost" id="createmarketsellorderwithcost"></a>
create a market sell order by providing the symbol and cost
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| cost | <code>float</code> | Yes | how much you want to trade in units of the quote currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="createOrder" id="createorder"></a>
create a trade order
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of currency you want to trade in units of base currency |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.reduceOnly | <code>bool</code> | No | true or false whether the order is reduce-only |
| params.account | <code>Account</code> | No | account id to use, required |
<a name="createOrderWs" id="createorderws"></a>
create a trade order
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of currency you want to trade in units of base currency |
| price | <code>float</code>, <code>undefined</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.test | <code>boolean</code> | Yes | test order, default false |
| params.returnRateLimits | <code>boolean</code> | Yes | set to true to return rate limit information, default false |
<a name="createOrders" id="createorders"></a>
create a list of trade orders
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.account | <code>Account</code> | No | account id to use, required |
<a name="createOrdersRequest" id="createordersrequest"></a>
create a list of trade orders
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Description |
|---|---|---|
| orders | <code>Array</code> | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
<a name="createOrdersWs" id="createordersws"></a>
create a list of trade orders
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="createSpotOrder" id="createspotorder"></a>
create a trade order on spot market
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' or 'LIMIT_MAKER' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of you want to trade in units of the base currency |
| price | <code>float</code> | No | the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.cost | <code>float</code> | No | market buy only the quote quantity that can be used as an alternative for the amount |
| params.test | <code>bool</code> | No | whether to use the test endpoint or not, default is false |
| params.postOnly | <code>bool</code> | No | if true, the order will only be posted to the order book and not executed immediately |
| params.timeInForce | <code>string</code> | No | 'GTC', 'IOC', or 'PO' |
| params.clientOrderId | <code>string</code> | No | a unique id for the order |
<a name="createSpotOrders" id="createspotorders"></a>
helper method for creating spot orders in batch
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.hf | <code>bool</code> | No | false, // true for hf orders |
| params.sync | <code>bool</code> | No | false, // true to use the hf sync call |
<a name="createSubAccount" id="createsubaccount"></a>
creates a sub-account under the main account
Kind: instance
Returns: <code>object</code> - a response object
| Param | Type | Required | Description |
|---|---|---|---|
| name | <code>string</code> | Yes | unused argument |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.expiryWindow | <code>int</code> | No | time to live in milliseconds |
| params.subAccountAddress | <code>string</code> | No | The public key (address) of the sub-account to use for creation |
| params.subAccountPrivateKey | <code>string</code> | No | The private key of the sub-account to use for creation |
<a name="createSwapOrder" id="createswaporder"></a>
create a trade order on swap market
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' or 'STOP' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of you want to trade in units of the base currency |
| price | <code>float</code> | No | the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.postOnly | <code>bool</code> | No | if true, the order will only be posted to the order book and not executed immediately |
| params.reduceOnly | <code>bool</code> | No | true or false whether the order is reduce only |
| params.triggerPrice | <code>float</code> | No | The price at which a trigger order is triggered at |
| params.timeInForce | <code>string</code> | No | 'GTC', 'FOK', 'IOC', 'LIMIT_MAKER' or 'PO' |
| params.clientOrderId | <code>string</code> | No | a unique id for the order |
<a name="createTrailingAmountOrder" id="createtrailingamountorder"></a>
create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much you want to trade in units of the base currency, or number of contracts |
| price | <code>float</code> | No | the price for the order to be filled at, in units of the quote currency, ignored in market orders |
| trailingAmount | <code>float</code> | Yes | the quote amount to trail away from the current market price |
| trailingTriggerPrice | <code>float</code> | Yes | the price to activate a trailing order, default uses the price argument |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="createTrailingPercentOrder" id="createtrailingpercentorder"></a>
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much you want to trade in units of the base currency, or number of contracts |
| price | <code>float</code> | No | the price for the order to be filled at, in units of the quote currency, ignored in market orders |
| trailingPercent | <code>float</code> | Yes | the percent to trail away from the current market price |
| trailingTriggerPrice | <code>float</code> | Yes | the price to activate a trailing order, default uses the price argument |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="createTwapOrder" id="createtwaporder"></a>
create a trade order that is executed as a TWAP order over a specified duration.
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of currency you want to trade in units of base currency |
| duration | <code>int</code> | Yes | the duration of the TWAP order in milliseconds |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.randomize | <code>bool</code> | No | whether to randomize the time intervals of the TWAP order slices (default is false, meaning equal intervals) |
| params.reduceOnly | <code>bool</code> | No | true or false whether the order is reduce-only |
| params.expiresAfter | <code>int</code> | No | time in ms after which the twap order expires |
| params.vaultAddress | <code>string</code> | No | the vault address for order |
<a name="createUtaOrder" id="createutaorder"></a>
helper method for creating uta orders
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| type | <code>string</code> | Yes | 'limit' or 'market' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | the amount of currency to trade |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderId | <code>string</code> | No | client order id, defaults to uuid if not passed |
| params.cost | <code>float</code> | No | the cost of the order in units of quote currency |
| params.timeInForce | <code>string</code> | No | GTC, GTD, IOC, FOK or PO |
| params.postOnly | <code>bool</code> | No | Post only flag, invalid when timeInForce is IOC or FOK (default is false) |
| params.reduceOnly | <code>bool</code> | No | contract markets only A mark to reduce the position size only. Set to false by default |
| params.triggerPrice | <code>float</code> | No | The price a trigger order is triggered at |
| params.triggerDirection | <code>string</code> | No | 'ascending' or 'descending', the direction the triggerPrice is triggered from, requires triggerPrice |
| params.triggerPriceType | <code>string</code> | No | contract markets only "last", "mark", "index" - defaults to "mark" |
| params.stopLossPrice | <code>float</code> | No | price to trigger stop-loss orders |
| params.takeProfitPrice | <code>float</code> | No | price to trigger take-profit orders |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', (default is 'cross' for margin orders, default is 'isolated' for contract orders) Exchange-specific parameters ------------------------------------------------- |
| params.accountMode | <code>string</code> | No | 'unified' or 'classic', default is 'unified' |
| params.stp | <code>string</code> | No | '', // self trade prevention, CN, CO, CB or DC |
| params.cancelAfter | <code>int</code> | No | Cancel After N Seconds (Calculated from the time of entering the matching engine), only effective when timeInForce is GTD |
| params.sizeUnit | <code>string</code> | No | contracts only 'BASECCY' (amount of base currency) or 'UNIT' (number of contracts), default is 'UNIT' Classic account parameters |
| params.autoBorrow | <code>bool</code> | No | classic margin orders only |
| params.autoRepay | <code>bool</code> | No | classic margin orders only |
| params.hedged | <code>string</code> | No | classic contract orders only true for hedged mode, false for one way mode, default is false |
| params.leverage | <code>int</code> | No | classic contract orders with isolated marginMode only Leverage size of the order |
<a name="createVault" id="createvault"></a>
creates a value
Kind: instance
Returns: <code>object</code> - the api result
| Param | Type | Required | Description |
|---|---|---|---|
| name | <code>string</code> | Yes | The name of the vault |
| description | <code>string</code> | Yes | The description of the vault |
| initialUsd | <code>number</code> | Yes | The initialUsd of the vault |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="deposit" id="deposit"></a>
make a deposit
Kind: instance
Returns: <code>object</code> - a transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | the amount to deposit |
| id | <code>string</code> | Yes | the payment method id to be used for the deposit, can be retrieved from v2PrivateGetPaymentMethods |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountId | <code>string</code> | No | the id of the account to deposit into |
<a name="editContractOrder" id="editcontractorder"></a>
edit a trade order
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | cancel order id |
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of currency you want to trade in units of base currency |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to edit an order in a portfolio margin account |
<a name="editOrder" id="editorder"></a>
edit a trade order
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | No | unified symbol of the market to create an order in |
| type | <code>string</code> | No | 'market', 'limit' or 'stop_limit' |
| side | <code>string</code> | No | 'buy' or 'sell' |
| amount | <code>float</code> | No | how much of the currency you want to trade in units of the base currency |
| price | <code>float</code> | No | the price for the order, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.triggerPrice | <code>string</code> | No | the price to trigger a stop order |
| params.timeInForce | <code>string</code> | No | for crypto trading either 'gtc' or 'ioc' can be used |
| params.clientOrderId | <code>string</code> | No | a unique identifier for the order, automatically generated if not sent |
<a name="editOrderWs" id="editorderws"></a>
edit a trade order
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of the currency you want to trade in units of the base currency |
| price | <code>float</code>, <code>undefined</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="editOrders" id="editorders"></a>
edit a list of trade orders
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="enableDemoTrading" id="enabledemotrading"></a>
enables or disables demo trading mode
Kind: instance
| Param | Type | Required | Description |
|---|---|---|---|
| enable | <code>boolean</code> | No | true if demo trading should be enabled, false otherwise |
<a name="enableUserDexAbstraction" id="enableuserdexabstraction"></a>
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 | Yes | ||
| params | Yes | ||
| params.type | <code>string</code> | No | 'userDexAbstraction' or 'agentEnableDexAbstraction' default is 'userDexAbstraction' |
<a name="fetchADLRank" id="fetchadlrank"></a>
fetches the auto deleveraging rank and risk percentage for a symbol
Kind: instance
Returns: <code>object</code> - an auto de leverage structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the auto deleveraging rank for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchAccount" id="fetchaccount"></a>
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance
Returns: <code>object</code> - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchAccountIdByType" id="fetchaccountidbytype"></a>
fetch all the accounts by a type and marginModeassociated with a profile
Kind: instance
Returns: <code>object</code> - a dictionary of account structures indexed by the account type
| Param | Type | Required | Description |
|---|---|---|---|
| type | <code>string</code> | Yes | 'spot', 'swap' or 'future |
| marginMode | <code>string</code> | No | 'cross' or 'isolated' |
| symbol | <code>string</code> | No | unified ccxt market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchAccountSettings" id="fetchaccountsettings"></a>
fetch account's market settings. Settings are cached for walletAddress. To refresh the cache, call loadAccountSettings with refresh=true
Kind: instance
Returns: <code>object</code> - Dict repacked from list by symbol key
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.account | <code>string</code> | No | will default to walletAddress if not provided |
<a name="fetchAccounts" id="fetchaccounts"></a>
query for accounts owned by the walletAddress. An Account is needed for all trading methods.
Kind: instance
Returns: <code>Array</code> - a list of account structures
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchAllGreeks" id="fetchallgreeks"></a>
fetches all option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
Kind: instance
Returns: <code>object</code> - a greeks structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbols of the markets to fetch greeks for, all markets are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchBalance" id="fetchbalance"></a>
query for balance and get the amount of funds available for trading or funds locked in positions
Kind: instance
Returns: <code>object</code> - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.account | <code>string</code> | No | account object ID, required |
<a name="fetchBalanceWs" id="fetchbalancews"></a>
fetch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance
Returns: <code>object</code> - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code>, <code>undefined</code> | No | 'future', 'delivery', 'savings', 'funding', or 'spot' |
| params.marginMode | <code>string</code>, <code>undefined</code> | No | 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null |
| params.symbols | <code>Array<string></code>, <code>undefined</code> | No | unified market symbols, only used in isolated margin mode |
| params.method | <code>string</code>, <code>undefined</code> | No | method to use. Can be account.balance, account.status, v2/account.balance or v2/account.status |
<a name="fetchBidsAsks" id="fetchbidsasks"></a>
fetches the bid and ask price and volume for multiple markets
Kind: instance
Returns: <code>object</code> - a dictionary of ticker structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
<a name="fetchBorrowInterest" id="fetchborrowinterest"></a>
fetch the interest owed by the user for borrowing currency for margin trading
Kind: instance
Returns: <code>Array<object></code> - a list of borrow interest structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code |
| symbol | <code>string</code> | No | unified market symbol when fetch interest in isolated markets |
| since | <code>int</code> | No | the earliest time in ms to fetch borrrow interest for |
| limit | <code>int</code> | No | the maximum number of structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch the borrow interest in a portfolio margin account |
<a name="fetchBorrowRateHistories" id="fetchborrowratehistories"></a>
retrieves a history of a multiple currencies borrow interest rate at specific time slots, returns all currencies if no symbols passed, default is undefined
Kind: instance
Returns: <code>object</code> - a dictionary of borrow rate structures indexed by the market symbol
| Param | Type | Required | Description |
|---|---|---|---|
| codes | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified currency codes, default is undefined |
| since | <code>int</code> | No | timestamp in ms of the earliest borrowRate, default is undefined |
| limit | <code>int</code> | No | max number of borrow rate prices to return, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' default is 'cross' |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
<a name="fetchBorrowRateHistory" id="fetchborrowratehistory"></a>
retrieves a history of a currencies borrow interest rate at specific time slots
Kind: instance
Returns: <code>Array<object></code> - an array of borrow rate structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | timestamp for the earliest borrow rate |
| limit | <code>int</code> | No | the maximum number of borrow rate structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchCanceledAndClosedOrders" id="fetchcanceledandclosedorders"></a>
fetches information on multiple canceled orders made by the user
Kind: instance
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch orders in a portfolio margin account |
| params.trigger | <code>boolean</code> | No | set to true if you would like to fetch portfolio margin account trigger or conditional orders |
<a name="fetchCanceledOrders" id="fetchcanceledorders"></a>
fetches information on multiple canceled orders made by the user
Kind: instance
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch orders in a portfolio margin account |
| params.trigger | <code>boolean</code> | No | set to true if you would like to fetch portfolio margin account trigger or conditional orders |
<a name="fetchClosedOrder" id="fetchclosedorder"></a>
fetch an open order by it's id
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified market symbol, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchClosedOrders" id="fetchclosedorders"></a>
fetches information on multiple closed orders made by the user
Kind: instance
Returns: <code>Array<Order></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch orders for |
<a name="fetchClosedOrdersWs" id="fetchclosedordersws"></a>
fetch closed orders
Kind: instance
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch open orders for |
| limit | <code>int</code> | No | the maximum number of open orders structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchContractBalance" id="fetchcontractbalance"></a>
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance
Returns: <code>object</code> - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.code | <code>object</code> | No | the unified currency code to fetch the balance for, if not provided, the default .options['fetchBalance']['code'] will be used |
<a name="fetchContractDepositAddress" id="fetchcontractdepositaddress"></a>
fetch the deposit address for a currency associated with this account
Kind: instance
Returns: <code>object</code> - an address structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchContractDeposits" id="fetchcontractdeposits"></a>
helper method for fetching deposits for futures accounts
Kind: instance
Returns: <code>Array<object></code> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch deposits for |
| limit | <code>int</code> | No | the maximum number of deposits structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchContractOrder" id="fetchcontractorder"></a>
fetc contract order
Kind: instance
Returns: <code>object</code> - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchContractOrdersByStatus" id="fetchcontractordersbystatus"></a>
fetches a list of contract orders placed on the exchange
Kind: instance
Returns: An array of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| status | <code>string</code> | Yes | 'active' or 'closed', only 'active' is valid for stop orders |
| symbol | <code>string</code> | Yes | unified symbol for the market to retrieve orders from |
| since | <code>int</code> | No | timestamp in ms of the earliest order to retrieve |
| limit | <code>int</code> | No | The maximum number of orders to retrieve |
| params | <code>object</code> | No | exchange specific parameters |
| params.trigger | <code>bool</code> | No | set to true to retrieve untriggered stop orders |
| params.until | <code>int</code> | No | End time in ms |
| params.side | <code>string</code> | No | buy or sell |
| params.type | <code>string</code> | No | limit or market |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
<a name="fetchContractWithdrawals" id="fetchcontractwithdrawals"></a>
helper method for fetching withdrawals for futures accounts
Kind: instance
Returns: <code>Array<object></code> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch withdrawals for |
| limit | <code>int</code> | No | the maximum number of withdrawals structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchConvertCurrencies" id="fetchconvertcurrencies"></a>
fetches all available currencies that can be converted
Kind: instance
Returns: <code>object</code> - an associative dictionary of currencies
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchConvertQuote" id="fetchconvertquote"></a>
fetch a quote for converting from one currency to another
Kind: instance
Returns: <code>object</code> - a conversion structure
| Param | Type | Required | Description |
|---|---|---|---|
| fromCode | <code>string</code> | Yes | the currency that you want to sell and convert from |
| toCode | <code>string</code> | Yes | the currency that you want to buy and convert into |
| amount | <code>float</code> | Yes | how much you want to trade in units of the from currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.walletType | <code>string</code> | No | either 'SPOT' or 'FUNDING', the default is 'SPOT' |
<a name="fetchConvertTrade" id="fetchconverttrade"></a>
fetch the data for a conversion trade
Kind: instance
Returns: <code>object</code> - a conversion structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the id of the trade that you want to fetch |
| code | <code>string</code> | No | the unified currency code of the conversion trade |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchConvertTradeHistory" id="fetchconverttradehistory"></a>
fetch the users history of conversion trades
Kind: instance
Returns: <code>Array<object></code> - a list of conversion structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | the unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch conversions for |
| limit | <code>int</code> | No | the maximum number of conversion structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest conversion to fetch |
<a name="fetchCrossBorrowRate" id="fetchcrossborrowrate"></a>
fetch the rate of interest to borrow a currency for margin trading
Kind: instance
Returns: <code>object</code> - a borrow rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchCrossBorrowRates" id="fetchcrossborrowrates"></a>
fetch the borrow interest rates of all currencies
Kind: instance
Returns: <code>object</code> - a list of borrow rate structures
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchCurrencies" id="fetchcurrencies"></a>
fetches all available currencies on an exchange
Kind: instance
Returns: <code>object</code> - an associative dictionary of currencies
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchCurrenciesWs" id="fetchcurrenciesws"></a>
fetches all available currencies on an exchange
Kind: instance
Returns: <code>object</code> - an associative dictionary of currencies
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the bitvavo api endpoint |
<a name="fetchDeposit" id="fetchdeposit"></a>
fetch information on a deposit
Kind: instance
Returns: <code>object</code> - a transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | deposit id |
| code | <code>string</code> | Yes | not used by bitmart fetchDeposit () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchDepositAddress" id="fetchdepositaddress"></a>
fetch the deposit address for a currency associated with this account
Kind: instance
Returns: <code>object</code> - an address structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchDepositAddresses" id="fetchdepositaddresses"></a>
fetch deposit addresses for multiple currencies (when available)
Kind: instance
Returns: <code>object</code> - a dictionary of address structures indexed by currency code
| Param | Type | Required | Description |
|---|---|---|---|
| codes | <code>Array<string></code> | No | list of unified currency codes, default is undefined (all currencies) |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountId | <code>string</code> | No | account ID to fetch deposit addresses for |
<a name="fetchDepositAddressesByNetwork" id="fetchdepositaddressesbynetwork"></a>
fetch the deposit addresses for a currency associated with this account
Kind: instance
Returns: <code>object</code> - a dictionary address structures, indexed by the network
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchDepositMethodId" id="fetchdepositmethodid"></a>
fetch the deposit id for a fiat currency associated with this account
Kind: instance
Returns: <code>object</code> - a deposit id structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the deposit payment method id |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchDepositMethodIds" id="fetchdepositmethodids"></a>
fetch the deposit id for a fiat currency associated with this account
Kind: instance
Returns: <code>object</code> - an array of deposit id structures
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchDepositMethods" id="fetchdepositmethods"></a>
fetch deposit methods for a currency associated with this account
Kind: instance
Returns: <code>object</code> - of deposit methods
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the kraken api endpoint |
<a name="fetchDepositWithdrawFee" id="fetchdepositwithdrawfee"></a>
fetch the fee for deposits and withdrawals
Kind: instance
Returns: <code>object</code> - a fee structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.network | <code>string</code> | No | the network code of the currency |
<a name="fetchDepositWithdrawFees" id="fetchdepositwithdrawfees"></a>
fetch deposit and withdraw fees
Kind: instance
Returns: <code>object</code> - a list of fee structures
| Param | Type | Required | Description |
|---|---|---|---|
| codes | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified currency codes |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchDeposits" id="fetchdeposits"></a>
fetch all deposits made to an account
Kind: instance
Returns: <code>Array<object></code> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch deposits for |
| limit | <code>int</code> | No | the maximum number of deposit structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchDepositsWithdrawals" id="fetchdepositswithdrawals"></a>
fetch history of deposits and withdrawals
Kind: instance
Returns: <code>object</code> - a list of transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code for the currency of the deposit/withdrawals, default is undefined |
| since | <code>int</code> | No | timestamp in ms of the earliest deposit/withdrawal, default is undefined |
| limit | <code>int</code> | No | max number of deposit/withdrawals to return, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchDepositsWs" id="fetchdepositsws"></a>
fetch all deposits made to an account
Kind: instance
Returns: <code>Array<object></code> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch deposits for |
| limit | <code>int</code> | No | the maximum number of deposits structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the bitvavo api endpoint |
<a name="fetchFundingHistory" id="fetchfundinghistory"></a>
fetches information on multiple orders made by the user classic accounts only
Kind: instance
Returns: <code>Array<Trade></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve, default 100 |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>object</code> | No | end time, ms |
| params.side | <code>boolean</code> | No | BUY or SELL |
| params.page | <code>boolean</code> | No | Page numbers start from 0 |
<a name="fetchFundingInterval" id="fetchfundinginterval"></a>
fetch the current funding rate interval
Kind: instance
Returns: <code>object</code> - a funding rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
<a name="fetchFundingIntervals" id="fetchfundingintervals"></a>
fetch the funding rate interval for multiple markets
Kind: instance
Returns: <code>Array<object></code> - a list of funding rate structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchFundingLimits" id="fetchfundinglimits"></a>
fetch the deposit and withdrawal limits for a currency
Kind: instance
Returns: <code>object</code> - a funding limits structure
| Param | Type | Required | Description |
|---|---|---|---|
| codes | <code>Array<string></code>, <code>undefined</code> | Yes | unified currency codes |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchFundingRate" id="fetchfundingrate"></a>
fetch the current funding rate
Kind: instance
Returns: <code>object</code> - a funding rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchFundingRateHistory" id="fetchfundingratehistory"></a>
fetches historical funding rate prices
Kind: instance
Returns: <code>Array<object></code> - a list of funding rate structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the funding rate history for |
| since | <code>int</code> | No | timestamp in ms of the earliest funding rate to fetch |
| limit | <code>int</code> | No | the maximum amount of funding rate structures to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest funding rate |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
<a name="fetchFundingRates" id="fetchfundingrates"></a>
fetch the funding rate for multiple markets
Kind: instance
Returns: <code>Array<object></code> - a list of funding rates structures, indexe by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchGreeks" id="fetchgreeks"></a>
fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
Kind: instance
Returns: <code>object</code> - a greeks structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch greeks for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchHip3Markets" id="fetchhip3markets"></a>
retrieves data on all hip3 markets for hyperliquid
Kind: instance
Returns: <code>Array<object></code> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchIsolatedBorrowRate" id="fetchisolatedborrowrate"></a>
fetch the rate of interest to borrow a currency for margin trading
Kind: instance
Returns: <code>object</code> - an isolated borrow rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.vipLevel | <code>object</code> | No | user's current specific margin data will be returned if viplevel is omitted |
<a name="fetchIsolatedBorrowRates" id="fetchisolatedborrowrates"></a>
fetch the borrow interest rates of all currencies
Kind: instance
Returns: <code>object</code> - a borrow rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.symbol | <code>object</code> | No | unified market symbol EXCHANGE SPECIFIC PARAMETERS |
| params.vipLevel | <code>object</code> | No | user's current specific margin data will be returned if viplevel is omitted |
<a name="fetchL3OrderBook" id="fetchl3orderbook"></a>
fetches level 3 information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance
Returns: <code>object</code> - an order book structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| limit | <code>int</code> | No | max number of orders to return, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchLastPrices" id="fetchlastprices"></a>
fetches the last price for multiple markets
Kind: instance
Returns: <code>object</code> - a dictionary of lastprices structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | unified symbols of the markets to fetch the last prices |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
<a name="fetchLedger" id="fetchledger"></a>
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance
Returns: <code>object</code> - a ledger structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code |
| since | <code>int</code> | No | timestamp in ms of the earliest ledger entry |
| limit | <code>int</code> | No | max number of ledger entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest ledger entry |
<a name="fetchLedgerEntry" id="fetchledgerentry"></a>
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance
Returns: <code>object</code> - a ledger structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the identification number of the ledger entry |
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchLeverage" id="fetchleverage"></a>
fetch the set leverage for a market
Kind: instance
Returns: <code>object</code> - a leverage structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchLeverageTiers" id="fetchleveragetiers"></a>
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
Kind: instance
Returns: <code>object</code> - a dictionary of leverage tiers structures, indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchLeverages" id="fetchleverages"></a>
fetch the set leverage for all contract markets
Kind: instance
Returns: <code>object</code> - a list of leverage structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | a list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchLiquidations" id="fetchliquidations"></a>
retrieves the public liquidations of a trading pair
Kind: instance
Returns: <code>object</code> - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified CCXT market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters |
| params.until | <code>int</code> | No | timestamp in ms of the latest liquidation |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
<a name="fetchLongShortRatioHistory" id="fetchlongshortratiohistory"></a>
fetches the long short ratio history for a unified market symbol
Kind: instance
Returns: <code>Array<object></code> - an array of long short ratio structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the long short ratio for |
| timeframe | <code>string</code> | No | the period for the ratio, default is 24 hours |
| since | <code>int</code> | No | the earliest time in ms to fetch ratios for |
| limit | <code>int</code> | No | the maximum number of long short ratio structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest ratio to fetch |
<a name="fetchMarginAdjustmentHistory" id="fetchmarginadjustmenthistory"></a>
fetches the history of margin added or reduced from contract isolated positions
Kind: instance
Returns: <code>Array<object></code> - a list of margin structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| type | <code>string</code> | No | "add" or "reduce" |
| since | <code>int</code> | No | timestamp in ms of the earliest change to fetch |
| limit | <code>int</code> | No | the maximum amount of changes to fetch |
| params | <code>object</code> | Yes | extra parameters specific to the exchange api endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest change to fetch |
<a name="fetchMarginMode" id="fetchmarginmode"></a>
fetches the margin mode of a specific symbol
Kind: instance
Returns: <code>object</code> - a margin mode structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
<a name="fetchMarginModes" id="fetchmarginmodes"></a>
fetches the set margin mode of the user
Kind: instance
Returns: <code>object</code> - a list of margin mode structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | a list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchMarkPrice" id="fetchmarkprice"></a>
fetches mark price for the market
Kind: instance
Returns: <code>object</code> - a dictionary of ticker structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
<a name="fetchMarkPrices" id="fetchmarkprices"></a>
fetches mark prices for multiple markets
Kind: instance
Returns: <code>object</code> - a dictionary of ticker structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
<a name="fetchMarketLeverageTiers" id="fetchmarketleveragetiers"></a>
retrieve information on the maximum leverage, for different trade sizes for a single market
Kind: instance
Returns: <code>object</code> - a leverage tiers structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchMarkets" id="fetchmarkets"></a>
retrieves data on all markets for woo
Kind: instance
Returns: <code>Array<object></code> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchMarketsWs" id="fetchmarketsws"></a>
retrieves data on all markets for bitvavo
Kind: instance
Returns: <code>Array<object></code> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange api endpoint |
<a name="fetchMyContractTrades" id="fetchmycontracttrades"></a>
fetch all contract trades made by the user
Kind: instance
Returns: <code>Array<Trade></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | End time in ms |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
<a name="fetchMyDustTrades" id="fetchmydusttrades"></a>
fetch all dust trades made by the user
Kind: instance
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | not used by binance fetchMyDustTrades () |
| since | <code>int</code> | No | the earliest time in ms to fetch my dust trades for |
| limit | <code>int</code> | No | the maximum number of dust trades to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | 'spot' or 'margin', default spot |
<a name="fetchMyLiquidations" id="fetchmyliquidations"></a>
retrieves the users liquidated positions
Kind: instance
Returns: <code>object</code> - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified CCXT market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the binance api endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest liquidation |
| params.paginate | <code>boolean</code> | 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 | <code>boolean</code> | No | set to true if you would like to fetch liquidations in a portfolio margin account |
| params.type | <code>string</code> | No | "spot" |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
<a name="fetchMySettlementHistory" id="fetchmysettlementhistory"></a>
fetches historical settlement records of the user
Kind: instance
Returns: <code>Array<object></code> - a list of [settlement history objects]
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the settlement history |
| since | <code>int</code> | No | timestamp in ms |
| limit | <code>int</code> | No | number of records |
| params | <code>object</code> | No | exchange specific params |
<a name="fetchMySpotTrades" id="fetchmyspottrades"></a>
fetch all spot trades made by the user
Kind: instance
Returns: <code>Array<Trade></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.hf | <code>bool</code> | No | false, // true for hf order |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', only for margin trades |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
<a name="fetchMyTrades" id="fetchmytrades"></a>
fetch all trades made by the user
Kind: instance
Returns: <code>Array<Trade></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trade structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch trades for |
| params.page_token | <code>string</code> | No | page_token - used for paging |
<a name="fetchMyTradesWs" id="fetchmytradesws"></a>
fetch all trades made by the user
Kind: instance
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code>, <code>undefined</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code>, <code>undefined</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.endTime | <code>int</code> | No | the latest time in ms to fetch trades for |
| params.fromId | <code>int</code> | No | first trade Id to fetch |
<a name="fetchMyUtaTrades" id="fetchmyutatrades"></a>
fetch all trades made by the user
Kind: instance
Returns: <code>Array<Trade></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve (default is 50, max is 200) |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.accountMode | <code>string</code> | No | 'unified' or 'classic', defaults to 'unified' |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', only for margin trades (unified accountMode support only cross margin) |
| params.side | <code>string</code> | No | 'BUY' or 'SELL' (both if not provided) |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
<a name="fetchOHLCV" id="fetchohlcv"></a>
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | max=1000, max=100 when since is defined and is less than (now - (999 * (timeframe in ms))) |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOHLCVWs" id="fetchohlcvws"></a>
query historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Description |
|---|---|---|
| symbol | <code>string</code> | unified symbol of the market to query OHLCV data for |
| timeframe | <code>string</code> | the length of time each candle represents |
| since | <code>int</code> | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | the maximum amount of candles to fetch |
| params | <code>object</code> | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | timestamp in ms of the earliest candle to fetch EXCHANGE SPECIFIC PARAMETERS |
| params.timeZone | <code>string</code> | default=0 (UTC) |
<a name="fetchOpenInterest" id="fetchopeninterest"></a>
retrieves the open interest of a contract trading pair
Kind: instance
Returns: <code>object</code> - an open interest structurehttps://docs.ccxt.com/?id=open-interest-structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified CCXT market symbol |
| params | <code>object</code> | No | exchange specific parameters |
<a name="fetchOpenInterestHistory" id="fetchopeninteresthistory"></a>
Retrieves the open interest history of a currency
Kind: instance
Returns: <code>object</code> - an array of open interest structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| timeframe | <code>string</code> | Yes | "5m","15m","30m","1h","2h","4h","6h","12h", or "1d" |
| since | <code>int</code> | No | the time(ms) of the earliest record to retrieve as a unix timestamp |
| limit | <code>int</code> | No | default 30, max 500 |
| params | <code>object</code> | No | exchange specific parameters |
| params.until | <code>int</code> | No | the time(ms) of the latest record to retrieve as a unix timestamp |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
<a name="fetchOpenInterests" id="fetchopeninterests"></a>
Retrieves the open interest for a list of symbols
Kind: instance
Returns: <code>Array<object></code> - a list of open interest structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | a list of unified CCXT market symbols |
| params | <code>object</code> | No | exchange specific parameters |
<a name="fetchOpenOrder" id="fetchopenorder"></a>
fetch an open order by the id
Kind: instance
Returns: <code>object</code> - an order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOpenOrders" id="fetchopenorders"></a>
fetch all unfilled currently open orders
Kind: instance
Returns: <code>Array<Order></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch open orders for |
| limit | <code>int</code> | No | the maximum number of open orders structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountNumber | <code>int</code> | No | account number to query orders for, required |
<a name="fetchOpenOrdersWs" id="fetchopenordersws"></a>
fetch all unfilled currently open orders
Kind: instance
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code>, <code>undefined</code> | No | the earliest time in ms to fetch open orders for |
| limit | <code>int</code>, <code>undefined</code> | No | the maximum number of open orders structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOption" id="fetchoption"></a>
fetches option data that is commonly found in an option chain
Kind: instance
Returns: <code>object</code> - an option chain structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOptionChain" id="fetchoptionchain"></a>
fetches data for an underlying asset that is commonly found in an option chain
Kind: instance
Returns: <code>object</code> - a list of option chain structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | base currency to fetch an option chain for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOptionPositions" id="fetchoptionpositions"></a>
fetch data on open options positions
Kind: instance
Returns: <code>Array<object></code> - a list of position structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOrder" id="fetchorder"></a>
fetches information on an order made by the user
Kind: instance
Returns: <code>object</code> - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOrderBook" id="fetchorderbook"></a>
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOrderBookWs" id="fetchorderbookws"></a>
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOrderBooks" id="fetchorderbooks"></a>
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data for multiple markets
Kind: instance
Returns: <code>object</code> - a dictionary of order book structures indexed by market symbol
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols, all symbols fetched if undefined, default is undefined |
| limit | <code>int</code> | No | max number of entries per orderbook to return, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOrderClassic" id="fetchorderclassic"></a>
fetches information on an order made by the user classic accounts only
Kind: instance
Returns: <code>object</code> - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOrderTrades" id="fetchordertrades"></a>
fetch all the trades made from a single order
Kind: instance
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOrderWs" id="fetchorderws"></a>
fetches information on an order made by the user
Kind: instance
Returns: <code>object</code> - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | No | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchOrders" id="fetchorders"></a>
fetches information on multiple orders made by the user
Kind: instance
Returns: <code>Array<Order></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch orders for |
<a name="fetchOrdersByIds" id="fetchordersbyids"></a>
fetch orders by the list of order id
Kind: instance
Returns: <code>Array<object></code> - a list of order structure
| Param | Type | Required | Description |
|---|---|---|---|
| ids | <code>Array<string></code> | No | list of order id |
| symbol | <code>string</code> | No | unified ccxt market symbol |
| params | <code>object</code> | No | extra parameters specific to the kraken api endpoint |
<a name="fetchOrdersByStatus" id="fetchordersbystatus"></a>
fetch a list of orders
Kind: instance
Returns: <code>Array<Order></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| status | <code>string</code> | Yes | order status to fetch for |
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>boolean</code> | No | set to true for fetching trigger orders |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' for fetching spot margin orders |
<a name="fetchOrdersClassic" id="fetchordersclassic"></a>
fetches information on multiple orders made by the user classic accounts only
Kind: instance
Returns: <code>Array<Order></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>boolean</code> | No | true if trigger order |
| params.stop | <code>boolean</code> | No | alias for trigger |
| params.type | <code>string</code> | No | market type, ['swap', 'option', 'spot'] |
| params.subType | <code>string</code> | No | market subType, ['linear', 'inverse'] |
| params.orderFilter | <code>string</code> | No | 'Order' or 'StopOrder' or 'tpslOrder' |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
<a name="fetchOrdersWs" id="fetchordersws"></a>
fetches information on multiple orders made by the user
Kind: instance
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code>, <code>undefined</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code>, <code>undefined</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.orderId | <code>int</code> | No | order id to begin at |
| params.startTime | <code>int</code> | No | earliest time in ms to retrieve orders for |
| params.endTime | <code>int</code> | No | latest time in ms to retrieve orders for |
| params.limit | <code>int</code> | No | the maximum number of order structures to retrieve |
<a name="fetchPortfolioDetails" id="fetchportfoliodetails"></a>
Fetch details for a specific portfolio by UUID
Kind: instance
Returns: <code>Array<any></code> - An account structure https://docs.ccxt.com/?id=account-structure
| Param | Type | Required | Description |
|---|---|---|---|
| portfolioUuid | <code>string</code> | Yes | The unique identifier of the portfolio to fetch |
| params | <code>Dict</code> | No | Extra parameters specific to the exchange API endpoint |
<a name="fetchPortfolios" id="fetchportfolios"></a>
fetch all the portfolios
Kind: instance
Returns: <code>object</code> - a dictionary of account structures indexed by the account type
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchPosition" id="fetchposition"></a>
fetch data on an open position
Kind: instance
Returns: <code>object</code> - a position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the position is held in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountNumber | <code>int</code> | No | account number to query positions for, required |
<a name="fetchPositionADLRank" id="fetchpositionadlrank"></a>
fetches the auto deleveraging rank and risk percentage for a list of symbols
Kind: instance
Returns: <code>object</code> - an array of auto de leverage structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.code | <code>string</code> | No | the currency code to fetch ranks for, USD, BTC or USDT, USDT is the default |
| params.method | <code>string</code> | No | USDT contracts only 'privateGetGAccountsAccountPositions' or 'privateGetGAccountsAccountPositions' default is 'privateGetGAccountsAccountPositions' |
<a name="fetchPositionHistory" id="fetchpositionhistory"></a>
fetches historical positions
Kind: instance
Returns: <code>Array<object></code> - a list of position structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified contract symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch positions for |
| limit | <code>int</code> | No | the maximum amount of records to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange api endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch positions for |
<a name="fetchPositionMode" id="fetchpositionmode"></a>
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: <code>object</code> - an object detailing whether the market is in hedged or one-way mode
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchPositionWs" id="fetchpositionws"></a>
fetch data on an open position
Kind: instance
Returns: <code>object</code> - a position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the position is held in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchPositions" id="fetchpositions"></a>
fetch all open positions
Kind: instance
Returns: <code>Array<object></code> - a list of position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountNumber | <code>int</code> | No | account number to query positions for, required |
<a name="fetchPositionsADLRank" id="fetchpositionsadlrank"></a>
fetches the auto deleveraging rank and risk percentage for a list of symbols that have open positions
Kind: instance
Returns: <code>Array<object></code> - an array of auto de leverage structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true for the portfolio margin account |
<a name="fetchPositionsForSymbol" id="fetchpositionsforsymbol"></a>
fetch all open positions for specific symbol
Kind: instance
Returns: <code>Array<object></code> - a list of position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.contractType | <code>string</code> | No | FUTURE or DELIVERY, default is FUTURE |
<a name="fetchPositionsHistory" id="fetchpositionshistory"></a>
fetches historical positions
Kind: instance
Returns: <code>Array<object></code> - a list of position structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified contract symbols |
| since | <code>int</code> | No | timestamp in ms of the earliest position to fetch, default=3 months ago, max range for params["until"] - since is 3 months |
| limit | <code>int</code> | No | the maximum amount of records to fetch, default=20, max=100 |
| params | <code>object</code> | Yes | extra parameters specific to the exchange api endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest position to fetch, max range for params["until"] - since is 3 months |
| params.productType | <code>string</code> | No | USDT-FUTURES (default), COIN-FUTURES, USDC-FUTURES, SUSDT-FUTURES, SCOIN-FUTURES, or SUSDC-FUTURES |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta), defaults to false |
<a name="fetchPositionsRisk" id="fetchpositionsrisk"></a>
fetch positions risk
Kind: instance
Returns: <code>object</code> - data on the positions risk
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchPositionsWs" id="fetchpositionsws"></a>
fetch all open positions
Kind: instance
Returns: <code>Array<object></code> - a list of position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.returnRateLimits | <code>boolean</code> | No | set to true to return rate limit informations, defaults to false. |
| params.method | <code>string</code>, <code>undefined</code> | No | method to use. Can be account.position or v2/account.position |
<a name="fetchSettlementHistory" id="fetchsettlementhistory"></a>
fetches historical settlement records
Kind: instance
Returns: <code>Array<object></code> - a list of settlement history objects
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the settlement history |
| since | <code>int</code> | No | timestamp in ms |
| limit | <code>int</code> | No | number of records, default 100, max 100 |
| params | <code>object</code> | No | exchange specific params |
<a name="fetchSpotMarkets" id="fetchspotmarkets"></a>
retrieves data on all spot markets for hyperliquid
Kind: instance
Returns: <code>Array<object></code> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchSpotOrder" id="fetchspotorder"></a>
fetch a spot order
Kind: instance
Returns: An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | Order id |
| symbol | <code>string</code> | Yes | not sent to exchange except for trigger orders with clientOid, but used internally by CCXT to filter |
| params | <code>object</code> | No | exchange specific parameters |
| params.trigger | <code>bool</code> | No | true if fetching a trigger order |
| params.hf | <code>bool</code> | No | false, // true for hf order |
| params.clientOid | <code>bool</code> | No | unique order id created by users to identify their orders |
| params.marginMode | <code>object</code> | No | 'cross' or 'isolated' |
<a name="fetchSpotOrdersByStatus" id="fetchspotordersbystatus"></a>
fetch a list of spot orders
Kind: instance
Returns: An array of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| status | <code>string</code> | Yes | not used for stop orders 'open' or 'closed' |
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | timestamp in ms of the earliest order |
| limit | <code>int</code> | No | max number of orders to return |
| params | <code>object</code> | No | exchange specific params |
| params.until | <code>int</code> | No | end time in ms |
| params.side | <code>string</code> | No | buy or sell |
| params.type | <code>string</code> | No | limit, market, limit_stop or market_stop |
| params.tradeType | <code>string</code> | No | TRADE for spot trading, MARGIN_TRADE or MARGIN_ISOLATED_TRADE for Margin Trading |
| params.currentPage | <code>int</code> | No | trigger orders only current page |
| params.orderIds | <code>string</code> | No | trigger orders only comma separated order ID list |
| params.trigger | <code>bool</code> | No | True if fetching a trigger order |
| params.hf | <code>bool</code> | No | false, // true for hf order |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', only for margin orders |
<a name="fetchStatus" id="fetchstatus"></a>
the latest known information on the availability of the exchange API
Kind: instance
Returns: <code>object</code> - a status structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchSwapMarkets" id="fetchswapmarkets"></a>
retrieves data on all swap markets for hyperliquid
Kind: instance
Returns: <code>Array<object></code> - an array of objects representing market data
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchTicker" id="fetchticker"></a>
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchTickerWs" id="fetchtickerws"></a>
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.method | <code>string</code> | No | method to use can be ticker.price or ticker.book |
| params.returnRateLimits | <code>boolean</code> | No | return the rate limits for the exchange |
<a name="fetchTickers" id="fetchtickers"></a>
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance
Returns: <code>object</code> - a dictionary of ticker structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbols of the markets to fetch tickers for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.loc | <code>string</code> | No | crypto location, default: us |
<a name="fetchTime" id="fetchtime"></a>
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance
Returns: <code>int</code> - the current integer timestamp in milliseconds from the exchange server
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchTrades" id="fetchtrades"></a>
get the list of most recent trades for a particular symbol
Kind: instance
Returns: <code>Array<Trade></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch trades for |
<a name="fetchTradesWs" id="fetchtradesws"></a>
fetch all trades made by the user
Kind: instance
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve, default=500, max=1000 |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.fromId | <code>int</code> | No | trade ID to begin at |
<a name="fetchTradingFee" id="fetchtradingfee"></a>
fetch the trading fees for a market
Kind: instance
Returns: <code>object</code> - a fee structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchTradingFees" id="fetchtradingfees"></a>
fetch the trading fees for multiple markets
Kind: instance
Returns: <code>object</code> - a dictionary of fee structures indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
<a name="fetchTradingFeesWs" id="fetchtradingfeesws"></a>
fetch the trading fees for multiple markets
Kind: instance
Returns: <code>object</code> - a dictionary of fee structures indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the bitvavo api endpoint |
<a name="fetchTradingLimits" id="fetchtradinglimits"></a>
fetch the trading limits for a market
Kind: instance
Returns: <code>object</code> - a trading limits structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchTransactionFee" id="fetchtransactionfee"></a>
please use fetchDepositWithdrawFee instead
Kind: instance
Returns: <code>object</code> - a fee structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.network | <code>string</code> | No | the network code of the currency |
<a name="fetchTransactionFees" id="fetchtransactionfees"></a>
please use fetchDepositWithdrawFees instead
Kind: instance
Returns: <code>Array<object></code> - a list of fee structures
| Param | Type | Required | Description |
|---|---|---|---|
| codes | <code>Array<string></code>, <code>undefined</code> | Yes | not used by binance fetchTransactionFees () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchTransactions" id="fetchtransactions"></a>
Fetch all transactions (deposits and withdrawals) made from an account.
Kind: instance
Returns: <code>Array<object></code> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch withdrawals for |
| limit | <code>int</code> | No | the maximum number of withdrawal structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchTransfer" id="fetchtransfer"></a>
fetches a transfer
Kind: instance
Returns: <code>object</code> - a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | transfer id |
| code | <code>string</code> | No | not used by mexc fetchTransfer |
| params | <code>object</code> | Yes | extra parameters specific to the exchange api endpoint |
<a name="fetchTransfers" id="fetchtransfers"></a>
fetch a history of internal transfers made on an account
Kind: instance
Returns: <code>Array<object></code> - a list of transfer structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency transferred |
| since | <code>int</code> | No | the earliest time in ms to fetch transfers for |
| limit | <code>int</code> | No | the maximum number of transfers structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch transfers for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.internal | <code>boolean</code> | No | default false, when true will fetch pay trade history |
<a name="fetchUnderlyingAssets" id="fetchunderlyingassets"></a>
fetches the market ids of underlying assets for a specific contract market type
Kind: instance
Returns: <code>Array<object></code> - a list of underlying assets
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | exchange specific params |
| params.type | <code>string</code> | No | the contract market type, 'option', 'swap' or 'future', the default is 'option' |
<a name="fetchUtaBalance" id="fetchutabalance"></a>
helper method for fetching balance with unified trading account (uta) endpoint
Kind: instance
Returns: <code>object</code> - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | 'unified', 'spot', 'funding', 'cross', 'isolated' or 'swap' (default is 'unified') |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', margin type for fetching margin balance, only applicable if type is margin (default is cross) |
<a name="fetchUtaOrder" id="fetchutaorder"></a>
fetch uta order
Kind: instance
Returns: <code>object</code> - An order structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountMode | <code>string</code> | No | 'unified' or 'classic' (default is 'unified') |
| params.clientOrderId | <code>string</code> | No | client order id, required if id is not provided |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', required if fetching a margin order (unified accountMode supports only cross margin) |
<a name="fetchUtaOrdersByStatus" id="fetchutaordersbystatus"></a>
helper method for fetching orders by status with uta endpoint
Kind: instance
Returns: An array of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| status | <code>string</code> | Yes | 'active' or 'closed', only 'active' is valid for stop orders |
| symbol | <code>string</code> | Yes | unified symbol for the market to retrieve orders from |
| since | <code>int</code> | No | timestamp in ms of the earliest order to retrieve |
| limit | <code>int</code> | No | The maximum number of orders to retrieve |
| params | <code>object</code> | No | exchange specific parameters |
| params.until | <code>int</code> | No | End time in ms |
| params.side | <code>string</code> | No | closed orders only 'BUY' or 'SELL' |
| params.accountMode | <code>string</code> | No | 'unified' or 'classic' (default is unified) |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', only for margin orders (unified accountMode supports only cross margin) |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
<a name="fetchVolatilityHistory" id="fetchvolatilityhistory"></a>
fetch the historical volatility of an option market based on an underlying asset
Kind: instance
Returns: <code>Array<object></code> - a list of volatility history objects
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.period | <code>int</code> | No | the period in days to fetch the volatility for: 7,14,21,30,60,90,180,270 |
<a name="fetchWithdrawal" id="fetchwithdrawal"></a>
fetch data on a currency withdrawal via the withdrawal id
Kind: instance
Returns: <code>object</code> - a transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | withdrawal id |
| code | <code>string</code> | Yes | not used by bitmart.fetchWithdrawal |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchWithdrawals" id="fetchwithdrawals"></a>
fetch all withdrawals made from an account
Kind: instance
Returns: <code>Array<object></code> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch withdrawals for |
| limit | <code>int</code> | No | the maximum number of withdrawal structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="fetchWithdrawalsWs" id="fetchwithdrawalsws"></a>
fetch all withdrawals made from an account
Kind: instance
Returns: <code>Array<object></code> - a list of transaction structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch withdrawals for |
| limit | <code>int</code> | No | the maximum number of withdrawals structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the bitvavo api endpoint |
<a name="isUTAEnabled" id="isutaenabled"></a>
returns true or false so the user can check if unified account is enabled
Kind: instance
Returns: <code>boolean</code> - true if unified account is enabled, false otherwise
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="isUnifiedEnabled" id="isunifiedenabled"></a>
returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
Kind: instance
Returns: <code>any</code> - [enableUnifiedMargin, enableUnifiedAccount]
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="loadMigrationStatus" id="loadmigrationstatus"></a>
loads the migration status for the account (hf or not)
Kind: instance
Returns: <code>any</code> - ignore
| Param | Type | Description |
|---|---|---|
| force | <code>boolean</code> | load account state for non hf |
<a name="loadUnifiedStatus" id="loadunifiedstatus"></a>
returns unifiedAccount so the user can check if the unified account is enabled
Kind: instance
Returns: <code>boolean</code> - 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 | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="market" id="market"></a>
calculates the presumptive fee that would be charged for an order
Kind: instance
Returns: <code>object</code> - 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 | <code>string</code> | unified market symbol |
| type | <code>string</code> | not used by btcmarkets.calculateFee |
| side | <code>string</code> | not used by btcmarkets.calculateFee |
| amount | <code>float</code> | how much you want to trade, in units of the base currency on most exchanges, or number of contracts |
| price | <code>float</code> | the price for the order to be filled at, in units of the quote currency |
| takerOrMaker | <code>string</code> | 'taker' or 'maker' |
| params | <code>object</code> |
<a name="preLoadLighterLibrary" id="preloadlighterlibrary"></a>
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: <code>boolean</code> - true if the signer was loaded, false otherwise
| Param |
|---|
| params |
<a name="redeemGiftCode" id="redeemgiftcode"></a>
redeem gift code
Kind: instance
Returns: <code>object</code> - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| giftcardCode | <code>string</code> | Yes | |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="reduceMargin" id="reducemargin"></a>
remove margin from a position
Kind: instance
Returns: <code>object</code> - a margin structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| amount | <code>float</code> | Yes | amount of margin to remove |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.account | <code>Account</code> | No | account id to use, required |
<a name="repayCrossMargin" id="repaycrossmargin"></a>
repay borrowed margin and interest
Kind: instance
Returns: <code>object</code> - a margin loan structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency to repay |
| amount | <code>float</code> | Yes | the amount to repay |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to repay margin in a portfolio margin account |
| params.repayCrossMarginMethod | <code>string</code> | No | portfolio margin only 'papiPostRepayLoan' (default), 'papiPostMarginRepayDebt' (alternative) |
| params.specifyRepayAssets | <code>string</code> | No | portfolio margin papiPostMarginRepayDebt only specific asset list to repay debt |
<a name="repayIsolatedMargin" id="repayisolatedmargin"></a>
repay borrowed margin and interest
Kind: instance
Returns: <code>object</code> - a margin loan structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, required for isolated margin |
| code | <code>string</code> | Yes | unified currency code of the currency to repay |
| amount | <code>float</code> | Yes | the amount to repay |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="repayMargin" id="repaymargin"></a>
repay borrowed margin and interest
Kind: instance
Returns: <code>object</code> - a margin loan structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency to repay |
| amount | <code>float</code> | Yes | the amount to repay |
| symbol | <code>string</code> | Yes | not used by woo.repayMargin () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="reserveRequestWeight" id="reserverequestweight"></a>
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: <code>object</code> - a response object
| Param | Type | Required | Description |
|---|---|---|---|
| weight | <code>number</code> | Yes | the weight to reserve, 1 weight = 1 action, 0.0005 USDC per action |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="setAgentAbstraction" id="setagentabstraction"></a>
set agent abstraction mode
Kind: instance
Returns: dictionary response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| abstraction | <code>string</code> | Yes | one of the strings ["i", "u", "p"] where "i" is "disabled", "u" is "unifiedAccount", and "p" is "portfolioMargin" |
| params | <code>object</code> | No |
<a name="setContractLeverage" id="setcontractleverage"></a>
set the level of leverage for a market
Kind: instance
Returns: <code>object</code> - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | <code>float</code> | Yes | the rate of leverage |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.uta | <code>boolean</code> | No | set to true for the unified trading account (uta) |
<a name="setLeverage" id="setleverage"></a>
set the level of leverage for a market
Kind: instance
Returns: <code>object</code> - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | <code>float</code> | Yes | the rate of leverage |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.account | <code>Account</code> | No | account id to use, required |
<a name="setMargin" id="setmargin"></a>
Either adds or reduces margin in an isolated position in order to set the margin to a specific value
Kind: instance
Returns: <code>object</code> - A margin structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market to set margin in |
| amount | <code>float</code> | Yes | the amount to set the margin to |
| params | <code>object</code> | No | parameters specific to the bingx api endpoint |
<a name="setMarginMode" id="setmarginmode"></a>
set margin mode to 'cross' or 'isolated'
Kind: instance
Returns: <code>object</code> - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | <code>string</code> | Yes | 'cross' or 'isolated' |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="setPositionMode" id="setpositionmode"></a>
set hedged to true or false for a market
Kind: instance
Returns: <code>object</code> - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| hedged | <code>bool</code> | Yes | set to true to use dualSidePosition |
| symbol | <code>string</code> | Yes | not used by bingx setPositionMode () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="setSandboxMode" id="setsandboxmode"></a>
enables or disables demo trading mode, if enabled will send PAPTRADING=1 in headers
Kind: instance
| Param |
|---|
| enabled |
<a name="setUserAbstraction" id="setuserabstraction"></a>
set user abstraction mode
Kind: instance
Returns: dictionary response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| abstraction | <code>string</code> | Yes | one of the strings ["disabled", "unifiedAccount", "portfolioMargin"], |
| params | <code>object</code> | No | |
| params.type | <code>string</code> | No | 'userSetAbstraction' or 'agentSetAbstraction' default is 'userSetAbstraction' |
<a name="signIn" id="signin"></a>
sign in, must be called prior to using other authenticated methods
Kind: instance
Returns: response from exchange
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="signTxEd25519" id="signtxed25519"></a>
Helper to sign some transaction bytes and return a generic transaction execution request.
Kind: instance
Returns: <code>object</code> - the input transaction bytes and the signed digest
| Param | Type | Required | Description |
|---|---|---|---|
| tx | <code>object</code> | No | transaction bytes and the signing digest for them |
<a name="transfer" id="transfer"></a>
transfer currency internally between wallets on the same account
Kind: instance
Returns: <code>object</code> - a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | amount to transfer |
| fromAccount | <code>string</code> | Yes | account to transfer from |
| toAccount | <code>string</code> | Yes | account to transfer to |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="transferClassic" id="transferclassic"></a>
transfer currency internally between wallets on the same account with classic endpoints
Kind: instance
Returns: <code>object</code> - a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | amount to transfer |
| fromAccount | <code>string</code> | Yes | account to transfer from |
| toAccount | <code>string</code> | Yes | account to transfer to |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.transferType | <code>string</code> | No | INTERNAL, PARENT_TO_SUB, SUB_TO_PARENT (default is INTERNAL) |
| params.fromUserId | <code>string</code> | No | required if transferType is SUB_TO_PARENT |
| params.toUserId | <code>string</code> | No | required if transferType is PARENT_TO_SUB |
<a name="transferOut" id="transferout"></a>
transfer from spot wallet to futures wallet
Kind: instance
Returns: a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>str</code> | Yes | Unified currency code |
| amount | <code>float</code> | Yes | Size of the transfer |
| params | <code>dict</code> | No | Exchange specific parameters |
<a name="transferUta" id="transferuta"></a>
transfer currency internally between wallets on the same account with uta endpoint
Kind: instance
Returns: <code>object</code> - a transfer structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | amount to transfer |
| fromAccount | <code>string</code> | Yes | account to transfer from |
| toAccount | <code>string</code> | Yes | account to transfer to |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.transferType | <code>string</code> | No | INTERNAL, PARENT_TO_SUB, SUB_TO_PARENT, SUB_TO_SUB (default is INTERNAL) |
| params.fromUserId | <code>string</code> | No | required if transferType is SUB_TO_PARENT or SUB_TO_SUB |
| params.toUserId | <code>string</code> | No | required if transferType is PARENT_TO_SUB or SUB_TO_SUB |
<a name="unWatchBalance" id="unwatchbalance"></a>
unWatches balance
Kind: instance
Returns: <code>object</code> - status of the unwatch request
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="unWatchBidsAsks" id="unwatchbidsasks"></a>
unWatches best bid & ask for symbols
Kind: instance
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="unWatchFundingRate" id="unwatchfundingrate"></a>
unWatches the current funding rate for a symbol
Kind: instance
Returns: <code>object</code> - a funding rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="unWatchMarkPrice" id="unwatchmarkprice"></a>
unWatches a mark price for a specific market
Kind: instance
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.use1sFreq | <code>boolean</code> | No | default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds |
<a name="unWatchMarkPrices" id="unwatchmarkprices"></a>
watches the mark price for all markets
Kind: instance
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.use1sFreq | <code>boolean</code> | No | default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds |
<a name="unWatchMyTrades" id="unwatchmytrades"></a>
unWatches information on multiple trades made by the user
Kind: instance
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.unifiedMargin | <code>boolean</code> | No | use unified margin account |
| params.executionFast | <code>boolean</code> | No | use fast execution |
<a name="unWatchOHLCV" id="unwatchohlcv"></a>
unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="unWatchOHLCVForSymbols" id="unwatchohlcvforsymbols"></a>
unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbolsAndTimeframes | <code>Array<Array<string>></code> | Yes | array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']] |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="unWatchOrderBook" id="unwatchorderbook"></a>
unsubscribe from the orderbook channel
Kind: instance
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | symbol of the market to unwatch the trades for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.limit | <code>int</code> | No | orderbook limit, default is undefined |
<a name="unWatchOrderBookForSymbols" id="unwatchorderbookforsymbols"></a>
unsubscribe from the orderbook channel
Kind: instance
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to unwatch the trades for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.limit | <code>int</code> | No | orderbook limit, default is undefined |
<a name="unWatchOrders" id="unwatchorders"></a>
unWatches information on multiple orders made by the user
Kind: instance
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified market symbol of the market orders were made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="unWatchPositions" id="unwatchpositions"></a>
unWatches from the stream channel
Kind: instance
Returns: <code>Array<object></code> - a list of position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols to watch positions for |
| params | <code>object</code> | Yes | extra parameters specific to the exchange API endpoint |
<a name="unWatchTicker" id="unwatchticker"></a>
unWatches a price ticker
Kind: instance
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="unWatchTickers" id="unwatchtickers"></a>
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: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="unWatchTrades" id="unwatchtrades"></a>
unsubscribe from the trades channel
Kind: instance
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market trades were made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="unWatchTradesForSymbols" id="unwatchtradesforsymbols"></a>
unsubscribe from the trades channel
Kind: instance
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch trades for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="upgradeUnifiedTradeAccount" id="upgradeunifiedtradeaccount"></a>
upgrades the account to unified trade account warning this is irreversible
Kind: instance
Returns: <code>any</code> - nothing
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="verifyGiftCode" id="verifygiftcode"></a>
verify gift code
Kind: instance
Returns: <code>object</code> - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | reference number id |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchBalance" id="watchbalance"></a>
watch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance
Returns: <code>object</code> - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>str</code> | No | spot or contract if not provided this.options['defaultType'] is used |
<a name="watchBidsAsks" id="watchbidsasks"></a>
watches best bid & ask for symbols
Kind: instance
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchFundingRate" id="watchfundingrate"></a>
watch the current funding rate
Kind: instance
Returns: <code>object</code> - a funding rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchFundingRates" id="watchfundingrates"></a>
watch the funding rate for multiple markets
Kind: instance
Returns: <code>object</code> - a dictionary of funding rate structures, indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | a list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchLiquidations" id="watchliquidations"></a>
watch the public liquidations of a trading pair
Kind: instance
Returns: <code>object</code> - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified CCXT market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the bitmex api endpoint |
<a name="watchLiquidationsForSymbols" id="watchliquidationsforsymbols"></a>
watch the public liquidations of a trading pair
Kind: instance
Returns: <code>object</code> - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | list of unified market symbols |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the bitmex api endpoint |
<a name="watchMarkPrice" id="watchmarkprice"></a>
watches a mark price for a specific market
Kind: instance
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.use1sFreq | <code>boolean</code> | No | default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds |
<a name="watchMarkPrices" id="watchmarkprices"></a>
watches the mark price for all markets
Kind: instance
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.use1sFreq | <code>boolean</code> | No | default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds |
<a name="watchMyLiquidations" id="watchmyliquidations"></a>
watch the private liquidations of a trading pair
Kind: instance
Returns: <code>object</code> - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified CCXT market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the bitmex api endpoint |
<a name="watchMyLiquidationsForSymbols" id="watchmyliquidationsforsymbols"></a>
watch the private liquidations of a trading pair
Kind: instance
Returns: <code>object</code> - an array of liquidation structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | list of unified market symbols |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the bitmex api endpoint |
<a name="watchMyTrades" id="watchmytrades"></a>
watches information on multiple trades made by the user
Kind: instance
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market trades were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trade structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.unifiedMargin | <code>boolean</code> | No | use unified margin account |
<a name="watchMyTradesForSymbols" id="watchmytradesforsymbols"></a>
watches information on multiple trades made by the user
Kind: instance
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trade structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchOHLCV" id="watchohlcv"></a>
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchOHLCVForSymbols" id="watchohlcvforsymbols"></a>
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance
Returns: <code>object</code> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbolsAndTimeframes | <code>Array<Array<string>></code> | Yes | array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']] |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchOrderBook" id="watchorderbook"></a>
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return. |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchOrderBookForSymbols" id="watchorderbookforsymbols"></a>
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified array of symbols |
| limit | <code>int</code> | No | the maximum amount of order book entries to return. |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchOrders" id="watchorders"></a>
watches information on multiple orders made by the user
Kind: instance
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchOrdersForSymbols" id="watchordersforsymbols"></a>
watches information on multiple orders made by the user across multiple symbols
Kind: instance
Returns: <code>Array<object></code> - a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>boolean</code> | No | set to true for trigger orders |
<a name="watchPosition" id="watchposition"></a>
watch open positions for a specific symbol
Kind: instance
Returns: <code>object</code> - a position structure
| Param | Type | Description |
|---|---|---|
| symbol | <code>string</code>, <code>undefined</code> | unified market symbol |
| params | <code>object</code> | extra parameters specific to the exchange API endpoint |
<a name="watchPositions" id="watchpositions"></a>
watch all open positions
Kind: instance
Returns: <code>Array<object></code> - a list of position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| since | <code>int</code> | No | the earliest time in ms to fetch positions for |
| limit | <code>int</code> | No | the maximum number of positions to retrieve |
| params | <code>object</code> | Yes | extra parameters specific to the exchange API endpoint |
<a name="watchTicker" id="watchticker"></a>
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchTickers" id="watchtickers"></a>
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchTrades" id="watchtrades"></a>
watches information on multiple trades made in a market
Kind: instance
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market trades were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of trade structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="watchTradesForSymbols" id="watchtradesforsymbols"></a>
get the list of most recent trades for a list of symbols
Kind: instance
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
<a name="withdraw" id="withdraw"></a>
make a withdrawal
Kind: instance
Returns: <code>object</code> - a transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | the amount to withdraw |
| address | <code>string</code> | Yes | the address to withdraw to |
| tag | <code>string</code> | Yes | |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.account | <code>Account</code> | No | account id to use, required |
<a name="withdrawWs" id="withdrawws"></a>
make a withdrawal
Kind: instance
Returns: <code>object</code> - a transaction structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | the amount to withdraw |
| address | <code>string</code> | Yes | the address to withdraw to |
| tag | <code>string</code> | Yes | |
| params | <code>object</code> | No | extra parameters specific to the bitvavo api endpoint |