wiki/exchanges/blofin.md
<a name="blofin" id="blofin"></a>
Kind: global class
Extends: <code>Exchange</code>
<a name="fetchMarkets" id="fetchmarkets"></a>
retrieves data on all markets for blofin
Kind: instance method of <code>blofin</code>
Returns: <code>Array<object></code> - an array of objects representing market data
See: https://blofin.com/docs#get-instruments
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.fetchMarkets ([params])
<a name="fetchOrderBook" id="fetchorderbook"></a>
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See: https://blofin.com/docs#get-order-book
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.fetchOrderBook (symbol[, limit, params])
<a name="fetchTicker" id="fetchticker"></a>
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a ticker structure
See: https://blofin.com/docs#get-tickers
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.fetchTicker (symbol[, params])
<a name="fetchMarkPrice" id="fetchmarkprice"></a>
fetches mark price for the market
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a dictionary of ticker structures
See: https://docs.blofin.com/index.html#get-mark-price
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
blofin.fetchMarkPrice (symbol[, params])
<a name="fetchTickers" id="fetchtickers"></a>
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a dictionary of ticker structures
See: https://blofin.com/docs#get-tickers
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.fetchTickers ([symbols, params])
<a name="fetchTrades" id="fetchtrades"></a>
get the list of most recent trades for a particular symbol
Kind: instance method of <code>blofin</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See: https://blofin.com/docs#get-trades
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | only applies to publicGetMarketHistoryTrades default false, when true will automatically paginate by calling this endpoint multiple times |
blofin.fetchTrades (symbol[, since, limit, params])
<a name="fetchOHLCV" id="fetchohlcv"></a>
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>blofin</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://blofin.com/docs#get-candlesticks
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest candle to fetch |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
blofin.fetchOHLCV (symbol, timeframe[, since, limit, params])
<a name="fetchFundingRateHistory" id="fetchfundingratehistory"></a>
fetches historical funding rate prices
Kind: instance method of <code>blofin</code>
Returns: <code>Array<object></code> - a list of funding rate structures
See: https://blofin.com/docs#get-funding-rate-history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the funding rate history for |
| since | <code>int</code> | No | timestamp in ms of the earliest funding rate to fetch |
| limit | <code>int</code> | No | the maximum amount of funding rate structures to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
| params.until | <code>int</code> | No | timestamp in ms of the latest funding rate to fetch |
blofin.fetchFundingRateHistory (symbol[, since, limit, params])
<a name="fetchFundingRate" id="fetchfundingrate"></a>
fetch the current funding rate
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a funding rate structure
See: https://blofin.com/docs#get-funding-rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.fetchFundingRate (symbol[, params])
<a name="fetchBalance" id="fetchbalance"></a>
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a balance structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.accountType | <code>string</code> | No | the type of account to fetch the balance for, either 'funding' or 'futures' or 'copy_trading' or 'earn' |
blofin.fetchBalance ([params])
<a name="createOrder" id="createorder"></a>
create a trade order
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' or 'post_only' or 'ioc' or 'fok' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of currency you want to trade in units of base currency |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.triggerPrice | <code>string</code> | No | the trigger price for a trigger order |
| params.reduceOnly | <code>bool</code> | No | a mark to reduce the position size for margin, swap and future orders |
| params.postOnly | <code>bool</code> | No | true to place a post only order |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', default is 'cross' |
| params.stopLossPrice | <code>float</code> | No | stop loss trigger price (will use privatePostTradeOrderTpsl) |
| params.takeProfitPrice | <code>float</code> | No | take profit trigger price (will use privatePostTradeOrderTpsl) |
| params.positionSide | <code>string</code> | No | stopLossPrice/takeProfitPrice orders only 'long' or 'short' or 'net' default is 'net' |
| params.hedged | <code>boolean</code> | No | if true, the positionSide will be set to long/short instead of net, default is false |
| params.clientOrderId | <code>string</code> | No | a unique id for the order |
| params.takeProfit | <code>object</code> | No | takeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered |
| params.takeProfit.triggerPrice | <code>float</code> | No | take profit trigger price |
| params.takeProfit.price | <code>float</code> | No | take profit order price (if not provided the order will be a market order) |
| params.stopLoss | <code>object</code> | No | stopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered |
| params.stopLoss.triggerPrice | <code>float</code> | No | stop loss trigger price |
| params.stopLoss.price | <code>float</code> | No | stop loss order price (if not provided the order will be a market order) |
blofin.createOrder (symbol, type, side, amount[, price, params])
<a name="cancelOrder" id="cancelorder"></a>
cancels an open order
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - An order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>boolean</code> | No | True if cancelling a trigger/conditional |
| params.tpsl | <code>boolean</code> | No | True if cancelling a tpsl order |
blofin.cancelOrder (id, symbol[, params])
<a name="createOrders" id="createorders"></a>
create a list of trade orders
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - an order structure
See: https://blofin.com/docs#place-multiple-orders
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.createOrders (orders[, params])
<a name="fetchOpenOrders" id="fetchopenorders"></a>
Fetch orders that are still open
Kind: instance method of <code>blofin</code>
Returns: <code>Array<Order></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch open orders for |
| limit | <code>int</code> | No | the maximum number of open orders structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>bool</code> | No | True if fetching trigger or conditional orders |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
blofin.fetchOpenOrders (symbol[, since, limit, params])
<a name="fetchMyTrades" id="fetchmytrades"></a>
fetch all trades made by the user
Kind: instance method of <code>blofin</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See: https://blofin.com/docs#get-trade-history
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | Timestamp in ms of the latest time to retrieve trades for |
| params.type | <code>string</code> | No | 'swap' or 'spot' (defaults to 'swap'), required to fetch spot trade history |
| params.instId | <code>string</code> | No | spot markets only the market id of the spot market to fetch the trade history for (e.g. 'BTC-USDT') |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
blofin.fetchMyTrades (symbol[, since, limit, params])
<a name="fetchDeposits" id="fetchdeposits"></a>
fetch all deposits made to an account
Kind: instance method of <code>blofin</code>
Returns: <code>Array<object></code> - a list of transaction structures
See: https://blofin.com/docs#get-deposite-history
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch deposits for |
| limit | <code>int</code> | No | the maximum number of deposits structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
blofin.fetchDeposits (code[, since, limit, params])
<a name="fetchWithdrawals" id="fetchwithdrawals"></a>
fetch all withdrawals made from an account
Kind: instance method of <code>blofin</code>
Returns: <code>Array<object></code> - a list of transaction structures
See: https://blofin.com/docs#get-withdraw-history
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch withdrawals for |
| limit | <code>int</code> | No | the maximum number of withdrawals structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
blofin.fetchWithdrawals (code[, since, limit, params])
<a name="fetchLedger" id="fetchledger"></a>
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a ledger structure
See: https://blofin.com/docs#get-funds-transfer-history
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code, default is undefined |
| since | <code>int</code> | No | timestamp in ms of the earliest ledger entry, default is undefined |
| limit | <code>int</code> | No | max number of ledger entries to return, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
blofin.fetchLedger ([code, since, limit, params])
<a name="cancelOrders" id="cancelorders"></a>
cancel multiple orders
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - an list of order structures
See: https://blofin.com/docs#cancel-multiple-orders
| Param | Type | Required | Description |
|---|---|---|---|
| ids | <code>Array<string></code> | Yes | order ids |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>boolean</code> | No | whether the order is a stop/trigger order |
blofin.cancelOrders (ids, symbol[, params])
<a name="transfer" id="transfer"></a>
transfer currency internally between wallets on the same account
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a transfer structure
See: https://blofin.com/docs#funds-transfer
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | amount to transfer |
| fromAccount | <code>string</code> | Yes | account to transfer from (funding, swap, copy_trading, earn) |
| toAccount | <code>string</code> | Yes | account to transfer to (funding, swap, copy_trading, earn) |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.transfer (code, amount, fromAccount, toAccount[, params])
<a name="fetchPosition" id="fetchposition"></a>
fetch data on a single open contract trade position
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a position structure
See: https://blofin.com/docs#get-positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the position is held in, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.instType | <code>string</code> | No | MARGIN, SWAP, FUTURES, OPTION |
blofin.fetchPosition (symbol[, params])
<a name="fetchPositions" id="fetchpositions"></a>
fetch data on a single open contract trade position
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a position structure
See: https://blofin.com/docs#get-positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.instType | <code>string</code> | No | MARGIN, SWAP, FUTURES, OPTION |
blofin.fetchPositions ([symbols, params])
<a name="fetchLeverages" id="fetchleverages"></a>
fetch the set leverage for all contract markets
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a list of leverage structures
See: https://docs.blofin.com/index.html#get-multiple-leverage
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | a list of unified market symbols, required on blofin |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' |
blofin.fetchLeverages (symbols[, params])
<a name="fetchLeverage" id="fetchleverage"></a>
fetch the set leverage for a market
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a leverage structure
See: https://docs.blofin.com/index.html#get-leverage
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' |
blofin.fetchLeverage (symbol[, params])
<a name="setLeverage" id="setleverage"></a>
set the level of leverage for a market
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - response from the exchange
See: https://blofin.com/docs#set-leverage
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | <code>int</code> | Yes | the rate of leverage |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated' |
| params.positionSide | <code>string</code> | No | 'long' or 'short' - required for hedged mode in isolated margin |
blofin.setLeverage (leverage, symbol[, params])
<a name="closePosition" id="closeposition"></a>
closes open positions for a market
Kind: instance method of <code>blofin</code>
Returns: <code>Array<object></code> - A list of position structures
See: https://blofin.com/docs#close-positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| side | <code>string</code> | No | 'buy' or 'sell', leave as undefined in net mode |
| params | <code>object</code> | No | extra parameters specific to the blofin api endpoint |
| params.clientOrderId | <code>string</code> | No | a unique identifier for the order |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', default is 'cross; |
| params.code | <code>string</code> | No | required in the case of closing cross MARGIN position for Single-currency margin margin currency EXCHANGE SPECIFIC PARAMETERS |
| params.autoCxl | <code>boolean</code> | No | whether any pending orders for closing out needs to be automatically canceled when close position via a market order. false or true, the default is false |
| params.tag | <code>string</code> | No | order tag a combination of case-sensitive alphanumerics, all numbers, or all letters of up to 16 characters |
blofin.closePosition (symbol[, side, params])
<a name="fetchClosedOrders" id="fetchclosedorders"></a>
fetches information on multiple closed orders made by the user
Kind: instance method of <code>blofin</code>
Returns: <code>Array<Order></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of orde structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>bool</code> | No | True if fetching trigger or conditional orders |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
blofin.fetchClosedOrders (symbol[, since, limit, params])
<a name="fetchMarginMode" id="fetchmarginmode"></a>
fetches the margin mode of a trading pair
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a margin mode structure
See: https://docs.blofin.com/index.html#get-margin-mode
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the margin mode for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.fetchMarginMode (symbol[, params])
<a name="setMarginMode" id="setmarginmode"></a>
set margin mode to 'cross' or 'isolated'
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - response from the exchange
See: https://docs.blofin.com/index.html#set-margin-mode
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | <code>string</code> | Yes | 'cross' or 'isolated' |
| symbol | <code>string</code> | No | unified market symbol (not used in blofin setMarginMode) |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.setMarginMode (marginMode[, symbol, params])
<a name="fetchPositionMode" id="fetchpositionmode"></a>
fetchs the position mode, hedged or one way
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - an object detailing whether the market is in hedged or one-way mode
See: https://docs.blofin.com/index.html#get-position-mode
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified symbol of the market to fetch the position mode for (not used in blofin fetchPositionMode) |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.fetchPositionMode ([symbol, params])
<a name="setPositionMode" id="setpositionmode"></a>
set hedged to true or false for a market
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - response from the exchange
See: https://docs.blofin.com/index.html#set-position-mode
| Param | Type | Required | Description |
|---|---|---|---|
| hedged | <code>bool</code> | Yes | set to true to use hedged mode, false for one-way mode |
| symbol | <code>string</code> | No | not used by blofin setPositionMode () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.setPositionMode (hedged[, symbol, params])
<a name="fetchPositionsADLRank" id="fetchpositionsadlrank"></a>
fetches the auto deleveraging rank and risk percentage for a list of symbols
Kind: instance method of <code>blofin</code>
Returns: <code>Array<object></code> - an array of auto de leverage structures
See: https://docs.blofin.com/index.html#get-positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | a list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.fetchPositionsADLRank ([symbols, params])
<a name="watchTrades" id="watchtrades"></a>
get the list of most recent trades for a particular symbol
Kind: instance method of <code>blofin</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://docs.blofin.com/index.html#ws-trades-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.watchTrades (symbol[, since, limit, params])
<a name="watchTradesForSymbols" id="watchtradesforsymbols"></a>
get the list of most recent trades for a list of symbols
Kind: instance method of <code>blofin</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://docs.blofin.com/index.html#ws-trades-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.watchTradesForSymbols (symbols[, since, limit, params])
<a name="watchOrderBook" id="watchorderbook"></a>
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See: https://docs.blofin.com/index.html#ws-order-book-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.watchOrderBook (symbol[, limit, params])
<a name="watchOrderBookForSymbols" id="watchorderbookforsymbols"></a>
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See: https://docs.blofin.com/index.html#ws-order-book-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified array of symbols |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.depth | <code>string</code> | No | the type of order book to subscribe to, default is 'depth/increase100', also accepts 'depth5' or 'depth20' or depth50 |
blofin.watchOrderBookForSymbols (symbols[, limit, params])
<a name="watchTicker" id="watchticker"></a>
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a ticker structure
See: https://docs.blofin.com/index.html#ws-tickers-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.watchTicker (symbol[, params])
<a name="watchTickers" id="watchtickers"></a>
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a ticker structure
See: https://docs.blofin.com/index.html#ws-tickers-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.watchTickers (symbols[, params])
<a name="watchBidsAsks" id="watchbidsasks"></a>
watches best bid & ask for symbols
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a ticker structure
See: https://docs.blofin.com/index.html#ws-tickers-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.watchBidsAsks (symbols[, params])
<a name="watchOHLCV" id="watchohlcv"></a>
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>blofin</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.watchOHLCV (symbol, timeframe[, since, limit, params])
<a name="watchOHLCVForSymbols" id="watchohlcvforsymbols"></a>
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>blofin</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://docs.blofin.com/index.html#ws-candlesticks-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbolsAndTimeframes | <code>Array<Array<string>></code> | Yes | array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']] |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.watchOHLCVForSymbols (symbolsAndTimeframes[, since, limit, params])
<a name="watchBalance" id="watchbalance"></a>
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a balance structure
See: https://docs.blofin.com/index.html#ws-account-channel
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.watchBalance ([params])
<a name="watchOrdersForSymbols" id="watchordersforsymbols"></a>
watches information on multiple orders made by the user across multiple symbols
Kind: instance method of <code>blofin</code>
Returns: <code>Array<object></code> - a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>boolean</code> | No | set to true for trigger orders |
blofin.watchOrdersForSymbols (symbols[, since, limit, params])
<a name="watchPositions" id="watchpositions"></a>
watch all open positions
Kind: instance method of <code>blofin</code>
Returns: <code>Array<object></code> - a list of position structure
See: https://docs.blofin.com/index.html#ws-positions-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| since | <code>int</code> | No | the earliest time in ms to fetch positions for |
| limit | <code>int</code> | No | the maximum number of positions to retrieve |
| params | <code>object</code> | Yes | extra parameters specific to the exchange API endpoint |
blofin.watchPositions (symbols[, since, limit, params])
<a name="watchFundingRate" id="watchfundingrate"></a>
watch the current funding rate
Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a funding rate structure
See: https://docs.blofin.com/index.html#ws-funding-rate-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
blofin.watchFundingRate (symbol[, params])