Status

Subscribe to and receive different types of platform information - currently supports derivatives pair status and liquidation feed.

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: 'status', 
  key: 'deriv:tBTCF0:USTF0' 
})

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

ws.on_open = lambda self: self.send('{ "event": "subscribe", "channel": "status", "key": "deriv:tBTCF0:USTF0"}')

ws.on_message = lambda self, evt:  print (evt)

The value of the key, contained in the subscription payload, determines what status data will be returned.

Derivatives status updates:
key: "deriv:SYMBOL" // e.g. "deriv:tBTCF0:USTF0"

Liquidation feed updates:
key: "liq:global"

// request
{ 
  event: "subscribe", 
  channel: "status", 
  key: KEY
}

// response - 
{
   event: "subscribed",
   channel: "status",
   chanId: CHANNEL_ID,
   key: KEY
}

//Derivative pair status
{"event":"subscribed","channel":"status","chanId":335856,"key":"deriv:tBTCF0:USTF0"}

//Liquidation feed
{"event":"subscribed","channel":"status","chanId":91684,"key":"liq:global"}
// Derivatives Status
[
  CHANNEL_ID,
  [
    TIME_MS,
    PLACEHOLDER, 
    DERIV_PRICE,
    SPOT_PRICE,
    PLACEHOLDER,
    INSURANCE_FUND_BALANCE,
    PLACEHOLDER,
    NEXT_FUNDING_EVT_TIMESTAMP_MS,
    NEXT_FUNDING_ACCRUED,
    NEXT_FUNDING_STEP,
    PLACEHOLDER,
    CURRENT_FUNDING
    PLACEHOLDER,
    PLACEHOLDER,
    MARK_PRICE,
    PLACEHOLDER,
    PLACEHOLDER,
    OPEN_INTEREST,
    PLACEHOLDER,
    PLACEHOLDER,
    PLACEHOLDER,
    CLAMP_MIN,
    CLAMP_MAX
  ]
]

[335856,[1596124822000,null,0.896,0.771995,null,1396531.67460709,null,1596153600000,0.0001056,6,null,-0.01381344,null,null,0.7664,null,null,246502.09001551,null,null,null,null,0.3]]

// Liquidation feed updates
[
  CHANNEL_ID,
  [
    ['pos', 
     POS_ID, 
     TIME_MS, 
     PLACEHOLDER, 
     SYMBOL, 
     AMOUNT, 
     BASE_PRICE, 
     PLACEHOLDER, 
     IS_MATCH, 
     IS_MARKET_SOLD, 
     PLACEHOLDER
     LIQUIDATION_PRICE
    ]
  ]
]

[91684,[["pos",142397657,1574697680828.2002,null,"tBSVUSD",-2.62932,91.583875238719,null,1,1,null,112.27]]]

Stream Fields

FieldsTypeDescription
CHANNEL_IDintIdentification number assigned to the channel for the duration of this connection.
SYMBOLStringTrading pair or funding currency
TIME_MSintMillisecond timestamp
DERIV_PRICEfloatDerivative book mid price.
SPOT_PRICEfloatBook mid price of the underlying Bitfinex spot trading pair
MARK_PRICEfloatPrice based on the BFX Composite Index
INSURANCE_FUND_BALANCEfloatThe balance available to the liquidation engine to absorb losses.
NEXT_FUNDING_EVT_TIMESTAMP_MSnullMillisecond timestamp of next funding event
NEXT_FUNDING_ACCRUEDfloatCurrent accrued funding for next 8h period
NEXT_FUNDING_STEPintIncremental accrual counter
CURRENT_FUNDINGfloatFunding applied in the current 8h period
MARK_PRICEfloatPrice based on the BFX Composite Index
OPEN_INTERESTfloatCurrent open interest
CLAMP_MINfloatRange in the average spread that does not require a funding payment
CLAMP_MAXfloatFunding payment cap
POS_IDintPosition id
AMOUNTfloatAmount of the liquidated position
BASE_PRICEfloatBase price of the liquidated position
IS_MATCHint0 -> initial liquidation trigger, 1 market execution
IS_MARKET_SOLDint0 -> direct sell into the market, 1 position acquired by the system
LIQUIDATION_PRICEfloatPrice at which the liquidation was triggered