blofin
blofin cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.
blofin
Kind: global class
Extends: Exchange
- fetchMarkets
- fetchOrderBook
- fetchTicker
- fetchMarkPrice
- fetchTickers
- fetchTrades
- fetchOHLCV
- fetchFundingRateHistory
- fetchFundingRate
- fetchBalance
- createOrder
- cancelOrder
- createOrders
- fetchOpenOrders
- fetchMyTrades
- fetchDeposits
- fetchWithdrawals
- fetchLedger
- cancelOrders
- transfer
- fetchPosition
- fetchPositions
- fetchPositionsHistory
- fetchLeverages
- fetchLeverage
- setLeverage
- closePosition
- fetchClosedOrders
- fetchMarginMode
- setMarginMode
- fetchPositionMode
- setPositionMode
- fetchPositionsADLRank
- watchTrades
- watchTradesForSymbols
- watchOrderBook
- watchOrderBookForSymbols
- watchTicker
- watchTickers
- watchBidsAsks
- watchOHLCV
- watchOHLCVForSymbols
- watchBalance
- watchOrdersForSymbols
- watchPositions
- watchFundingRate
fetchMarkets
retrieves data on all markets for blofin
Kind: instance method of blofin
Returns: Array<object> - an array of objects representing market data
See: https://blofin.com/docs#get-instruments
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
blofin.fetchMarkets (params?)fetchOrderBook
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of blofin
Returns: object - A dictionary of order book structures indexed by market symbols
See: https://blofin.com/docs#get-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 |
blofin.fetchOrderBook (symbol, limit?, params?)fetchTicker
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of blofin
Returns: object - a ticker structure
See: https://blofin.com/docs#get-tickers
| 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 |
blofin.fetchTicker (symbol, params?)fetchMarkPrice
fetches mark price for the market
Kind: instance method of blofin
Returns: object - a dictionary of ticker structures
See: https://docs.blofin.com/index.html#get-mark-price
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subType | string | No | "linear" or "inverse" |
blofin.fetchMarkPrice (symbol, params?)fetchTickers
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of blofin
Returns: object - a dictionary of ticker structures
See: https://blofin.com/docs#get-tickers
| 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 |
blofin.fetchTickers (symbols?, params?)fetchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of blofin
Returns: Array<Trade> - a list of trade structures
See: https://blofin.com/docs#get-trades
| 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.paginate | boolean | No | only applies to publicGetMarketHistoryTrades default false, when true will automatically paginate by calling this endpoint multiple times |
blofin.fetchTrades (symbol, since?, limit?, params?)fetchOHLCV
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of blofin
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://blofin.com/docs#get-candlesticks
| 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.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 availble parameters |
blofin.fetchOHLCV (symbol, timeframe, since?, limit?, params?)fetchFundingRateHistory
fetches historical funding rate prices
Kind: instance method of blofin
Returns: Array<object> - a list of funding rate structures
See: https://blofin.com/docs#get-funding-rate-history
| 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 to fetch |
| 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 availble parameters |
| params.until | int | No | timestamp in ms of the latest funding rate to fetch |
blofin.fetchFundingRateHistory (symbol, since?, limit?, params?)fetchFundingRate
fetch the current funding rate
Kind: instance method of blofin
Returns: object - a funding rate structure
See: https://blofin.com/docs#get-funding-rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
blofin.fetchFundingRate (symbol, params?)fetchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of blofin
Returns: object - a balance structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.accountType | string | No | the type of account to fetch the balance for, either 'funding' or 'futures' or 'copy_trading' or 'earn' |
blofin.fetchBalance (params?)createOrder
create a trade order
Kind: instance method of blofin
Returns: object - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' or 'post_only' or 'ioc' or 'fok' |
| 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 |
| params.triggerPrice | string | No | the trigger price for a trigger order |
| params.reduceOnly | bool | No | a mark to reduce the position size for margin, swap and future orders |
| params.postOnly | bool | No | true to place a post only order |
| params.marginMode | string | No | 'cross' or 'isolated', default is 'cross' |
| params.stopLossPrice | float | No | stop loss trigger price (will use privatePostTradeOrderTpsl) |
| params.takeProfitPrice | float | No | take profit trigger price (will use privatePostTradeOrderTpsl) |
| params.positionSide | string | No | stopLossPrice/takeProfitPrice orders only 'long' or 'short' or 'net' default is 'net' |
| params.hedged | boolean | No | if true, the positionSide will be set to long/short instead of net, default is false |
| params.clientOrderId | string | No | a unique id for the order |
| params.takeProfit | object | No | takeProfit object in params containing the triggerPrice at which the attached take profit order will be triggered |
| params.takeProfit.triggerPrice | float | No | take profit trigger price |
| params.takeProfit.price | float | No | take profit order price (if not provided the order will be a market order) |
| params.stopLoss | object | No | stopLoss object in params containing the triggerPrice at which the attached stop loss order will be triggered |
| params.stopLoss.triggerPrice | float | No | stop loss trigger price |
| params.stopLoss.price | float | No | stop loss order price (if not provided the order will be a market order) |
| params.tpsl | float | No | whether to force to send the order to the combined TPSL oco order endpoint |
blofin.createOrder (symbol, type, side, amount, price?, params?)cancelOrder
cancels an open order
Kind: instance method of blofin
Returns: object - An order structure
See
| 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.trigger | boolean | No | True if cancelling a trigger/conditional |
| params.tpsl | boolean | No | True if cancelling a tpsl order |
blofin.cancelOrder (id, symbol, params?)createOrders
create a list of trade orders
Kind: instance method of blofin
Returns: object - an order structure
See: https://blofin.com/docs#place-multiple-orders
| Param | Type | Required | Description |
|---|---|---|---|
| orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | object | No | extra parameters specific to the exchange API endpoint |
blofin.createOrders (orders, params?)fetchOpenOrders
Fetch orders that are still open
Kind: instance method of blofin
Returns: Array<Order> - a list of order structures
See
- https://blofin.com/docs#get-active-orders
- https://blofin.com/docs#get-active-tpsl-orders
- https://docs.blofin.com/index.html#get-active-algo-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.trigger | bool | No | True if fetching trigger or conditional orders |
| 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 |
blofin.fetchOpenOrders (symbol, since?, limit?, params?)fetchMyTrades
fetch all trades made by the user
Kind: instance method of blofin
Returns: Array<Trade> - a list of trade structures
See: https://blofin.com/docs#get-trade-history
| 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.until | int | No | Timestamp in ms of the latest time to retrieve trades for |
| params.type | string | No | 'swap' or 'spot' (defaults to 'swap'), required to fetch spot trade history |
| params.instId | string | No | spot markets only the market id of the spot market to fetch the trade history for (e.g. 'BTC-USDT') |
| 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 |
blofin.fetchMyTrades (symbol, since?, limit?, params?)fetchDeposits
fetch all deposits made to an account
Kind: instance method of blofin
Returns: Array<object> - a list of transaction structures
See: https://blofin.com/docs#get-deposite-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.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 availble parameters |
blofin.fetchDeposits (code, since?, limit?, params?)fetchWithdrawals
fetch all withdrawals made from an account
Kind: instance method of blofin
Returns: Array<object> - a list of transaction structures
See: https://blofin.com/docs#get-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.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 availble parameters |
blofin.fetchWithdrawals (code, since?, limit?, params?)fetchLedger
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance method of blofin
Returns: object - a ledger structure
See: https://blofin.com/docs#get-funds-transfer-history
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code, default is undefined |
| since | int | No | timestamp in ms of the earliest ledger entry, default is undefined |
| limit | int | No | max number of ledger entries to return, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'cross' or 'isolated' |
| 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 |
blofin.fetchLedger (code?, since?, limit?, params?)cancelOrders
cancel multiple orders
Kind: instance method of blofin
Returns: object - an list of order structures
See: https://blofin.com/docs#cancel-multiple-orders
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | boolean | No | whether the order is a stop/trigger order |
blofin.cancelOrders (ids, symbol, params?)transfer
transfer currency internally between wallets on the same account
Kind: instance method of blofin
Returns: object - a transfer structure
See: https://blofin.com/docs#funds-transfer
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | amount to transfer |
| fromAccount | string | Yes | account to transfer from (funding, swap, copy_trading, earn) |
| toAccount | string | Yes | account to transfer to (funding, swap, copy_trading, earn) |
| params | object | No | extra parameters specific to the exchange API endpoint |
blofin.transfer (code, amount, fromAccount, toAccount, params?)fetchPosition
fetch data on a single open contract trade position
Kind: instance method of blofin
Returns: object - a position structure
See: https://blofin.com/docs#get-positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market the position is held in, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.instType | string | No | MARGIN, SWAP, FUTURES, OPTION |
blofin.fetchPosition (symbol, params?)fetchPositions
fetch data on a single open contract trade position
Kind: instance method of blofin
Returns: object - a position structure
See: https://blofin.com/docs#get-positions
| 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.instType | string | No | MARGIN, SWAP, FUTURES, OPTION |
blofin.fetchPositions (symbols?, params?)fetchPositionsHistory
fetches historical positions
Kind: instance method of blofin
Returns: Array<object> - a list of position structures
See: https://docs.blofin.com/index.html#get-positions-history
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified contract symbols |
| since | int | No | timestamp in ms of the earliest position to fetch, default=3 months ago, max range for params["until"] - since is 3 months |
| limit | int | No | the maximum amount of records to fetch, default=20, max=100 |
| params | object | Yes | extra parameters specific to the exchange api endpoint |
| params.until | int | No | timestamp in ms of the latest position to fetch, max range for params["until"] - since is 3 months |
| params.productType | string | No | USDT-FUTURES (default), COIN-FUTURES, USDC-FUTURES, SUSDT-FUTURES, SCOIN-FUTURES, or SUSDC-FUTURES |
| params.uta | boolean | No | set to true for the unified trading account (uta), defaults to false |
blofin.fetchPositionsHistory (symbols?, since?, limit?, params)fetchLeverages
fetch the set leverage for all contract markets
Kind: instance method of blofin
Returns: object - a list of leverage structures
See: https://docs.blofin.com/index.html#get-multiple-leverage
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | a list of unified market symbols, required on blofin |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'cross' or 'isolated' |
blofin.fetchLeverages (symbols, params?)fetchLeverage
fetch the set leverage for a market
Kind: instance method of blofin
Returns: object - a leverage structure
See: https://docs.blofin.com/index.html#get-leverage
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'cross' or 'isolated' |
blofin.fetchLeverage (symbol, params?)setLeverage
set the level of leverage for a market
Kind: instance method of blofin
Returns: object - response from the exchange
See: https://blofin.com/docs#set-leverage
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | int | Yes | the rate of leverage |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | 'cross' or 'isolated' |
| params.positionSide | string | No | 'long' or 'short' - required for hedged mode in isolated margin |
blofin.setLeverage (leverage, symbol, params?)closePosition
closes open positions for a market
Kind: instance method of blofin
Returns: Array<object> - A list of position structures
See: https://blofin.com/docs#close-positions
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Unified CCXT market symbol |
| side | string | No | 'buy' or 'sell', leave as undefined in net mode |
| params | object | No | extra parameters specific to the blofin api endpoint |
| params.clientOrderId | string | No | a unique identifier for the order |
| params.marginMode | string | No | 'cross' or 'isolated', default is 'cross; |
| params.code | string | No | required in the case of closing cross MARGIN position for Single-currency margin margin currency EXCHANGE SPECIFIC PARAMETERS |
| params.autoCxl | boolean | 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 | string | No | order tag a combination of case-sensitive alphanumerics, all numbers, or all letters of up to 16 characters |
blofin.closePosition (symbol, side?, params?)fetchClosedOrders
fetches information on multiple closed orders made by the user
Kind: instance method of blofin
Returns: Array<Order> - a list of order structures
See
| 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 orde structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | True if fetching trigger or conditional orders |
| 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 |
blofin.fetchClosedOrders (symbol, since?, limit?, params?)fetchMarginMode
fetches the margin mode of a trading pair
Kind: instance method of blofin
Returns: object - a margin mode structure
See: https://docs.blofin.com/index.html#get-margin-mode
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the margin mode for |
| params | object | No | extra parameters specific to the exchange API endpoint |
blofin.fetchMarginMode (symbol, params?)setMarginMode
set margin mode to 'cross' or 'isolated'
Kind: instance method of blofin
Returns: object - response from the exchange
See: https://docs.blofin.com/index.html#set-margin-mode
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | string | Yes | 'cross' or 'isolated' |
| symbol | string | No | unified market symbol (not used in blofin setMarginMode) |
| params | object | No | extra parameters specific to the exchange API endpoint |
blofin.setMarginMode (marginMode, symbol?, params?)fetchPositionMode
fetchs the position mode, hedged or one way
Kind: instance method of blofin
Returns: object - 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 | string | No | unified symbol of the market to fetch the position mode for (not used in blofin fetchPositionMode) |
| params | object | No | extra parameters specific to the exchange API endpoint |
blofin.fetchPositionMode (symbol?, params?)setPositionMode
set hedged to true or false for a market
Kind: instance method of blofin
Returns: object - response from the exchange
See: https://docs.blofin.com/index.html#set-position-mode
| Param | Type | Required | Description |
|---|---|---|---|
| hedged | bool | Yes | set to true to use hedged mode, false for one-way mode |
| symbol | string | No | not used by blofin setPositionMode () |
| params | object | No | extra parameters specific to the exchange API endpoint |
blofin.setPositionMode (hedged, symbol?, params?)fetchPositionsADLRank
fetches the auto deleveraging rank and risk percentage for a list of symbols
Kind: instance method of blofin
Returns: Array<object> - an array of auto de leverage structures
See: https://docs.blofin.com/index.html#get-positions
| 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 |
blofin.fetchPositionsADLRank (symbols?, params?)watchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of blofin
Returns: Array<object> - a list of trade structures
See: https://docs.blofin.com/index.html#ws-trades-channel
| 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 |
blofin.watchTrades (symbol, since?, limit?, params?)watchTradesForSymbols
get the list of most recent trades for a list of symbols
Kind: instance method of blofin
Returns: Array<object> - a list of trade structures
See: https://docs.blofin.com/index.html#ws-trades-channel
| 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 |
blofin.watchTradesForSymbols (symbols, since?, limit?, params?)watchOrderBook
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of blofin
Returns: object - 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 | 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 |
blofin.watchOrderBook (symbol, limit?, params?)watchOrderBookForSymbols
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of blofin
Returns: object - 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 | 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 |
| params.depth | string | 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?)watchTicker
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of blofin
Returns: object - a ticker structure
See: https://docs.blofin.com/index.html#ws-tickers-channel
| 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 |
blofin.watchTicker (symbol, params?)watchTickers
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 blofin
Returns: object - a ticker structure
See: https://docs.blofin.com/index.html#ws-tickers-channel
| 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 |
blofin.watchTickers (symbols, params?)watchBidsAsks
watches best bid & ask for symbols
Kind: instance method of blofin
Returns: object - a ticker structure
See: https://docs.blofin.com/index.html#ws-tickers-channel
| 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 |
blofin.watchBidsAsks (symbols, params?)watchOHLCV
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of blofin
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
| 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 |
blofin.watchOHLCV (symbol, timeframe, since?, limit?, params?)watchOHLCVForSymbols
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of blofin
Returns: Array<Array<int>> - 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 | 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 |
blofin.watchOHLCVForSymbols (symbolsAndTimeframes, since?, limit?, params?)watchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of blofin
Returns: object - a balance structure
See: https://docs.blofin.com/index.html#ws-account-channel
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
blofin.watchBalance (params?)watchOrdersForSymbols
watches information on multiple orders made by the user across multiple symbols
Kind: instance method of blofin
Returns: Array<object> - a list of [order structures]{@link /docs/manual#order-structure
See
- https://docs.blofin.com/index.html#ws-order-channel
- https://docs.blofin.com/index.html#ws-algo-orders-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | Yes | |
| 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.trigger | boolean | No | set to true for trigger orders |
blofin.watchOrdersForSymbols (symbols, since?, limit?, params?)watchPositions
watch all open positions
Kind: instance method of blofin
Returns: Array<object> - a list of position structure
See: https://docs.blofin.com/index.html#ws-positions-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string>, undefined | Yes | list of unified market symbols |
| since | int | No | the earliest time in ms to fetch positions for |
| limit | int | No | the maximum number of positions to retrieve |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
blofin.watchPositions (symbols, since?, limit?, params)watchFundingRate
watch the current funding rate
Kind: instance method of blofin
Returns: object - a funding rate structure
See: https://docs.blofin.com/index.html#ws-funding-rate-channel
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
blofin.watchFundingRate (symbol, params?)