Files
ritmex-bot/docs/ccxt/wiki/exchanges/backpack.md
T
2025-10-03 15:28:16 +08:00

1154 lines
44 KiB
Markdown

<a name="backpack" id="backpack"></a>
## backpack{docsify-ignore}
**Kind**: global class
**Extends**: <code>Exchange</code>
* [fetchCurrencies](#fetchcurrencies)
* [fetchMarkets](#fetchmarkets)
* [fetchTickers](#fetchtickers)
* [fetchTicker](#fetchticker)
* [fetchOrderBook](#fetchorderbook)
* [fetchOHLCV](#fetchohlcv)
* [fetchFundingRate](#fetchfundingrate)
* [fetchOpenInterest](#fetchopeninterest)
* [fetchFundingRateHistory](#fetchfundingratehistory)
* [fetchTrades](#fetchtrades)
* [fetchMyTrades](#fetchmytrades)
* [fetchStatus](#fetchstatus)
* [fetchTime](#fetchtime)
* [fetchBalance](#fetchbalance)
* [fetchDeposits](#fetchdeposits)
* [fetchWithdrawals](#fetchwithdrawals)
* [withdraw](#withdraw)
* [fetchDepositAddress](#fetchdepositaddress)
* [createOrder](#createorder)
* [createOrders](#createorders)
* [fetchOpenOrders](#fetchopenorders)
* [fetchOpenOrder](#fetchopenorder)
* [cancelOrder](#cancelorder)
* [cancelAllOrders](#cancelallorders)
* [fetchOrders](#fetchorders)
* [fetchPositions](#fetchpositions)
* [fetchFundingHistory](#fetchfundinghistory)
* [watchTicker](#watchticker)
* [unWatchTicker](#unwatchticker)
* [watchTickers](#watchtickers)
* [unWatchTickers](#unwatchtickers)
* [watchBidsAsks](#watchbidsasks)
* [unWatchBidsAsks](#unwatchbidsasks)
* [watchOHLCV](#watchohlcv)
* [unWatchOHLCV](#unwatchohlcv)
* [watchOHLCVForSymbols](#watchohlcvforsymbols)
* [unWatchOHLCVForSymbols](#unwatchohlcvforsymbols)
* [watchTrades](#watchtrades)
* [unWatchTrades](#unwatchtrades)
* [watchTradesForSymbols](#watchtradesforsymbols)
* [unWatchTradesForSymbols](#unwatchtradesforsymbols)
* [watchOrderBook](#watchorderbook)
* [watchOrderBookForSymbols](#watchorderbookforsymbols)
* [unWatchOrderBook](#unwatchorderbook)
* [unWatchOrderBookForSymbols](#unwatchorderbookforsymbols)
* [watchOrders](#watchorders)
* [unWatchOrders](#unwatchorders)
* [watchPositions](#watchpositions)
* [unWatchPositions](#unwatchpositions)
<a name="fetchCurrencies" id="fetchcurrencies"></a>
### fetchCurrencies{docsify-ignore}
fetches all available currencies on an exchange
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - an associative dictionary of currencies
**See**: https://docs.backpack.exchange/#tag/Assets
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.fetchCurrencies ([params])
```
<a name="fetchMarkets" id="fetchmarkets"></a>
### fetchMarkets{docsify-ignore}
retrieves data on all markets for bitbank
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - an array of objects representing market data
**See**: https://docs.backpack.exchange/#tag/Markets/operation/get_markets
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.fetchMarkets ([params])
```
<a name="fetchTickers" id="fetchtickers"></a>
### fetchTickers{docsify-ignore}
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://docs.backpack.exchange/#tag/Markets/operation/get_tickers
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</code>, <code>undefined</code> | Yes | 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 |
```javascript
backpack.fetchTickers (symbols[, params])
```
<a name="fetchTicker" id="fetchticker"></a>
### fetchTicker{docsify-ignore}
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://docs.backpack.exchange/#tag/Markets/operation/get_ticker
| 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 |
```javascript
backpack.fetchTicker (symbol[, params])
```
<a name="fetchOrderBook" id="fetchorderbook"></a>
### fetchOrderBook{docsify-ignore}
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - A dictionary of [order book structures](https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure) indexed by market symbols
**See**: https://docs.backpack.exchange/#tag/Markets/operation/get_depth
| 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 (default 100, max 200) |
| params | <code>object</code> | No | extra parameters specific to the bitteam api endpoint |
```javascript
backpack.fetchOrderBook (symbol[, limit, params])
```
<a name="fetchOHLCV" id="fetchohlcv"></a>
### fetchOHLCV{docsify-ignore}
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;Array&lt;int&gt;&gt;</code> - A list of candles ordered as timestamp, open, high, low, close, volume
**See**: https://docs.backpack.exchange/#tag/Markets/operation/get_klines
| 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 seconds of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch (default 100) |
| params | <code>object</code> | No | extra parameters specific to the bitteam api endpoint |
```javascript
backpack.fetchOHLCV (symbol, timeframe[, since, limit, params])
```
<a name="fetchFundingRate" id="fetchfundingrate"></a>
### fetchFundingRate{docsify-ignore}
fetch the current funding rate
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [funding rate structure](https://docs.ccxt.com/#/?id=funding-rate-structure)
**See**: https://docs.backpack.exchange/#tag/Markets/operation/get_mark_prices
| 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 |
```javascript
backpack.fetchFundingRate (symbol[, params])
```
<a name="fetchOpenInterest" id="fetchopeninterest"></a>
### fetchOpenInterest{docsify-ignore}
Retrieves the open interest of a derivative trading pair
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - an open interest structure[https://docs.ccxt.com/#/?id=interest-history-structure](https://docs.ccxt.com/#/?id=interest-history-structure)
**See**: https://docs.backpack.exchange/#tag/Markets/operation/get_open_interest
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| params | <code>object</code> | No | exchange specific parameters |
```javascript
backpack.fetchOpenInterest (symbol[, params])
```
<a name="fetchFundingRateHistory" id="fetchfundingratehistory"></a>
### fetchFundingRateHistory{docsify-ignore}
fetches historical funding rate prices
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - a list of [funding rate structures](https://docs.ccxt.com/#/?id=funding-rate-history-structure)
**See**: https://docs.backpack.exchange/#tag/Markets/operation/get_funding_interval_rates
| 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 |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.fetchFundingRateHistory (symbol[, since, limit, params])
```
<a name="fetchTrades" id="fetchtrades"></a>
### fetchTrades{docsify-ignore}
get the list of most recent trades for a particular symbol
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;Trade&gt;</code> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**
- https://docs.backpack.exchange/#tag/Trades/operation/get_recent_trades
- https://docs.backpack.exchange/#tag/Trades/operation/get_historical_trades
| 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.offset | <code>int</code> | No | the number of trades to skip, default is 0 |
```javascript
backpack.fetchTrades (symbol[, since, limit, params])
```
<a name="fetchMyTrades" id="fetchmytrades"></a>
### fetchMyTrades{docsify-ignore}
fetch all trades made by the user
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;Trade&gt;</code> - a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure)
**See**: https://docs.backpack.exchange/#tag/History/operation/get_fills
| 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 100, max 1000) |
| 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.fillType | <code>string</code> | No | 'User' (default) 'BookLiquidation' or 'Adl' or 'Backstop' or 'Liquidation' or 'AllLiquidation' or 'CollateralConversion' or 'CollateralConversionAndSpotLiquidation' |
```javascript
backpack.fetchMyTrades (symbol[, since, limit, params])
```
<a name="fetchStatus" id="fetchstatus"></a>
### fetchStatus{docsify-ignore}
the latest known information on the availability of the exchange API
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [status structure](https://docs.ccxt.com/#/?id=exchange-status-structure)
**See**: https://docs.backpack.exchange/#tag/System/operation/get_status
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.fetchStatus ([params])
```
<a name="fetchTime" id="fetchtime"></a>
### fetchTime{docsify-ignore}
fetches the current integer timestamp in milliseconds from the exchange server
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>int</code> - the current integer timestamp in milliseconds from the exchange server
**See**: https://developer-pro.bitmart.com/en/spot/#get-system-time
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.fetchTime ([params])
```
<a name="fetchBalance" id="fetchbalance"></a>
### fetchBalance{docsify-ignore}
query for balance and get the amount of funds available for trading or funds locked in orders
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [balance structure](https://docs.ccxt.com/#/?id=balance-structure)
**See**: https://docs.backpack.exchange/#tag/Capital/operation/get_balances
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.fetchBalance ([params])
```
<a name="fetchDeposits" id="fetchdeposits"></a>
### fetchDeposits{docsify-ignore}
fetch all deposits made to an account
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - a list of [transaction structures](https://docs.ccxt.com/#/?id=transaction-structure)
**See**: https://docs.backpack.exchange/#tag/Capital/operation/get_deposits
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch deposits for |
| limit | <code>int</code> | No | the maximum number of deposits structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
```javascript
backpack.fetchDeposits (code[, since, limit, params])
```
<a name="fetchWithdrawals" id="fetchwithdrawals"></a>
### fetchWithdrawals{docsify-ignore}
fetch all withdrawals made from an account
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - a list of [transaction structures](https://docs.ccxt.com/#/?id=transaction-structure)
**See**: https://docs.backpack.exchange/#tag/Capital/operation/get_withdrawals
| 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 (default 24 hours ago) |
| limit | <code>int</code> | No | the maximum number of transfer structures to retrieve (default 50, max 200) |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch transfers for (default time now) |
```javascript
backpack.fetchWithdrawals (code[, since, limit, params])
```
<a name="withdraw" id="withdraw"></a>
### withdraw{docsify-ignore}
make a withdrawal
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [transaction structure](https://docs.ccxt.com/#/?id=transaction-structure)
**See**: https://docs.backpack.exchange/#tag/Capital/operation/request_withdrawal
| 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.network | <code>string</code> | No | the network to withdraw on (mandatory) |
```javascript
backpack.withdraw (code, amount, address, tag[, params])
```
<a name="fetchDepositAddress" id="fetchdepositaddress"></a>
### fetchDepositAddress{docsify-ignore}
fetch the deposit address for a currency associated with this account
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - an [address structure](https://docs.ccxt.com/#/?id=address-structure)
**See**: https://docs.backpack.exchange/#tag/Capital/operation/get_deposit_address
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.networkCode | <code>string</code> | No | the network to fetch the deposit address (mandatory) |
```javascript
backpack.fetchDepositAddress (code[, params])
```
<a name="createOrder" id="createorder"></a>
### createOrder{docsify-ignore}
create a trade order
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.backpack.exchange/#tag/Order/operation/execute_order
| 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 fullfilled, 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 orders only* the cost of the order in units of the quote currency (could be used instead of amount) |
| params.clientOrderId | <code>int</code> | No | a unique id for the order |
| params.postOnly | <code>boolean</code> | No | true to place a post only order |
| params.timeInForce | <code>string</code> | No | 'GTC', 'IOC', 'FOK' or 'PO' |
| params.reduceOnly | <code>bool</code> | No | *contract only* Indicates if this order is to reduce the size of a position |
| params.selfTradePrevention | <code>string</code> | No | one of EXPIRE_MAKER, EXPIRE_TAKER or EXPIRE_BOTH |
| params.autoLend | <code>bool</code> | No | *spot margin only* if true then the order can lend |
| params.autoLendRedeem | <code>bool</code> | No | *spot margin only* if true then the order can redeem a lend if required |
| params.autoBorrow | <code>bool</code> | No | *spot margin only* if true then the order can borrow |
| params.autoBorrowRepay | <code>bool</code> | No | *spot margin only* if true then the order can repay a borrow |
| params.triggerPrice | <code>float</code> | No | the price that a trigger order is triggered at |
| params.takeProfit | <code>object</code> | No | *swap markets only - takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered |
| params.takeProfit.triggerPrice | <code>float</code> | No | take profit trigger price |
| params.takeProfit.price | <code>float</code> | No | take profit order price (if not provided the order will be a market order) |
| params.stopLoss | <code>object</code> | No | *swap markets only - stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered |
| params.stopLoss.triggerPrice | <code>float</code> | No | stop loss trigger price |
| params.stopLoss.price | <code>float</code> | No | stop loss order price (if not provided the order will be a market order) |
```javascript
backpack.createOrder (symbol, type, side, amount[, price, params])
```
<a name="createOrders" id="createorders"></a>
### createOrders{docsify-ignore}
create a list of trade orders
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.backpack.exchange/#tag/Order/operation/execute_order_batch
| 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 |
```javascript
backpack.createOrders (orders[, params])
```
<a name="fetchOpenOrders" id="fetchopenorders"></a>
### fetchOpenOrders{docsify-ignore}
fetch all unfilled currently open orders
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;Order&gt;</code> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.backpack.exchange/#tag/Order/operation/get_open_orders
| 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 |
```javascript
backpack.fetchOpenOrders (symbol[, since, limit, params])
```
<a name="fetchOpenOrder" id="fetchopenorder"></a>
### fetchOpenOrder{docsify-ignore}
fetch an open order by it's id
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.backpack.exchange/#tag/Order/operation/get_order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | not used by hollaex fetchOpenOrder () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.fetchOpenOrder (id, symbol[, params])
```
<a name="cancelOrder" id="cancelorder"></a>
### cancelOrder{docsify-ignore}
cancels an open order
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - An [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.backpack.exchange/#tag/Order/operation/cancel_order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.cancelOrder (id, symbol[, params])
```
<a name="cancelAllOrders" id="cancelallorders"></a>
### cancelAllOrders{docsify-ignore}
cancel all open orders
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.backpack.exchange/#tag/Order/operation/cancel_open_orders
| 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 |
```javascript
backpack.cancelAllOrders (symbol[, params])
```
<a name="fetchOrders" id="fetchorders"></a>
### fetchOrders{docsify-ignore}
fetches information on multiple orders made by the user
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;Order&gt;</code> - a list of [order structures](https://github.com/ccxt/ccxt/wiki/Manual#order-structure)
**See**: https://docs.backpack.exchange/#tag/History/operation/get_order_history
| 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 orde structures to retrieve (default 100, max 1000) |
| params | <code>object</code> | No | extra parameters specific to the bitteam api endpoint |
```javascript
backpack.fetchOrders (symbol[, since, limit, params])
```
<a name="fetchPositions" id="fetchpositions"></a>
### fetchPositions{docsify-ignore}
fetch all open positions
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - a list of [position structure](https://docs.ccxt.com/#/?id=position-structure)
**See**: https://docs.backpack.exchange/#tag/Futures/operation/get_positions
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.fetchPositions (symbols[, params])
```
<a name="fetchFundingHistory" id="fetchfundinghistory"></a>
### fetchFundingHistory{docsify-ignore}
fetches the history of funding payments
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;Trade&gt;</code> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**: https://docs.backpack.exchange/#tag/History/operation/get_funding_payments
| 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 (default 24 hours ago) |
| limit | <code>int</code> | No | the maximum amount of trades to fetch (default 200, max 500) |
| 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 trade to fetch (default now) |
```javascript
backpack.fetchFundingHistory (symbol[, since, limit, params])
```
<a name="watchTicker" id="watchticker"></a>
### watchTicker{docsify-ignore}
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://docs.backpack.exchange/#tag/Streams/Public/Ticker
| 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 |
```javascript
backpack.watchTicker (symbol[, params])
```
<a name="unWatchTicker" id="unwatchticker"></a>
### unWatchTicker{docsify-ignore}
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://docs.backpack.exchange/#tag/Streams/Public/Ticker
| 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 |
```javascript
backpack.unWatchTicker (symbol[, params])
```
<a name="watchTickers" id="watchtickers"></a>
### watchTickers{docsify-ignore}
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://docs.backpack.exchange/#tag/Streams/Public/Ticker
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</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 |
```javascript
backpack.watchTickers (symbols[, params])
```
<a name="unWatchTickers" id="unwatchtickers"></a>
### unWatchTickers{docsify-ignore}
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://docs.backpack.exchange/#tag/Streams/Public/Ticker
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</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 |
```javascript
backpack.unWatchTickers (symbols[, params])
```
<a name="watchBidsAsks" id="watchbidsasks"></a>
### watchBidsAsks{docsify-ignore}
watches best bid & ask for symbols
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://docs.backpack.exchange/#tag/Streams/Public/Book-ticker
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</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 |
```javascript
backpack.watchBidsAsks (symbols[, params])
```
<a name="unWatchBidsAsks" id="unwatchbidsasks"></a>
### unWatchBidsAsks{docsify-ignore}
unWatches best bid & ask for symbols
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</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 |
```javascript
backpack.unWatchBidsAsks (symbols[, params])
```
<a name="watchOHLCV" id="watchohlcv"></a>
### watchOHLCV{docsify-ignore}
watches historical candlestick data containing the open, high, low, close price, and the volume of a market
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;Array&lt;int&gt;&gt;</code> - A list of candles ordered as timestamp, open, high, low, close, volume
**See**: https://docs.backpack.exchange/#tag/Streams/Public/K-Line
| 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 |
```javascript
backpack.watchOHLCV (symbol, timeframe[, since, limit, params])
```
<a name="unWatchOHLCV" id="unwatchohlcv"></a>
### unWatchOHLCV{docsify-ignore}
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;Array&lt;int&gt;&gt;</code> - A list of candles ordered as timestamp, open, high, low, close, volume
**See**: https://docs.backpack.exchange/#tag/Streams/Public/K-Line
| 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 |
```javascript
backpack.unWatchOHLCV (symbol, timeframe[, params])
```
<a name="watchOHLCVForSymbols" id="watchohlcvforsymbols"></a>
### watchOHLCVForSymbols{docsify-ignore}
watches historical candlestick data containing the open, high, low, close price, and the volume of a market
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;Array&lt;int&gt;&gt;</code> - A list of candles ordered as timestamp, open, high, low, close, volume
**See**: https://docs.backpack.exchange/#tag/Streams/Public/K-Line
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbolsAndTimeframes | <code>Array&lt;Array&lt;string&gt;&gt;</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 |
```javascript
backpack.watchOHLCVForSymbols (symbolsAndTimeframes[, since, limit, params])
```
<a name="unWatchOHLCVForSymbols" id="unwatchohlcvforsymbols"></a>
### unWatchOHLCVForSymbols{docsify-ignore}
unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;Array&lt;int&gt;&gt;</code> - A list of candles ordered as timestamp, open, high, low, close, volume
**See**: https://docs.backpack.exchange/#tag/Streams/Public/K-Line
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbolsAndTimeframes | <code>Array&lt;Array&lt;string&gt;&gt;</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 |
```javascript
backpack.unWatchOHLCVForSymbols (symbolsAndTimeframes[, params])
```
<a name="watchTrades" id="watchtrades"></a>
### watchTrades{docsify-ignore}
watches information on multiple trades made in a market
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://docs.backpack.exchange/#tag/Streams/Public/Trade
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker 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 |
```javascript
backpack.watchTrades (symbol[, since, limit, params])
```
<a name="unWatchTrades" id="unwatchtrades"></a>
### unWatchTrades{docsify-ignore}
unWatches from the stream channel
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**: https://docs.backpack.exchange/#tag/Streams/Public/Trade
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.unWatchTrades (symbol[, params])
```
<a name="watchTradesForSymbols" id="watchtradesforsymbols"></a>
### watchTradesForSymbols{docsify-ignore}
watches information on multiple trades made in a market
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://docs.backpack.exchange/#tag/Streams/Public/Trade
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</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 |
```javascript
backpack.watchTradesForSymbols (symbols[, since, limit, params])
```
<a name="unWatchTradesForSymbols" id="unwatchtradesforsymbols"></a>
### unWatchTradesForSymbols{docsify-ignore}
unWatches from the stream channel
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**: https://docs.backpack.exchange/#tag/Streams/Public/Trade
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</code> | Yes | unified symbol of the market to fetch trades for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.unWatchTradesForSymbols (symbols[, params])
```
<a name="watchOrderBook" id="watchorderbook"></a>
### watchOrderBook{docsify-ignore}
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
**See**: https://docs.backpack.exchange/#tag/Streams/Public/Depth
| 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 |
```javascript
backpack.watchOrderBook (symbol[, limit, params])
```
<a name="watchOrderBookForSymbols" id="watchorderbookforsymbols"></a>
### watchOrderBookForSymbols{docsify-ignore}
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
**See**: https://docs.backpack.exchange/#tag/Streams/Public/Depth
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</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 |
| params.method | <code>string</code> | No | either '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2' |
```javascript
backpack.watchOrderBookForSymbols (symbols[, limit, params])
```
<a name="unWatchOrderBook" id="unwatchorderbook"></a>
### unWatchOrderBook{docsify-ignore}
unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | <code>string</code> | Yes | unified array of symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
```javascript
backpack.unWatchOrderBook (symbol[, params])
```
<a name="unWatchOrderBookForSymbols" id="unwatchorderbookforsymbols"></a>
### unWatchOrderBookForSymbols{docsify-ignore}
unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>object</code> - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</code> | Yes | unified array of symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.method | <code>string</code> | No | either '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2' |
```javascript
backpack.unWatchOrderBookForSymbols (symbols[, params])
```
<a name="watchOrders" id="watchorders"></a>
### watchOrders{docsify-ignore}
watches information on multiple orders made by the user
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.backpack.exchange/#tag/Streams/Private/Order-update
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | <code>string</code> | No | 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 |
```javascript
backpack.watchOrders ([symbol, since, limit, params])
```
<a name="unWatchOrders" id="unwatchorders"></a>
### unWatchOrders{docsify-ignore}
unWatches information on multiple orders made by the user
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.backpack.exchange/#tag/Streams/Private/Order-update
| 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 |
```javascript
backpack.unWatchOrders ([symbol, params])
```
<a name="watchPositions" id="watchpositions"></a>
### watchPositions{docsify-ignore}
watch all open positions
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - a list of [position structure](https://docs.ccxt.com/en/latest/manual.html#position-structure)
**See**: https://docs.backpack.exchange/#tag/Streams/Private/Position-update
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</code> | No | list of unified market symbols to watch positions for |
| 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 |
```javascript
backpack.watchPositions ([symbols, since, limit, params])
```
<a name="unWatchPositions" id="unwatchpositions"></a>
### unWatchPositions{docsify-ignore}
unWatches from the stream channel
**Kind**: instance method of [<code>backpack</code>](#backpack)
**Returns**: <code>Array&lt;object&gt;</code> - a list of [position structure](https://docs.ccxt.com/en/latest/manual.html#position-structure)
**See**: https://docs.backpack.exchange/#tag/Streams/Private/Position-update
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | <code>Array&lt;string&gt;</code> | No | list of unified market symbols to watch positions for |
| params | <code>object</code> | Yes | extra parameters specific to the exchange API endpoint |
```javascript
backpack.unWatchPositions ([symbols, params])
```