Ticker

The ticker endpoint provides a high level overview of the state of the market for a specified pair. It shows the current best bid and ask, the last traded price, as well as information on the daily volume and price movement over the last day.

const ws = require('ws')
const w = new ws('wss://api-pub.bitfinex.com/ws/2')

w.on('message', (msg) => console.log(msg))

let msg = JSON.stringify({ 
  event: 'subscribe', 
  channel: 'ticker', 
  symbol: 'tBTCUSD' 
})

w.on('open', () => w.send(msg))
wscat -c wss://api-pub.bitfinex.com/ws/2
{ "event": "subscribe",  "channel": "ticker",  "symbol": "tBTCUSD" }
ws = websocket.WebSocketApp('wss://api-pub.bitfinex.com/ws/2')

ws.on_open = lambda self: self.send('{ "event": "subscribe", "channel": "ticker", "symbol": "tBTCUSD"}')

ws.on_message = lambda self, evt:  print (evt)
// request
{ 
  event: "subscribe", 
  channel: "ticker", 
  symbol: SYMBOL
}

// response - trading
{
   event: "subscribed",
   channel: "ticker",
   chanId: CHANNEL_ID,
   symbol: SYMBOL,
   pair: PAIR
}

{"event":"subscribed","channel":"ticker","chanId":224555,"symbol":"tBTCUSD","pair":"BTCUSD"}

// response - funding
{
  event: "subscribed",
  channel: "ticker",
  chanId: CHANNEL_ID,
  symbol: SYMBOL,
  currency: CURRENCY
}

{"event":"subscribed","channel":"ticker","chanId":232591,"symbol":"fUSD","currency":"USD"}
// Trading pairs

[
  443378, //CHANNEL_ID
  [
    7616.5, //BID
    31.89055171, //BID_SIZE
    7617.5, //ASK
    43.358118629999986, //ASK_SIZE
    -550.8, //DAILY_CHANGE
    -0.0674, //DAILY_CHANGE_RELATIVE
    7617.1, //LAST_PRICE
    8314.71200815, //VOLUME
    8257.8, //HIGH
    7500 //LOW
  ] //UPDATE
]

// Funding pairs

[
  234509, //CHANNEL_ID
  [
    0.0003193369863013699, //FRR
    0.0002401, //BID
    30, //BID_PERIOD
    3939629.6177260396, //BID_SIZE
    0.00019012, //ASK
    2, //ASK_PERIOD
    307776.1592138799, //ASK_SIZE
    -0.00005823, //DAILY_CHANGE
    -0.2344, //DAILY_CHANGE_RELATIVE
    0.00019016, //LAST_PRICE
    122156333.45260866, //VOLUME
    0.00027397, //HIGH
    6.8e-7, //LOW
    null, //PLACEHOLDER
    null, //PLACEHOLDER
    3441851.73330503 //FRR_AMOUNT_AVAILABLE
  ] //UPDATE
]
// Trading pairs

[
  443378, //CHANNEL_ID
  [
    7616.5, //BID
    31.89055171, //BID_SIZE
    7617.5, //ASK
    43.358118629999986, //ASK_SIZE
    -550.8, //DAILY_CHANGE
    -0.0674, //DAILY_CHANGE_RELATIVE
    7617.1, //LAST_PRICE
    8314.71200815, //VOLUME
    8257.8, //HIGH
    7500 //LOW
  ] //UPDATE
]

// Funding pairs

[
  234509, //CHANNEL_ID
  [
    0.0003193369863013699, //FRR
    0.0002401, //BID
    30, //BID_PERIOD
    3939629.6177260396, //BID_SIZE
    0.00019012, //ASK
    2, //ASK_PERIOD
    307776.1592138799, //ASK_SIZE
    -0.00005823, //DAILY_CHANGE
    -0.2344, //DAILY_CHANGE_RELATIVE
    0.00019016, //LAST_PRICE
    122156333.45260866, //VOLUME
    0.00027397, //HIGH
    6.8e-7, //LOW
    null, //PLACEHOLDER
    null, //PLACEHOLDER
    3441851.73330503 //FRR_AMOUNT_AVAILABLE
  ] //UPDATE
]

Request fields

FieldsTypeDescription
SYMBOLStringTrading pair or funding currency

Stream data

IndexFieldTypeDescription
[0]CHANNEL_IDIntIdentification number assigned to the channel for the duration of this connection.
[1]UPDATEArrayArray with relevant data (trading snapshot/update or funding snapshot/update)

Trading snapshot/update (Index [1])

Index Field Type Description
[0]BIDFloatPrice of last highest bid
[1]BID_SIZEFloatSum of the 25 highest bid sizes
[2]ASKFloatPrice of last lowest ask
[3]ASK_SIZEFloatSum of the 25 lowest ask sizes
[4]DAILY_CHANGEFloatAmount that the last price has changed since yesterday
[5]DAILY_CHANGE_RELATIVEFloatRelative price change since yesterday (*100 for percentage change)
[6]LAST_PRICEFloatPrice of the last trade.
[7]VOLUMEFloatDaily volume
[8]HIGHFloatDaily high
[9]LOWFloatDaily low

Funding snapshot/update (Index [1])

Index Field Type Description
[0]FRRFloatFlash Return Rate - average of all fixed rate funding over the last hour (funding tickers only)
[1]BIDFloatPrice of last highest bid
[2]BID_PERIODIntBid period covered in days (funding tickers only)
[3]BID_SIZEFloatSum of the 25 highest bid sizes
[4]ASKFloatPrice of last lowest ask
[5]ASK_PERIODIntAsk period covered in days (funding tickers only)
[6]ASK_SIZEFloatSum of the 25 lowest ask sizes
[7]DAILY_CHANGEFloatAmount that the last price has changed since yesterday
[8]DAILY_CHANGE_RELATIVEFloatRelative price change since yesterday (*100 for percentage change)
[9]LAST_PRICEFloatPrice of the last trade.
[10]VOLUMEFloatDaily volume
[11]HIGHFloatDaily high
[12]LOWFloatDaily low
[ . . . ]
[15]FRR_AMOUNT_AVAILABLEFloatThe amount of funding that is available at the Flash Return Rate (funding tickers only)