## binance{docsify-ignore}
**Kind**: global class
**Extends**: Exchange
* [fetchTime](#fetchtime)
* [fetchCurrencies](#fetchcurrencies)
* [fetchMarkets](#fetchmarkets)
* [fetchBalance](#fetchbalance)
* [fetchOrderBook](#fetchorderbook)
* [fetchStatus](#fetchstatus)
* [fetchTicker](#fetchticker)
* [fetchBidsAsks](#fetchbidsasks)
* [fetchLastPrices](#fetchlastprices)
* [fetchTickers](#fetchtickers)
* [fetchOHLCV](#fetchohlcv)
* [fetchTrades](#fetchtrades)
* [editContractOrder](#editcontractorder)
* [editOrder](#editorder)
* [createOrders](#createorders)
* [createOrder](#createorder)
* [createMarketOrderWithCost](#createmarketorderwithcost)
* [createMarketBuyOrderWithCost](#createmarketbuyorderwithcost)
* [createMarketSellOrderWithCost](#createmarketsellorderwithcost)
* [fetchOrder](#fetchorder)
* [fetchOrders](#fetchorders)
* [fetchOpenOrders](#fetchopenorders)
* [fetchOpenOrder](#fetchopenorder)
* [fetchClosedOrders](#fetchclosedorders)
* [fetchCanceledOrders](#fetchcanceledorders)
* [fetchCanceledAndClosedOrders](#fetchcanceledandclosedorders)
* [cancelOrder](#cancelorder)
* [cancelAllOrders](#cancelallorders)
* [cancelOrders](#cancelorders)
* [fetchOrderTrades](#fetchordertrades)
* [fetchMyTrades](#fetchmytrades)
* [fetchMyDustTrades](#fetchmydusttrades)
* [fetchDeposits](#fetchdeposits)
* [fetchWithdrawals](#fetchwithdrawals)
* [transfer](#transfer)
* [fetchTransfers](#fetchtransfers)
* [fetchDepositAddress](#fetchdepositaddress)
* [fetchTransactionFees](#fetchtransactionfees)
* [fetchDepositWithdrawFees](#fetchdepositwithdrawfees)
* [withdraw](#withdraw)
* [fetchTradingFee](#fetchtradingfee)
* [fetchTradingFees](#fetchtradingfees)
* [fetchFundingRate](#fetchfundingrate)
* [fetchFundingRateHistory](#fetchfundingratehistory)
* [fetchFundingRates](#fetchfundingrates)
* [fetchLeverageTiers](#fetchleveragetiers)
* [fetchPosition](#fetchposition)
* [fetchOptionPositions](#fetchoptionpositions)
* [fetchPositions](#fetchpositions)
* [fetchFundingHistory](#fetchfundinghistory)
* [setLeverage](#setleverage)
* [setMarginMode](#setmarginmode)
* [setPositionMode](#setpositionmode)
* [fetchLeverages](#fetchleverages)
* [fetchSettlementHistory](#fetchsettlementhistory)
* [fetchMySettlementHistory](#fetchmysettlementhistory)
* [fetchLedger](#fetchledger)
* [reduceMargin](#reducemargin)
* [addMargin](#addmargin)
* [fetchCrossBorrowRate](#fetchcrossborrowrate)
* [fetchIsolatedBorrowRate](#fetchisolatedborrowrate)
* [fetchIsolatedBorrowRates](#fetchisolatedborrowrates)
* [fetchBorrowRateHistory](#fetchborrowratehistory)
* [createGiftCode](#creategiftcode)
* [redeemGiftCode](#redeemgiftcode)
* [verifyGiftCode](#verifygiftcode)
* [fetchBorrowInterest](#fetchborrowinterest)
* [repayCrossMargin](#repaycrossmargin)
* [repayIsolatedMargin](#repayisolatedmargin)
* [borrowCrossMargin](#borrowcrossmargin)
* [borrowIsolatedMargin](#borrowisolatedmargin)
* [fetchOpenInterestHistory](#fetchopeninteresthistory)
* [fetchOpenInterest](#fetchopeninterest)
* [fetchMyLiquidations](#fetchmyliquidations)
* [fetchGreeks](#fetchgreeks)
* [fetchPositionMode](#fetchpositionmode)
* [fetchMarginModes](#fetchmarginmodes)
* [fetchOption](#fetchoption)
* [fetchConvertCurrencies](#fetchconvertcurrencies)
* [fetchConvertQuote](#fetchconvertquote)
* [createConvertTrade](#createconverttrade)
* [fetchConvertTrade](#fetchconverttrade)
* [fetchConvertTradeHistory](#fetchconverttradehistory)
* [watchLiquidations](#watchliquidations)
* [watchLiquidationsForSymbols](#watchliquidationsforsymbols)
* [watchMyLiquidations](#watchmyliquidations)
* [watchMyLiquidationsForSymbols](#watchmyliquidationsforsymbols)
* [watchOrderBook](#watchorderbook)
* [watchOrderBookForSymbols](#watchorderbookforsymbols)
* [unWatchOrderBookForSymbols](#unwatchorderbookforsymbols)
* [unWatchOrderBook](#unwatchorderbook)
* [fetchOrderBookWs](#fetchorderbookws)
* [watchTradesForSymbols](#watchtradesforsymbols)
* [unWatchTradesForSymbols](#unwatchtradesforsymbols)
* [unWatchTrades](#unwatchtrades)
* [watchTrades](#watchtrades)
* [watchOHLCV](#watchohlcv)
* [watchOHLCVForSymbols](#watchohlcvforsymbols)
* [unWatchOHLCVForSymbols](#unwatchohlcvforsymbols)
* [unWatchOHLCV](#unwatchohlcv)
* [fetchTickerWs](#fetchtickerws)
* [fetchOHLCVWs](#fetchohlcvws)
* [watchTicker](#watchticker)
* [watchTickers](#watchtickers)
* [unWatchTickers](#unwatchtickers)
* [unWatchTicker](#unwatchticker)
* [watchBidsAsks](#watchbidsasks)
* [fetchBalanceWs](#fetchbalancews)
* [fetchPositionWs](#fetchpositionws)
* [fetchPositionsWs](#fetchpositionsws)
* [watchBalance](#watchbalance)
* [createOrderWs](#createorderws)
* [editOrderWs](#editorderws)
* [cancelOrderWs](#cancelorderws)
* [cancelAllOrdersWs](#cancelallordersws)
* [fetchOrderWs](#fetchorderws)
* [fetchOrdersWs](#fetchordersws)
* [fetchClosedOrdersWs](#fetchclosedordersws)
* [fetchOpenOrdersWs](#fetchopenordersws)
* [watchOrders](#watchorders)
* [watchPositions](#watchpositions)
* [fetchMyTradesWs](#fetchmytradesws)
* [fetchTradesWs](#fetchtradesws)
* [watchMyTrades](#watchmytrades)
### fetchTime{docsify-ignore}
fetches the current integer timestamp in milliseconds from the exchange server
**Kind**: instance method of [binance
](#binance)
**Returns**: int
- the current integer timestamp in milliseconds from the exchange server
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time // spot
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time // swap
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time // future
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchTime ([params])
```
### fetchCurrencies{docsify-ignore}
fetches all available currencies on an exchange
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an associative dictionary of currencies
**See**: https://developers.binance.com/docs/wallet/capital/all-coins-info
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchCurrencies ([params])
```
### fetchMarkets{docsify-ignore}
retrieves data on all markets for binance
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- an array of objects representing market data
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information // spot
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information // swap
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information // future
- https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information // option
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchMarkets ([params])
```
### fetchBalance{docsify-ignore}
query for balance and get the amount of funds available for trading or funds locked in orders
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [balance structure](https://docs.ccxt.com/#/?id=balance-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data // spot
- https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details // cross margin
- https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info // isolated margin
- https://developers.binance.com/docs/wallet/asset/funding-wallet // funding
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2 // swap
- https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Futures-Account-Balance // future
- https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information // option
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Balance // portfolio margin
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.type | string
| No | 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi' |
| params.marginMode | string
| No | 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null |
| params.symbols | Array<string>
, undefined
| No | unified market symbols, only used in isolated margin mode |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch the balance for a portfolio margin account |
| params.subType | string
| No | 'linear' or 'inverse' |
```javascript
binance.fetchBalance ([params])
```
### fetchOrderBook{docsify-ignore}
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book // spot
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book // swap
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book // future
- https://developers.binance.com/docs/derivatives/option/market-data/Order-Book // option
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch the order book for |
| limit | int
| No | the maximum amount of order book entries to return |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchOrderBook (symbol[, limit, params])
```
### fetchStatus{docsify-ignore}
the latest known information on the availability of the exchange API
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [status structure](https://docs.ccxt.com/#/?id=exchange-status-structure)
**See**: https://developers.binance.com/docs/wallet/others/system-status
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchStatus ([params])
```
### 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 [binance
](#binance)
**Returns**: object
- a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics // spot
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
- https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch the ticker for |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.rolling | boolean
| No | (spot only) default false, if true, uses the rolling 24 hour ticker endpoint /api/v3/ticker |
```javascript
binance.fetchTicker (symbol[, params])
```
### fetchBidsAsks{docsify-ignore}
fetches the bid and ask price and volume for multiple markets
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker // spot
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker // swap
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker // future
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
, undefined
| Yes | unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchBidsAsks (symbols[, params])
```
### fetchLastPrices{docsify-ignore}
fetches the last price for multiple markets
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a dictionary of lastprices structures
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker // spot
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker // swap
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker // future
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
, undefined
| Yes | unified symbols of the markets to fetch the last prices |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchLastPrices (symbols[, params])
```
### fetchTickers{docsify-ignore}
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
- https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
| No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.subType | string
| No | "linear" or "inverse" |
| params.type | string
| No | 'spot', 'option', use params["subType"] for swap and future markets |
```javascript
binance.fetchTickers ([symbols, params])
```
### 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 [binance
](#binance)
**Returns**: Array<Array<int>>
- A list of candles ordered as timestamp, open, high, low, close, volume
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
- https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Kline-Candlestick-Data
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-Kline-Candlestick-Data
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Mark-Price-Kline-Candlestick-Data
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Premium-Index-Kline-Data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string
| Yes | the length of time each candle represents |
| since | int
| No | timestamp in ms of the earliest candle to fetch |
| limit | int
| No | the maximum amount of candles to fetch |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.price | string
| No | "mark" or "index" for mark price and index price candles |
| params.until | int
| No | timestamp in ms of the latest candle to fetch |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
```javascript
binance.fetchOHLCV (symbol, timeframe[, since, limit, params])
```
### fetchTrades{docsify-ignore}
get the list of most recent trades for a particular symbol
Default fetchTradesMethod
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<Trade>
- a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list // publicGetAggTrades (spot)
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List // fapiPublicGetAggTrades (swap)
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List // dapiPublicGetAggTrades (future)
- https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List // eapiPublicGetTrades (option)
Other fetchTradesMethod
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list // publicGetTrades (spot)
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List // fapiPublicGetTrades (swap)
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List // dapiPublicGetTrades (future)
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup // publicGetHistoricalTrades (spot)
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup // fapiPublicGetHistoricalTrades (swap)
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup // dapiPublicGetHistoricalTrades (future)
- https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup // eapiPublicGetHistoricalTrades (option)
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch trades for |
| since | int
| No | only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades' |
| limit | int
| No | default 500, max 1000 |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.until | int
| No | only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades' |
| params.fetchTradesMethod | int
| No | 'publicGetAggTrades' (spot default), 'fapiPublicGetAggTrades' (swap default), 'dapiPublicGetAggTrades' (future default), 'eapiPublicGetTrades' (option default), 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', 'publicGetHistoricalTrades', 'fapiPublicGetHistoricalTrades', 'dapiPublicGetHistoricalTrades', 'eapiPublicGetHistoricalTrades' |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) EXCHANGE SPECIFIC PARAMETERS |
| params.fromId | int
| No | trade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades' |
```javascript
binance.fetchTrades (symbol[, since, limit, params])
```
### editContractOrder{docsify-ignore}
edit a trade order
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | cancel order id |
| symbol | string
| Yes | unified symbol of the market to create an order in |
| type | string
| Yes | 'market' or 'limit' |
| side | string
| Yes | 'buy' or 'sell' |
| amount | float
| Yes | how much of currency you want to trade in units of base currency |
| price | float
| No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.editContractOrder (id, symbol, type, side, amount[, price, params])
```
### editOrder{docsify-ignore}
edit a trade order
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | cancel order id |
| symbol | string
| Yes | unified symbol of the market to create an order in |
| type | string
| Yes | 'market' or 'limit' |
| side | string
| Yes | 'buy' or 'sell' |
| amount | float
| Yes | how much of currency you want to trade in units of base currency |
| price | float
| No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.editOrder (id, symbol, type, side, amount[, price, params])
```
### createOrders{docsify-ignore}
*contract only* create a list of trade orders
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Place-Multiple-Orders
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders
- https://developers.binance.com/docs/derivatives/option/trade/Place-Multiple-Orders
| Param | Type | Description |
| --- | --- | --- |
| orders | Array
| list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
```javascript
binance.createOrders (orders, [undefined])
```
### createOrder{docsify-ignore}
create a trade order
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
- https://developers.binance.com/docs/derivatives/option/trade/New-Order
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to create an order in |
| type | string
| Yes | 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP' |
| side | string
| Yes | 'buy' or 'sell' |
| amount | float
| Yes | how much of you want to trade in units of the base currency |
| price | float
| No | the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.reduceOnly | string
| No | for swap and future reduceOnly is a string 'true' or 'false' that cant be sent with close position set to true or in hedge mode. For spot margin and option reduceOnly is a boolean. |
| params.marginMode | string
| No | 'cross' or 'isolated', for spot margin trading |
| params.sor | boolean
| No | *spot only* whether to use SOR (Smart Order Routing) or not, default is false |
| params.test | boolean
| No | *spot only* whether to use the test endpoint or not, default is false |
| params.trailingPercent | float
| No | the percent to trail away from the current market price |
| params.trailingTriggerPrice | float
| No | the price to trigger a trailing order, default uses the price argument |
| params.triggerPrice | float
| No | the price that a trigger order is triggered at |
| params.stopLossPrice | float
| No | the price that a stop loss order is triggered at |
| params.takeProfitPrice | float
| No | the price that a take profit order is triggered at |
| params.portfolioMargin | boolean
| No | set to true if you would like to create an order in a portfolio margin account |
| params.stopLossOrTakeProfit | string
| No | 'stopLoss' or 'takeProfit', required for spot trailing orders |
```javascript
binance.createOrder (symbol, type, side, amount[, price, params])
```
### createMarketOrderWithCost{docsify-ignore}
create a market order by providing the symbol, side and cost
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to create an order in |
| side | string
| Yes | 'buy' or 'sell' |
| cost | float
| Yes | how much you want to trade in units of the quote currency |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.createMarketOrderWithCost (symbol, side, cost[, params])
```
### createMarketBuyOrderWithCost{docsify-ignore}
create a market buy order by providing the symbol and cost
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to create an order in |
| cost | float
| Yes | how much you want to trade in units of the quote currency |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.createMarketBuyOrderWithCost (symbol, cost[, params])
```
### createMarketSellOrderWithCost{docsify-ignore}
create a market sell order by providing the symbol and cost
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to create an order in |
| cost | float
| Yes | how much you want to trade in units of the quote currency |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.createMarketSellOrderWithCost (symbol, cost[, params])
```
### fetchOrder{docsify-ignore}
fetches information on an order made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- An [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
- https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
- https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | the order id |
| symbol | string
| Yes | unified symbol of the market the order was made in |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string
| No | 'cross' or 'isolated', for spot margin trading |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch an order in a portfolio margin account |
```javascript
binance.fetchOrder (id, symbol[, params])
```
### fetchOrders{docsify-ignore}
fetches information on multiple orders made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<Order>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
- https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
- https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market orders were made in |
| since | int
| No | the earliest time in ms to fetch orders for |
| limit | int
| No | the maximum number of order structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string
| No | 'cross' or 'isolated', for spot margin trading |
| params.until | int
| No | the latest time in ms to fetch orders for |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch orders in a portfolio margin account |
| params.stop | boolean
| No | set to true if you would like to fetch portfolio margin account stop or conditional orders |
```javascript
binance.fetchOrders (symbol[, since, limit, params])
```
### fetchOpenOrders{docsify-ignore}
fetch all unfilled currently open orders
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<Order>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
- https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
- https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Open-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| since | int
| No | the earliest time in ms to fetch open orders for |
| limit | int
| No | the maximum number of open orders structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string
| No | 'cross' or 'isolated', for spot margin trading |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch open orders in the portfolio margin account |
| params.stop | boolean
| No | set to true if you would like to fetch portfolio margin account conditional orders |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchOpenOrders (symbol[, since, limit, params])
```
### fetchOpenOrder{docsify-ignore}
fetch an open order by the id
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Current-Open-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | order id |
| symbol | string
| Yes | unified market symbol |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.trigger | string
| No | set to true if you would like to fetch portfolio margin account stop or conditional orders |
```javascript
binance.fetchOpenOrder (id, symbol[, params])
```
### fetchClosedOrders{docsify-ignore}
fetches information on multiple closed orders made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<Order>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
- https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
- https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market orders were made in |
| since | int
| No | the earliest time in ms to fetch orders for |
| limit | int
| No | the maximum number of order structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch orders in a portfolio margin account |
| params.stop | boolean
| No | set to true if you would like to fetch portfolio margin account stop or conditional orders |
```javascript
binance.fetchClosedOrders (symbol[, since, limit, params])
```
### fetchCanceledOrders{docsify-ignore}
fetches information on multiple canceled orders made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
- https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
- https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market the orders were made in |
| since | int
| No | the earliest time in ms to fetch orders for |
| limit | int
| No | the maximum number of order structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch orders in a portfolio margin account |
| params.stop | boolean
| No | set to true if you would like to fetch portfolio margin account stop or conditional orders |
```javascript
binance.fetchCanceledOrders (symbol[, since, limit, params])
```
### fetchCanceledAndClosedOrders{docsify-ignore}
fetches information on multiple canceled orders made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
- https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
- https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market the orders were made in |
| since | int
| No | the earliest time in ms to fetch orders for |
| limit | int
| No | the maximum number of order structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch orders in a portfolio margin account |
| params.stop | boolean
| No | set to true if you would like to fetch portfolio margin account stop or conditional orders |
```javascript
binance.fetchCanceledAndClosedOrders (symbol[, since, limit, params])
```
### cancelOrder{docsify-ignore}
cancels an open order
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- An [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
- https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
- https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | order id |
| symbol | string
| Yes | unified symbol of the market the order was made in |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean
| No | set to true if you would like to cancel an order in a portfolio margin account |
| params.stop | boolean
| No | set to true if you would like to cancel a portfolio margin account conditional order |
```javascript
binance.cancelOrder (id, symbol[, params])
```
### cancelAllOrders{docsify-ignore}
cancel all open orders in a market
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
- https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
- https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market to cancel orders in |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string
| No | 'cross' or 'isolated', for spot margin trading |
| params.portfolioMargin | boolean
| No | set to true if you would like to cancel orders in a portfolio margin account |
| params.stop | boolean
| No | set to true if you would like to cancel portfolio margin account conditional orders |
```javascript
binance.cancelAllOrders (symbol[, params])
```
### cancelOrders{docsify-ignore}
cancel multiple orders
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Multiple-Orders
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| ids | Array<string>
| Yes | order ids |
| symbol | string
| No | unified market symbol |
| params | object
| No | extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.origClientOrderIdList | Array<string>
| No | max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma |
| params.recvWindow | Array<int>
| No | |
```javascript
binance.cancelOrders (ids[, symbol, params])
```
### fetchOrderTrades{docsify-ignore}
fetch all the trades made from a single order
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
- https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | order id |
| symbol | string
| Yes | unified market symbol |
| since | int
| No | the earliest time in ms to fetch trades for |
| limit | int
| No | the maximum number of trades to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchOrderTrades (id, symbol[, since, limit, params])
```
### fetchMyTrades{docsify-ignore}
fetch all trades made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<Trade>
- a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
- https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
- https://developers.binance.com/docs/derivatives/option/trade/Account-Trade-List
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| since | int
| No | the earliest time in ms to fetch trades for |
| limit | int
| No | the maximum number of trades structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
| params.until | int
| No | the latest time in ms to fetch entries for |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch trades for a portfolio margin account |
```javascript
binance.fetchMyTrades (symbol[, since, limit, params])
```
### fetchMyDustTrades{docsify-ignore}
fetch all dust trades made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure)
**See**: https://developers.binance.com/docs/wallet/asset/dust-log
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | not used by binance fetchMyDustTrades () |
| since | int
| No | the earliest time in ms to fetch my dust trades for |
| limit | int
| No | the maximum number of dust trades to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.type | string
| No | 'spot' or 'margin', default spot |
```javascript
binance.fetchMyDustTrades (symbol[, since, limit, params])
```
### fetchDeposits{docsify-ignore}
fetch all deposits made to an account
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [transaction structures](https://docs.ccxt.com/#/?id=transaction-structure)
**See**
- https://developers.binance.com/docs/wallet/capital/deposite-history
- https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code |
| since | int
| No | the earliest time in ms to fetch deposits for |
| limit | int
| No | the maximum number of deposits structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.fiat | bool
| No | if true, only fiat deposits will be returned |
| params.until | int
| No | the latest time in ms to fetch entries for |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
```javascript
binance.fetchDeposits (code[, since, limit, params])
```
### fetchWithdrawals{docsify-ignore}
fetch all withdrawals made from an account
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [transaction structures](https://docs.ccxt.com/#/?id=transaction-structure)
**See**
- https://developers.binance.com/docs/wallet/capital/withdraw-history
- https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code |
| since | int
| No | the earliest time in ms to fetch withdrawals for |
| limit | int
| No | the maximum number of withdrawals structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.fiat | bool
| No | if true, only fiat withdrawals will be returned |
| params.until | int
| No | the latest time in ms to fetch withdrawals for |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
```javascript
binance.fetchWithdrawals (code[, since, limit, params])
```
### transfer{docsify-ignore}
transfer currency internally between wallets on the same account
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [transfer structure](https://docs.ccxt.com/#/?id=transfer-structure)
**See**: https://developers.binance.com/docs/wallet/asset/user-universal-transfer
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code |
| amount | float
| Yes | amount to transfer |
| fromAccount | string
| Yes | account to transfer from |
| toAccount | string
| Yes | account to transfer to |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.type | string
| No | exchange specific transfer type |
| params.symbol | string
| No | the unified symbol, required for isolated margin transfers |
```javascript
binance.transfer (code, amount, fromAccount, toAccount[, params])
```
### fetchTransfers{docsify-ignore}
fetch a history of internal transfers made on an account
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [transfer structures](https://docs.ccxt.com/#/?id=transfer-structure)
**See**: https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code of the currency transferred |
| since | int
| No | the earliest time in ms to fetch transfers for |
| limit | int
| No | the maximum number of transfers structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.until | int
| No | the latest time in ms to fetch transfers for |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
| params.internal | boolean
| No | default false, when true will fetch pay trade history |
```javascript
binance.fetchTransfers (code[, since, limit, params])
```
### fetchDepositAddress{docsify-ignore}
fetch the deposit address for a currency associated with this account
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [address structure](https://docs.ccxt.com/#/?id=address-structure)
**See**: https://developers.binance.com/docs/wallet/capital/deposite-address
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchDepositAddress (code[, params])
```
### fetchTransactionFees{docsify-ignore}
`DEPRECATED`
please use fetchDepositWithdrawFees instead
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [fee structures](https://docs.ccxt.com/#/?id=fee-structure)
**See**: https://developers.binance.com/docs/wallet/capital/all-coins-info
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| codes | Array<string>
, undefined
| Yes | not used by binance fetchTransactionFees () |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchTransactionFees (codes[, params])
```
### fetchDepositWithdrawFees{docsify-ignore}
fetch deposit and withdraw fees
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [fee structures](https://docs.ccxt.com/#/?id=fee-structure)
**See**: https://developers.binance.com/docs/wallet/capital/all-coins-info
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| codes | Array<string>
, undefined
| Yes | not used by binance fetchDepositWithdrawFees () |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchDepositWithdrawFees (codes[, params])
```
### withdraw{docsify-ignore}
make a withdrawal
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [transaction structure](https://docs.ccxt.com/#/?id=transaction-structure)
**See**: https://developers.binance.com/docs/wallet/capital/withdraw
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code |
| amount | float
| Yes | the amount to withdraw |
| address | string
| Yes | the address to withdraw to |
| tag | string
| Yes | |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.withdraw (code, amount, address, tag[, params])
```
### fetchTradingFee{docsify-ignore}
fetch the trading fees for a market
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [fee structure](https://docs.ccxt.com/#/?id=fee-structure)
**See**
- https://developers.binance.com/docs/wallet/asset/trade-fee
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate
- https://developers.binance.com/docs/derivatives/coin-margined-futures/account/User-Commission-Rate
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch trading fees in a portfolio margin account |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchTradingFee (symbol[, params])
```
### fetchTradingFees{docsify-ignore}
fetch the trading fees for multiple markets
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a dictionary of [fee structures](https://docs.ccxt.com/#/?id=fee-structure) indexed by market symbols
**See**
- https://developers.binance.com/docs/wallet/asset/trade-fee
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
- https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchTradingFees ([params])
```
### fetchFundingRate{docsify-ignore}
fetch the current funding rate
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [funding rate structure](https://docs.ccxt.com/#/?id=funding-rate-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchFundingRate (symbol[, params])
```
### fetchFundingRateHistory{docsify-ignore}
fetches historical funding rate prices
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [funding rate structures](https://docs.ccxt.com/#/?id=funding-rate-history-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Rate-History-of-Perpetual-Futures
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch the funding rate history for |
| since | int
| No | timestamp in ms of the earliest funding rate to fetch |
| limit | int
| No | the maximum amount of [funding rate structures](https://docs.ccxt.com/#/?id=funding-rate-history-structure) to fetch |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.until | int
| No | timestamp in ms of the latest funding rate |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchFundingRateHistory (symbol[, since, limit, params])
```
### fetchFundingRates{docsify-ignore}
fetch the funding rate for multiple markets
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a dictionary of [funding rates structures](https://docs.ccxt.com/#/?id=funding-rates-structure), indexe by market symbols
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
, undefined
| Yes | list of unified market symbols |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchFundingRates (symbols[, params])
```
### fetchLeverageTiers{docsify-ignore}
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a dictionary of [leverage tiers structures](https://docs.ccxt.com/#/?id=leverage-tiers-structure), indexed by market symbols
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets
- https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Notional-Bracket-for-Symbol
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
, undefined
| Yes | list of unified market symbols |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch the leverage tiers for a portfolio margin account |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchLeverageTiers (symbols[, params])
```
### fetchPosition{docsify-ignore}
fetch data on an open position
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [position structure](https://docs.ccxt.com/#/?id=position-structure)
**See**: https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market the position is held in |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchPosition (symbol[, params])
```
### fetchOptionPositions{docsify-ignore}
fetch data on open options positions
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [position structures](https://docs.ccxt.com/#/?id=position-structure)
**See**: https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
, undefined
| Yes | list of unified market symbols |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchOptionPositions (symbols[, params])
```
### fetchPositions{docsify-ignore}
fetch all open positions
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [position structure](https://docs.ccxt.com/#/?id=position-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
- https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
- https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
| No | list of unified market symbols |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| method | string
| No | method name to call, "positionRisk", "account" or "option", default is "positionRisk" |
| params.useV2 | bool
| No | set to true if you want to use the obsolete endpoint, where some more additional fields were provided |
```javascript
binance.fetchPositions ([symbols, params, method])
```
### fetchFundingHistory{docsify-ignore}
fetch the history of funding payments paid and received on this account
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [funding history structure](https://docs.ccxt.com/#/?id=funding-history-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
- https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| since | int
| No | the earliest time in ms to fetch funding history for |
| limit | int
| No | the maximum number of funding history structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.until | int
| No | timestamp in ms of the latest funding history entry |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch the funding history for a portfolio margin account |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchFundingHistory (symbol[, since, limit, params])
```
### setLeverage{docsify-ignore}
set the level of leverage for a market
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- response from the exchange
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Initial-Leverage
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| leverage | float
| Yes | the rate of leverage |
| symbol | string
| Yes | unified market symbol |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean
| No | set to true if you would like to set the leverage for a trading pair in a portfolio margin account |
```javascript
binance.setLeverage (leverage, symbol[, params])
```
### setMarginMode{docsify-ignore}
set margin mode to 'cross' or 'isolated'
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- response from the exchange
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Margin-Type
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| marginMode | string
| Yes | 'cross' or 'isolated' |
| symbol | string
| Yes | unified market symbol |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.setMarginMode (marginMode, symbol[, params])
```
### setPositionMode{docsify-ignore}
set hedged to true or false for a market
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- response from the exchange
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Position-Mode
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| hedged | bool
| Yes | set to true to use dualSidePosition |
| symbol | string
| Yes | not used by binance setPositionMode () |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean
| No | set to true if you would like to set the position mode for a portfolio margin account |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.setPositionMode (hedged, symbol[, params])
```
### fetchLeverages{docsify-ignore}
fetch the set leverage for all markets
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a list of [leverage structures](https://docs.ccxt.com/#/?id=leverage-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
- https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
| No | a list of unified market symbols |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchLeverages ([symbols, params])
```
### fetchSettlementHistory{docsify-ignore}
fetches historical settlement records
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [settlement history objects](https://docs.ccxt.com/#/?id=settlement-history-structure)
**See**: https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the settlement history |
| since | int
| No | timestamp in ms |
| limit | int
| No | number of records, default 100, max 100 |
| params | object
| No | exchange specific params |
```javascript
binance.fetchSettlementHistory (symbol[, since, limit, params])
```
### fetchMySettlementHistory{docsify-ignore}
fetches historical settlement records of the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [settlement history objects]
**See**: https://developers.binance.com/docs/derivatives/option/trade/User-Exercise-Record
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the settlement history |
| since | int
| No | timestamp in ms |
| limit | int
| No | number of records |
| params | object
| No | exchange specific params |
```javascript
binance.fetchMySettlementHistory (symbol[, since, limit, params])
```
### fetchLedger{docsify-ignore}
fetch the history of changes, actions done by the user or operations that altered the balance of the user
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [ledger structure](https://docs.ccxt.com/#/?id=ledger-structure)
**See**
- https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
- https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code |
| since | int
| No | timestamp in ms of the earliest ledger entry |
| limit | int
| No | max number of ledger entrys to return |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.until | int
| No | timestamp in ms of the latest ledger entry |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch the ledger for a portfolio margin account |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchLedger (code[, since, limit, params])
```
### reduceMargin{docsify-ignore}
remove margin from a position
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [margin structure](https://docs.ccxt.com/#/?id=reduce-margin-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| amount | float
| Yes | the amount of margin to remove |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.reduceMargin (symbol, amount[, params])
```
### addMargin{docsify-ignore}
add margin
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [margin structure](https://docs.ccxt.com/#/?id=add-margin-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| amount | float
| Yes | amount of margin to add |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.addMargin (symbol, amount[, params])
```
### fetchCrossBorrowRate{docsify-ignore}
fetch the rate of interest to borrow a currency for margin trading
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [borrow rate structure](https://docs.ccxt.com/#/?id=borrow-rate-structure)
**See**: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchCrossBorrowRate (code[, params])
```
### fetchIsolatedBorrowRate{docsify-ignore}
fetch the rate of interest to borrow a currency for margin trading
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [isolated borrow rate structure](https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure)
**See**: https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| params | object
| No | extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.vipLevel | object
| No | user's current specific margin data will be returned if viplevel is omitted |
```javascript
binance.fetchIsolatedBorrowRate (symbol[, params])
```
### fetchIsolatedBorrowRates{docsify-ignore}
fetch the borrow interest rates of all currencies
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [borrow rate structure](https://docs.ccxt.com/#/?id=borrow-rate-structure)
**See**: https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.symbol | object
| No | unified market symbol EXCHANGE SPECIFIC PARAMETERS |
| params.vipLevel | object
| No | user's current specific margin data will be returned if viplevel is omitted |
```javascript
binance.fetchIsolatedBorrowRates ([params])
```
### fetchBorrowRateHistory{docsify-ignore}
retrieves a history of a currencies borrow interest rate at specific time slots
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- an array of [borrow rate structures](https://docs.ccxt.com/#/?id=borrow-rate-structure)
**See**: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code |
| since | int
| No | timestamp for the earliest borrow rate |
| limit | int
| No | the maximum number of [borrow rate structures](https://docs.ccxt.com/#/?id=borrow-rate-structure) to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchBorrowRateHistory (code[, since, limit, params])
```
### createGiftCode{docsify-ignore}
create gift code
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- The gift code id, code, currency and amount
**See**: https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | gift code |
| amount | float
| Yes | amount of currency for the gift |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.createGiftCode (code, amount[, params])
```
### redeemGiftCode{docsify-ignore}
redeem gift code
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- response from the exchange
**See**: https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| giftcardCode | string
| Yes | |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.redeemGiftCode (giftcardCode[, params])
```
### verifyGiftCode{docsify-ignore}
verify gift code
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- response from the exchange
**See**: https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | reference number id |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.verifyGiftCode (id[, params])
```
### fetchBorrowInterest{docsify-ignore}
fetch the interest owed by the user for borrowing currency for margin trading
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [borrow interest structures](https://docs.ccxt.com/#/?id=borrow-interest-structure)
**See**
- https://developers.binance.com/docs/margin_trading/borrow-and-repay/Get-Interest-History
- https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| No | unified currency code |
| symbol | string
| No | unified market symbol when fetch interest in isolated markets |
| since | int
| No | the earliest time in ms to fetch borrrow interest for |
| limit | int
| No | the maximum number of structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch the borrow interest in a portfolio margin account |
```javascript
binance.fetchBorrowInterest ([code, symbol, since, limit, params])
```
### repayCrossMargin{docsify-ignore}
repay borrowed margin and interest
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [margin loan structure](https://docs.ccxt.com/#/?id=margin-loan-structure)
**See**
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay
- https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code of the currency to repay |
| amount | float
| Yes | the amount to repay |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean
| No | set to true if you would like to repay margin in a portfolio margin account |
```javascript
binance.repayCrossMargin (code, amount[, params])
```
### repayIsolatedMargin{docsify-ignore}
repay borrowed margin and interest
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [margin loan structure](https://docs.ccxt.com/#/?id=margin-loan-structure)
**See**: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol, required for isolated margin |
| code | string
| Yes | unified currency code of the currency to repay |
| amount | float
| Yes | the amount to repay |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.repayIsolatedMargin (symbol, code, amount[, params])
```
### borrowCrossMargin{docsify-ignore}
create a loan to borrow margin
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [margin loan structure](https://docs.ccxt.com/#/?id=margin-loan-structure)
**See**
- https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code of the currency to borrow |
| amount | float
| Yes | the amount to borrow |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean
| No | set to true if you would like to borrow margin in a portfolio margin account |
```javascript
binance.borrowCrossMargin (code, amount[, params])
```
### borrowIsolatedMargin{docsify-ignore}
create a loan to borrow margin
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [margin loan structure](https://docs.ccxt.com/#/?id=margin-loan-structure)
**See**: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol, required for isolated margin |
| code | string
| Yes | unified currency code of the currency to borrow |
| amount | float
| Yes | the amount to borrow |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.borrowIsolatedMargin (symbol, code, amount[, params])
```
### fetchOpenInterestHistory{docsify-ignore}
Retrieves the open interest history of a currency
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an array of [open interest structure](https://docs.ccxt.com/#/?id=open-interest-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest-Statistics
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | Unified CCXT market symbol |
| timeframe | string
| Yes | "5m","15m","30m","1h","2h","4h","6h","12h", or "1d" |
| since | int
| No | the time(ms) of the earliest record to retrieve as a unix timestamp |
| limit | int
| No | default 30, max 500 |
| params | object
| No | exchange specific parameters |
| params.until | int
| No | the time(ms) of the latest record to retrieve as a unix timestamp |
| params.paginate | boolean
| No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
```javascript
binance.fetchOpenInterestHistory (symbol, timeframe[, since, limit, params])
```
### fetchOpenInterest{docsify-ignore}
retrieves the open interest of a contract trading pair
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an open interest structure[https://docs.ccxt.com/#/?id=open-interest-structure](https://docs.ccxt.com/#/?id=open-interest-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest
- https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest
- https://developers.binance.com/docs/derivatives/option/market-data/Open-Interest
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified CCXT market symbol |
| params | object
| No | exchange specific parameters |
```javascript
binance.fetchOpenInterest (symbol[, params])
```
### fetchMyLiquidations{docsify-ignore}
retrieves the users liquidated positions
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an array of [liquidation structures](https://docs.ccxt.com/#/?id=liquidation-structure)
**See**
- https://developers.binance.com/docs/margin_trading/trade/Get-Force-Liquidation-Record
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders
- https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Users-Force-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders
- https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| No | unified CCXT market symbol |
| since | int
| No | the earliest time in ms to fetch liquidations for |
| limit | int
| No | the maximum number of liquidation structures to retrieve |
| params | object
| No | exchange specific parameters for the binance api endpoint |
| params.until | int
| No | timestamp in ms of the latest liquidation |
| params.paginate | boolean
| No | *spot only* default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
| params.portfolioMargin | boolean
| No | set to true if you would like to fetch liquidations in a portfolio margin account |
| params.type | string
| No | "spot" |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchMyLiquidations ([symbol, since, limit, params])
```
### fetchGreeks{docsify-ignore}
fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [greeks structure](https://docs.ccxt.com/#/?id=greeks-structure)
**See**: https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch greeks for |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchGreeks (symbol[, params])
```
### fetchPositionMode{docsify-ignore}
fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an object detailing whether the market is in hedged or one-way mode
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode
- https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Current-Position-Mode
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch the order book for |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchPositionMode (symbol[, params])
```
### fetchMarginModes{docsify-ignore}
fetches margin modes ("isolated" or "cross") that the market for the symbol in in, with symbol=undefined all markets for a subType (linear/inverse) are returned
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a list of [margin mode structures](https://docs.ccxt.com/#/?id=margin-mode-structure)
**See**
- https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market the order was made in |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.subType | string
| No | "linear" or "inverse" |
```javascript
binance.fetchMarginModes (symbol[, params])
```
### fetchOption{docsify-ignore}
fetches option data that is commonly found in an option chain
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [option chain structure](https://docs.ccxt.com/#/?id=option-chain-structure)
**See**: https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchOption (symbol[, params])
```
### fetchConvertCurrencies{docsify-ignore}
fetches all available currencies that can be converted
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an associative dictionary of currencies
**See**: https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchConvertCurrencies ([params])
```
### fetchConvertQuote{docsify-ignore}
fetch a quote for converting from one currency to another
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [conversion structure](https://docs.ccxt.com/#/?id=conversion-structure)
**See**: https://developers.binance.com/docs/convert/trade/Send-quote-request
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| fromCode | string
| Yes | the currency that you want to sell and convert from |
| toCode | string
| Yes | the currency that you want to buy and convert into |
| amount | float
| Yes | how much you want to trade in units of the from currency |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.walletType | string
| No | either 'SPOT' or 'FUNDING', the default is 'SPOT' |
```javascript
binance.fetchConvertQuote (fromCode, toCode, amount[, params])
```
### createConvertTrade{docsify-ignore}
convert from one currency to another
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [conversion structure](https://docs.ccxt.com/#/?id=conversion-structure)
**See**: https://developers.binance.com/docs/convert/trade/Accept-Quote
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | the id of the trade that you want to make |
| fromCode | string
| Yes | the currency that you want to sell and convert from |
| toCode | string
| Yes | the currency that you want to buy and convert into |
| amount | float
| No | how much you want to trade in units of the from currency |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.createConvertTrade (id, fromCode, toCode[, amount, params])
```
### fetchConvertTrade{docsify-ignore}
fetch the data for a conversion trade
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [conversion structure](https://docs.ccxt.com/#/?id=conversion-structure)
**See**: https://developers.binance.com/docs/convert/trade/Order-Status
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | the id of the trade that you want to fetch |
| code | string
| No | the unified currency code of the conversion trade |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchConvertTrade (id[, code, params])
```
### fetchConvertTradeHistory{docsify-ignore}
fetch the users history of conversion trades
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [conversion structures](https://docs.ccxt.com/#/?id=conversion-structure)
**See**: https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| No | the unified currency code |
| since | int
| No | the earliest time in ms to fetch conversions for |
| limit | int
| No | the maximum number of conversion structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.until | int
| No | timestamp in ms of the latest conversion to fetch |
```javascript
binance.fetchConvertTradeHistory ([code, since, limit, params])
```
### watchLiquidations{docsify-ignore}
watch the public liquidations of a trading pair
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an array of [liquidation structures](https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams
- https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Liquidation-Order-Streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified CCXT market symbol |
| since | int
| No | the earliest time in ms to fetch liquidations for |
| limit | int
| No | the maximum number of liquidation structures to retrieve |
| params | object
| No | exchange specific parameters for the bitmex api endpoint |
```javascript
binance.watchLiquidations (symbol[, since, limit, params])
```
### watchLiquidationsForSymbols{docsify-ignore}
watch the public liquidations of a trading pair
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an array of [liquidation structures](https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams
- https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified CCXT market symbol |
| since | int
| No | the earliest time in ms to fetch liquidations for |
| limit | int
| No | the maximum number of liquidation structures to retrieve |
| params | object
| No | exchange specific parameters for the bitmex api endpoint |
```javascript
binance.watchLiquidationsForSymbols (symbol[, since, limit, params])
```
### watchMyLiquidations{docsify-ignore}
watch the private liquidations of a trading pair
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an array of [liquidation structures](https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update
- https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Order-Update
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified CCXT market symbol |
| since | int
| No | the earliest time in ms to fetch liquidations for |
| limit | int
| No | the maximum number of liquidation structures to retrieve |
| params | object
| No | exchange specific parameters for the bitmex api endpoint |
```javascript
binance.watchMyLiquidations (symbol[, since, limit, params])
```
### watchMyLiquidationsForSymbols{docsify-ignore}
watch the private liquidations of a trading pair
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an array of [liquidation structures](https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update
- https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Order-Update
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified CCXT market symbol |
| since | int
| No | the earliest time in ms to fetch liquidations for |
| limit | int
| No | the maximum number of liquidation structures to retrieve |
| params | object
| No | exchange specific parameters for the bitmex api endpoint |
```javascript
binance.watchMyLiquidationsForSymbols (symbol[, since, limit, params])
```
### watchOrderBook{docsify-ignore}
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
**See**
- https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
- https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
- https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch the order book for |
| limit | int
| No | the maximum amount of order book entries to return |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.watchOrderBook (symbol[, limit, params])
```
### watchOrderBookForSymbols{docsify-ignore}
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
**See**
- https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
- https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
- https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
| Yes | unified array of symbols |
| limit | int
| No | the maximum amount of order book entries to return |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.watchOrderBookForSymbols (symbols[, limit, params])
```
### unWatchOrderBookForSymbols{docsify-ignore}
unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
**See**
- https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
- https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
- https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
| Yes | unified array of symbols |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.unWatchOrderBookForSymbols (symbols[, params])
```
### unWatchOrderBook{docsify-ignore}
unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
**See**
- https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
- https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
- https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
- https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified array of symbols |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.unWatchOrderBook (symbol[, params])
```
### fetchOrderBookWs{docsify-ignore}
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#order-book
- https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Order-Book
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch the order book for |
| limit | int
| No | the maximum amount of order book entries to return |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchOrderBookWs (symbol[, limit, params])
```
### watchTradesForSymbols{docsify-ignore}
get the list of most recent trades for a list of symbols
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**
- https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams
- https://binance-docs.github.io/apidocs/spot/en/#trade-streams
- https://binance-docs.github.io/apidocs/futures/en/#aggregate-trade-streams
- https://binance-docs.github.io/apidocs/delivery/en/#aggregate-trade-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
| Yes | unified symbol of the market to fetch trades for |
| since | int
| No | timestamp in ms of the earliest trade to fetch |
| limit | int
| No | the maximum amount of trades to fetch |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.name | string
| No | the name of the method to call, 'trade' or 'aggTrade', default is 'trade' |
```javascript
binance.watchTradesForSymbols (symbols[, since, limit, params])
```
### unWatchTradesForSymbols{docsify-ignore}
unsubscribes from the trades channel
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**
- https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams
- https://binance-docs.github.io/apidocs/spot/en/#trade-streams
- https://binance-docs.github.io/apidocs/futures/en/#aggregate-trade-streams
- https://binance-docs.github.io/apidocs/delivery/en/#aggregate-trade-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
| Yes | unified symbol of the market to fetch trades for |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.name | string
| No | the name of the method to call, 'trade' or 'aggTrade', default is 'trade' |
```javascript
binance.unWatchTradesForSymbols (symbols[, params])
```
### unWatchTrades{docsify-ignore}
unsubscribes from the trades channel
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**
- https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams
- https://binance-docs.github.io/apidocs/spot/en/#trade-streams
- https://binance-docs.github.io/apidocs/futures/en/#aggregate-trade-streams
- https://binance-docs.github.io/apidocs/delivery/en/#aggregate-trade-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch trades for |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.name | string
| No | the name of the method to call, 'trade' or 'aggTrade', default is 'trade' |
```javascript
binance.unWatchTrades (symbol[, params])
```
### watchTrades{docsify-ignore}
get the list of most recent trades for a particular symbol
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**
- https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams
- https://binance-docs.github.io/apidocs/spot/en/#trade-streams
- https://binance-docs.github.io/apidocs/futures/en/#aggregate-trade-streams
- https://binance-docs.github.io/apidocs/delivery/en/#aggregate-trade-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch trades for |
| since | int
| No | timestamp in ms of the earliest trade to fetch |
| limit | int
| No | the maximum amount of trades to fetch |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.name | string
| No | the name of the method to call, 'trade' or 'aggTrade', default is 'trade' |
```javascript
binance.watchTrades (symbol[, since, limit, params])
```
### watchOHLCV{docsify-ignore}
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<Array<int>>
- A list of candles ordered as timestamp, open, high, low, close, volume
**See**
- https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
- https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data
- https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string
| Yes | the length of time each candle represents |
| since | int
| No | timestamp in ms of the earliest candle to fetch |
| limit | int
| No | the maximum amount of candles to fetch |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.timezone | object
| No | if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00' |
```javascript
binance.watchOHLCV (symbol, timeframe[, since, limit, params])
```
### watchOHLCVForSymbols{docsify-ignore}
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<Array<int>>
- A list of candles ordered as timestamp, open, high, low, close, volume
**See**
- https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
- https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data
- https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbolsAndTimeframes | Array<Array<string>>
| Yes | array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']] |
| since | int
| No | timestamp in ms of the earliest candle to fetch |
| limit | int
| No | the maximum amount of candles to fetch |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.timezone | object
| No | if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00' |
```javascript
binance.watchOHLCVForSymbols (symbolsAndTimeframes[, since, limit, params])
```
### 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 [binance
](#binance)
**Returns**: Array<Array<int>>
- A list of candles ordered as timestamp, open, high, low, close, volume
**See**
- https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
- https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data
- https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbolsAndTimeframes | Array<Array<string>>
| Yes | array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']] |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.timezone | object
| No | if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00' |
```javascript
binance.unWatchOHLCVForSymbols (symbolsAndTimeframes[, params])
```
### unWatchOHLCV{docsify-ignore}
unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<Array<int>>
- A list of candles ordered as timestamp, open, high, low, close, volume
**See**
- https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
- https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data
- https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string
| Yes | the length of time each candle represents |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.timezone | object
| No | if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00' |
```javascript
binance.unWatchOHLCV (symbol, timeframe[, params])
```
### fetchTickerWs{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 [binance
](#binance)
**Returns**: object
- a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch the ticker for |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.method | string
| No | method to use can be ticker.price or ticker.book |
| params.returnRateLimits | boolean
| No | return the rate limits for the exchange |
```javascript
binance.fetchTickerWs (symbol[, params])
```
### fetchOHLCVWs{docsify-ignore}
query historical candlestick data containing the open, high, low, and close price, and the volume of a market
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<Array<int>>
- A list of candles ordered as timestamp, open, high, low, close, volume
**See**: https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#klines
| Param | Type | Description |
| --- | --- | --- |
| symbol | string
| unified symbol of the market to query OHLCV data for |
| timeframe | string
| the length of time each candle represents |
| since | int
| timestamp in ms of the earliest candle to fetch |
| limit | int
| the maximum amount of candles to fetch |
| params | object
| extra parameters specific to the exchange API endpoint |
| params.until | int
| timestamp in ms of the earliest candle to fetch EXCHANGE SPECIFIC PARAMETERS |
| params.timeZone | string
| default=0 (UTC) |
```javascript
binance.fetchOHLCVWs (symbol, timeframe, since, limit, params[])
```
### 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 [binance
](#binance)
**Returns**: object
- a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**
- https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
- https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
- https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
- https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
- https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
- https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch the ticker for |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.name | string
| No | stream to use can be ticker or miniTicker |
```javascript
binance.watchTicker (symbol[, params])
```
### 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 [binance
](#binance)
**Returns**: object
- a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**
- https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
- https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
- https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
- https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
- https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
- https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
| Yes | unified symbol of the market to fetch the ticker for |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.watchTickers (symbols[, params])
```
### unWatchTickers{docsify-ignore}
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 method of [binance
](#binance)
**Returns**: object
- a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**
- https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
- https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
- https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
- https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
- https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
- https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
| Yes | unified symbol of the market to fetch the ticker for |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.unWatchTickers (symbols[, params])
```
### unWatchTicker{docsify-ignore}
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 method of [binance
](#binance)
**Returns**: object
- a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**
- https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
- https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
- https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
- https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
- https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
- https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch the ticker for |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.unWatchTicker (symbol[, params])
```
### watchBidsAsks{docsify-ignore}
watches best bid & ask for symbols
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#symbol-order-book-ticker
- https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
- https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
| Yes | unified symbol of the market to fetch the ticker for |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.watchBidsAsks (symbols[, params])
```
### fetchBalanceWs{docsify-ignore}
fetch balance and get the amount of funds available for trading or funds locked in orders
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [balance structure](https://docs.ccxt.com/#/?id=balance-structure)
**See**
- https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-information-user_data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.type | string
, undefined
| No | 'future', 'delivery', 'savings', 'funding', or 'spot' |
| params.marginMode | string
, undefined
| No | 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null |
| params.symbols | Array<string>
, undefined
| No | unified market symbols, only used in isolated margin mode |
| params.method | string
, undefined
| No | method to use. Can be account.balance, account.status, v2/account.balance or v2/account.status |
```javascript
binance.fetchBalanceWs ([params])
```
### fetchPositionWs{docsify-ignore}
fetch data on an open position
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [position structure](https://docs.ccxt.com/#/?id=position-structure)
**See**: https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market the position is held in |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchPositionWs (symbol[, params])
```
### fetchPositionsWs{docsify-ignore}
fetch all open positions
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [position structure](https://docs.ccxt.com/#/?id=position-structure)
**See**: https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
| No | list of unified market symbols |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.returnRateLimits | boolean
| No | set to true to return rate limit informations, defaults to false. |
| params.method | string
, undefined
| No | method to use. Can be account.position or v2/account.position |
```javascript
binance.fetchPositionsWs ([symbols, params])
```
### watchBalance{docsify-ignore}
watch balance and get the amount of funds available for trading or funds locked in orders
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- a [balance structure](https://docs.ccxt.com/#/?id=balance-structure)
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean
| No | set to true if you would like to watch the balance of a portfolio margin account |
```javascript
binance.watchBalance ([params])
```
### createOrderWs{docsify-ignore}
create a trade order
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#place-new-order-trade
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to create an order in |
| type | string
| Yes | 'market' or 'limit' |
| side | string
| Yes | 'buy' or 'sell' |
| amount | float
| Yes | how much of currency you want to trade in units of base currency |
| price | float
, undefined
| No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.test | boolean
| Yes | test order, default false |
| params.returnRateLimits | boolean
| Yes | set to true to return rate limit information, default false |
```javascript
binance.createOrderWs (symbol, type, side, amount[, price, params])
```
### editOrderWs{docsify-ignore}
edit a trade order
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-and-replace-order-trade
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | order id |
| symbol | string
| Yes | unified symbol of the market to create an order in |
| type | string
| Yes | 'market' or 'limit' |
| side | string
| Yes | 'buy' or 'sell' |
| amount | float
| Yes | how much of the currency you want to trade in units of the base currency |
| price | float
, undefined
| No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.editOrderWs (id, symbol, type, side, amount[, price, params])
```
### cancelOrderWs{docsify-ignore}
cancel multiple orders
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- an list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-order-trade
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | order id |
| symbol | string
| Yes | unified market symbol, default is undefined |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.cancelRestrictions | string
, undefined
| No | Supported values: ONLY_NEW - Cancel will succeed if the order status is NEW. ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED. |
```javascript
binance.cancelOrderWs (id, symbol[, params])
```
### cancelAllOrdersWs{docsify-ignore}
cancel all open orders in a market
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-open-orders-trade
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market to cancel orders in |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.cancelAllOrdersWs (symbol[, params])
```
### fetchOrderWs{docsify-ignore}
fetches information on an order made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: object
- An [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-order-user_data
- https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order
| Param | Type | Description |
| --- | --- | --- |
| symbol | string
| unified symbol of the market the order was made in |
| params | object
| extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchOrderWs (symbol, params[])
```
### fetchOrdersWs{docsify-ignore}
fetches information on multiple orders made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-order-list-user_data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market orders were made in |
| since | int
, undefined
| No | the earliest time in ms to fetch orders for |
| limit | int
, undefined
| No | the maximum number of order structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.orderId | int
| No | order id to begin at |
| params.startTime | int
| No | earliest time in ms to retrieve orders for |
| params.endTime | int
| No | latest time in ms to retrieve orders for |
| params.limit | int
| No | the maximum number of order structures to retrieve |
```javascript
binance.fetchOrdersWs (symbol[, since, limit, params])
```
### fetchClosedOrdersWs{docsify-ignore}
fetch closed orders
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-order-list-user_data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| since | int
| No | the earliest time in ms to fetch open orders for |
| limit | int
| No | the maximum number of open orders structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchClosedOrdersWs (symbol[, since, limit, params])
```
### fetchOpenOrdersWs{docsify-ignore}
fetch all unfilled currently open orders
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#current-open-orders-user_data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| since | int
, undefined
| No | the earliest time in ms to fetch open orders for |
| limit | int
, undefined
| No | the maximum number of open orders structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
binance.fetchOpenOrdersWs (symbol[, since, limit, params])
```
### watchOrders{docsify-ignore}
watches information on multiple orders made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream#order-update
- https://developers.binance.com/docs/margin_trading/trade-data-stream/Event-Order-Update
- https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market the orders were made in |
| since | int
| No | the earliest time in ms to fetch orders for |
| limit | int
| No | the maximum number of order structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string
, undefined
| No | 'cross' or 'isolated', for spot margin |
| params.portfolioMargin | boolean
| No | set to true if you would like to watch portfolio margin account orders |
```javascript
binance.watchOrders (symbol[, since, limit, params])
```
### watchPositions{docsify-ignore}
watch all open positions
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [position structure](https://docs.ccxt.com/en/latest/manual.html#position-structure)
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbols | Array<string>
, undefined
| Yes | list of unified market symbols |
| params | object
| Yes | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean
| No | set to true if you would like to watch positions in a portfolio margin account |
```javascript
binance.watchPositions (symbols, params[])
```
### fetchMyTradesWs{docsify-ignore}
fetch all trades made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure)
**See**: https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-trade-history-user_data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| since | int
, undefined
| No | the earliest time in ms to fetch trades for |
| limit | int
, undefined
| No | the maximum number of trades structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.endTime | int
| No | the latest time in ms to fetch trades for |
| params.fromId | int
| No | first trade Id to fetch |
```javascript
binance.fetchMyTradesWs (symbol[, since, limit, params])
```
### fetchTradesWs{docsify-ignore}
fetch all trades made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure)
**See**: https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#recent-trades
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol |
| since | int
| No | the earliest time in ms to fetch trades for |
| limit | int
| No | the maximum number of trades structures to retrieve, default=500, max=1000 |
| params | object
| No | extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.fromId | int
| No | trade ID to begin at |
```javascript
binance.fetchTradesWs (symbol[, since, limit, params])
```
### watchMyTrades{docsify-ignore}
watches information on multiple trades made by the user
**Kind**: instance method of [binance
](#binance)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure)
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market orders were made in |
| since | int
| No | the earliest time in ms to fetch orders for |
| limit | int
| No | the maximum number of order structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | boolean
| No | set to true if you would like to watch trades in a portfolio margin account |
```javascript
binance.watchMyTrades (symbol[, since, limit, params])
```