Back to Ccxt

Blofin

wiki/exchanges/blofin.md

4.5.5243.7 KB
Original Source

<a name="blofin" id="blofin"></a>

blofin{docsify-ignore}

Kind: global class
Extends: <code>Exchange</code>

<a name="fetchMarkets" id="fetchmarkets"></a>

fetchMarkets{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.fetchMarkets ([params])

<a name="fetchOrderBook" id="fetchorderbook"></a>

fetchOrderBook{docsify-ignore}

fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols

See: https://blofin.com/docs#get-order-book

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.fetchOrderBook (symbol[, limit, params])

<a name="fetchTicker" id="fetchticker"></a>

fetchTicker{docsify-ignore}

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a ticker structure

See: https://blofin.com/docs#get-tickers

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.fetchTicker (symbol[, params])

<a name="fetchMarkPrice" id="fetchmarkprice"></a>

fetchMarkPrice{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
blofin.fetchMarkPrice (symbol[, params])

<a name="fetchTickers" id="fetchtickers"></a>

fetchTickers{docsify-ignore}

fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market

Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a dictionary of ticker structures

See: https://blofin.com/docs#get-tickers

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nounified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.fetchTickers ([symbols, params])

<a name="fetchTrades" id="fetchtrades"></a>

fetchTrades{docsify-ignore}

get the list of most recent trades for a particular symbol

Kind: instance method of <code>blofin</code>
Returns: <code>Array<Trade></code> - a list of trade structures

See: https://blofin.com/docs#get-trades

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Noonly applies to publicGetMarketHistoryTrades default false, when true will automatically paginate by calling this endpoint multiple times
javascript
blofin.fetchTrades (symbol[, since, limit, params])

<a name="fetchOHLCV" id="fetchohlcv"></a>

fetchOHLCV{docsify-ignore}

fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of <code>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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch OHLCV data for
timeframe<code>string</code>Yesthe length of time each candle represents
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Notimestamp in ms of the latest candle to fetch
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
blofin.fetchOHLCV (symbol, timeframe[, since, limit, params])

<a name="fetchFundingRateHistory" id="fetchfundingratehistory"></a>

fetchFundingRateHistory{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the funding rate history for
since<code>int</code>Notimestamp in ms of the earliest funding rate to fetch
limit<code>int</code>Nothe maximum amount of funding rate structures to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Nodefault 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>Notimestamp in ms of the latest funding rate to fetch
javascript
blofin.fetchFundingRateHistory (symbol[, since, limit, params])

<a name="fetchFundingRate" id="fetchfundingrate"></a>

fetchFundingRate{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.fetchFundingRate (symbol[, params])

<a name="fetchBalance" id="fetchbalance"></a>

fetchBalance{docsify-ignore}

query for balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a balance structure

See

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.accountType<code>string</code>Nothe type of account to fetch the balance for, either 'funding' or 'futures' or 'copy_trading' or 'earn'
javascript
blofin.fetchBalance ([params])

<a name="createOrder" id="createorder"></a>

createOrder{docsify-ignore}

create a trade order

Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - an order structure

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified 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>Yeshow much of currency you want to trade in units of base currency
price<code>float</code>Nothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.triggerPrice<code>string</code>Nothe trigger price for a trigger order
params.reduceOnly<code>bool</code>Noa mark to reduce the position size for margin, swap and future orders
params.postOnly<code>bool</code>Notrue to place a post only order
params.marginMode<code>string</code>No'cross' or 'isolated', default is 'cross'
params.stopLossPrice<code>float</code>Nostop loss trigger price (will use privatePostTradeOrderTpsl)
params.takeProfitPrice<code>float</code>Notake profit trigger price (will use privatePostTradeOrderTpsl)
params.positionSide<code>string</code>NostopLossPrice/takeProfitPrice orders only 'long' or 'short' or 'net' default is 'net'
params.hedged<code>boolean</code>Noif true, the positionSide will be set to long/short instead of net, default is false
params.clientOrderId<code>string</code>Noa unique id for the order
params.takeProfit<code>object</code>NotakeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered
params.takeProfit.triggerPrice<code>float</code>Notake profit trigger price
params.takeProfit.price<code>float</code>Notake profit order price (if not provided the order will be a market order)
params.stopLoss<code>object</code>NostopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered
params.stopLoss.triggerPrice<code>float</code>Nostop loss trigger price
params.stopLoss.price<code>float</code>Nostop loss order price (if not provided the order will be a market order)
javascript
blofin.createOrder (symbol, type, side, amount[, price, params])

<a name="cancelOrder" id="cancelorder"></a>

cancelOrder{docsify-ignore}

cancels an open order

Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - An order structure

See

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesunified symbol of the market the order was made in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.trigger<code>boolean</code>NoTrue if cancelling a trigger/conditional
params.tpsl<code>boolean</code>NoTrue if cancelling a tpsl order
javascript
blofin.cancelOrder (id, symbol[, params])

<a name="createOrders" id="createorders"></a>

createOrders{docsify-ignore}

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

ParamTypeRequiredDescription
orders<code>Array</code>Yeslist 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>Noextra parameters specific to the exchange API endpoint
javascript
blofin.createOrders (orders[, params])

<a name="fetchOpenOrders" id="fetchopenorders"></a>

fetchOpenOrders{docsify-ignore}

Fetch orders that are still open

Kind: instance method of <code>blofin</code>
Returns: <code>Array<Order></code> - a list of order structures

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch open orders for
limit<code>int</code>Nothe maximum number of open orders structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.trigger<code>bool</code>NoTrue if fetching trigger or conditional orders
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
blofin.fetchOpenOrders (symbol[, since, limit, params])

<a name="fetchMyTrades" id="fetchmytrades"></a>

fetchMyTrades{docsify-ignore}

fetch all trades made by the user

Kind: instance method of <code>blofin</code>
Returns: <code>Array<Trade></code> - a list of trade structures

See: https://blofin.com/docs#get-trade-history

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch trades for
limit<code>int</code>Nothe maximum number of trades structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>NoTimestamp 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>Nospot markets only the market id of the spot market to fetch the trade history for (e.g. 'BTC-USDT')
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
blofin.fetchMyTrades (symbol[, since, limit, params])

<a name="fetchDeposits" id="fetchdeposits"></a>

fetchDeposits{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
since<code>int</code>Nothe earliest time in ms to fetch deposits for
limit<code>int</code>Nothe maximum number of deposits structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Nothe latest time in ms to fetch entries for
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
blofin.fetchDeposits (code[, since, limit, params])

<a name="fetchWithdrawals" id="fetchwithdrawals"></a>

fetchWithdrawals{docsify-ignore}

fetch all withdrawals made from an account

Kind: instance method of <code>blofin</code>
Returns: <code>Array<object></code> - a list of transaction structures

See: https://blofin.com/docs#get-withdraw-history

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
since<code>int</code>Nothe earliest time in ms to fetch withdrawals for
limit<code>int</code>Nothe maximum number of withdrawals structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Nothe latest time in ms to fetch entries for
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
blofin.fetchWithdrawals (code[, since, limit, params])

<a name="fetchLedger" id="fetchledger"></a>

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 <code>blofin</code>
Returns: <code>object</code> - a ledger structure

See: https://blofin.com/docs#get-funds-transfer-history

ParamTypeRequiredDescription
code<code>string</code>Nounified currency code, default is undefined
since<code>int</code>Notimestamp in ms of the earliest ledger entry, default is undefined
limit<code>int</code>Nomax number of ledger entries to return, default is undefined
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.marginMode<code>string</code>No'cross' or 'isolated'
params.until<code>int</code>Nothe latest time in ms to fetch entries for
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
javascript
blofin.fetchLedger ([code, since, limit, params])

<a name="cancelOrders" id="cancelorders"></a>

cancelOrders{docsify-ignore}

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

ParamTypeRequiredDescription
ids<code>Array<string></code>Yesorder ids
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.trigger<code>boolean</code>Nowhether the order is a stop/trigger order
javascript
blofin.cancelOrders (ids, symbol[, params])

<a name="transfer" id="transfer"></a>

transfer{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
amount<code>float</code>Yesamount to transfer
fromAccount<code>string</code>Yesaccount to transfer from (funding, swap, copy_trading, earn)
toAccount<code>string</code>Yesaccount to transfer to (funding, swap, copy_trading, earn)
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.transfer (code, amount, fromAccount, toAccount[, params])

<a name="fetchPosition" id="fetchposition"></a>

fetchPosition{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market the position is held in, default is undefined
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.instType<code>string</code>NoMARGIN, SWAP, FUTURES, OPTION
javascript
blofin.fetchPosition (symbol[, params])

<a name="fetchPositions" id="fetchpositions"></a>

fetchPositions{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nolist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.instType<code>string</code>NoMARGIN, SWAP, FUTURES, OPTION
javascript
blofin.fetchPositions ([symbols, params])

<a name="fetchLeverages" id="fetchleverages"></a>

fetchLeverages{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesa list of unified market symbols, required on blofin
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.marginMode<code>string</code>No'cross' or 'isolated'
javascript
blofin.fetchLeverages (symbols[, params])

<a name="fetchLeverage" id="fetchleverage"></a>

fetchLeverage{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.marginMode<code>string</code>No'cross' or 'isolated'
javascript
blofin.fetchLeverage (symbol[, params])

<a name="setLeverage" id="setleverage"></a>

setLeverage{docsify-ignore}

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

ParamTypeRequiredDescription
leverage<code>int</code>Yesthe rate of leverage
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra 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
javascript
blofin.setLeverage (leverage, symbol[, params])

<a name="closePosition" id="closeposition"></a>

closePosition{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>YesUnified CCXT market symbol
side<code>string</code>No'buy' or 'sell', leave as undefined in net mode
params<code>object</code>Noextra parameters specific to the blofin api endpoint
params.clientOrderId<code>string</code>Noa unique identifier for the order
params.marginMode<code>string</code>No'cross' or 'isolated', default is 'cross;
params.code<code>string</code>Norequired in the case of closing cross MARGIN position for Single-currency margin margin currency EXCHANGE SPECIFIC PARAMETERS
params.autoCxl<code>boolean</code>Nowhether 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>Noorder tag a combination of case-sensitive alphanumerics, all numbers, or all letters of up to 16 characters
javascript
blofin.closePosition (symbol[, side, params])

<a name="fetchClosedOrders" id="fetchclosedorders"></a>

fetchClosedOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of orde structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.trigger<code>bool</code>NoTrue if fetching trigger or conditional orders
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
blofin.fetchClosedOrders (symbol[, since, limit, params])

<a name="fetchMarginMode" id="fetchmarginmode"></a>

fetchMarginMode{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the margin mode for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.fetchMarginMode (symbol[, params])

<a name="setMarginMode" id="setmarginmode"></a>

setMarginMode{docsify-ignore}

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

ParamTypeRequiredDescription
marginMode<code>string</code>Yes'cross' or 'isolated'
symbol<code>string</code>Nounified market symbol (not used in blofin setMarginMode)
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.setMarginMode (marginMode[, symbol, params])

<a name="fetchPositionMode" id="fetchpositionmode"></a>

fetchPositionMode{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Nounified symbol of the market to fetch the position mode for (not used in blofin fetchPositionMode)
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.fetchPositionMode ([symbol, params])

<a name="setPositionMode" id="setpositionmode"></a>

setPositionMode{docsify-ignore}

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

ParamTypeRequiredDescription
hedged<code>bool</code>Yesset to true to use hedged mode, false for one-way mode
symbol<code>string</code>Nonot used by blofin setPositionMode ()
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.setPositionMode (hedged[, symbol, params])

<a name="fetchPositionsADLRank" id="fetchpositionsadlrank"></a>

fetchPositionsADLRank{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Noa list of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.fetchPositionsADLRank ([symbols, params])

<a name="watchTrades" id="watchtrades"></a>

watchTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.watchTrades (symbol[, since, limit, params])

<a name="watchTradesForSymbols" id="watchtradesforsymbols"></a>

watchTradesForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.watchTradesForSymbols (symbols[, since, limit, params])

<a name="watchOrderBook" id="watchorderbook"></a>

watchOrderBook{docsify-ignore}

watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of <code>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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.watchOrderBook (symbol[, limit, params])

<a name="watchOrderBookForSymbols" id="watchorderbookforsymbols"></a>

watchOrderBookForSymbols{docsify-ignore}

watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of <code>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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified array of symbols
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.depth<code>string</code>Nothe type of order book to subscribe to, default is 'depth/increase100', also accepts 'depth5' or 'depth20' or depth50
javascript
blofin.watchOrderBookForSymbols (symbols[, limit, params])

<a name="watchTicker" id="watchticker"></a>

watchTicker{docsify-ignore}

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a ticker structure

See: https://docs.blofin.com/index.html#ws-tickers-channel

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.watchTicker (symbol[, params])

<a name="watchTickers" id="watchtickers"></a>

watchTickers{docsify-ignore}

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

Kind: instance method of <code>blofin</code>
Returns: <code>object</code> - a ticker structure

See: https://docs.blofin.com/index.html#ws-tickers-channel

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.watchTickers (symbols[, params])

<a name="watchBidsAsks" id="watchbidsasks"></a>

watchBidsAsks{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.watchBidsAsks (symbols[, params])

<a name="watchOHLCV" id="watchohlcv"></a>

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 <code>blofin</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch OHLCV data for
timeframe<code>string</code>Yesthe length of time each candle represents
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.watchOHLCV (symbol, timeframe[, since, limit, params])

<a name="watchOHLCVForSymbols" id="watchohlcvforsymbols"></a>

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 <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

ParamTypeRequiredDescription
symbolsAndTimeframes<code>Array<Array<string>></code>Yesarray of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.watchOHLCVForSymbols (symbolsAndTimeframes[, since, limit, params])

<a name="watchBalance" id="watchbalance"></a>

watchBalance{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.watchBalance ([params])

<a name="watchOrdersForSymbols" id="watchordersforsymbols"></a>

watchOrdersForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yes
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.trigger<code>boolean</code>Noset to true for trigger orders
javascript
blofin.watchOrdersForSymbols (symbols[, since, limit, params])

<a name="watchPositions" id="watchpositions"></a>

watchPositions{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yeslist of unified market symbols
since<code>int</code>Nothe earliest time in ms to fetch positions for
limit<code>int</code>Nothe maximum number of positions to retrieve
params<code>object</code>Yesextra parameters specific to the exchange API endpoint
javascript
blofin.watchPositions (symbols[, since, limit, params])

<a name="watchFundingRate" id="watchfundingrate"></a>

watchFundingRate{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
blofin.watchFundingRate (symbol[, params])