The Order Books channel allow you to keep track of the state of the Bitfinex order book.
It is provided on a price aggregated basis, with customizable precision.
After receiving the response, you will receive a snapshot of the book,
followed by updates upon any changes to the book.

// request
{
   "event":"subscribe",
   "channel":"book",
   "pair":"<PAIR>",
   "prec":"<PRECISION>",
   
   "length":"<LENGTH>""freq":"<FREQUENCY>",
   "length":"<LENGTH>"
}

// response
{
   "event":"subscribed",
   "channel":"book",
   "chanId":"<CHANNEL_ID>",
   "pair":"<PAIR>",
   "prec":"<PRECISION>",
   "freq":"<FREQUENCY>",
   "len":"<LENGTH>"
}
// snapshot
[
   "<CHANNEL_ID>",
   [
      [
         "<PRICE>",
         "<COUNT>",
         "<AMOUNT>"
      ],
     ...
   ]
]

// updates
[
   "<CHANNEL_ID>",
   "<PRICE>",
   "<COUNT>",
   "<AMOUNT>"
]

Fields

FieldsTypeDescription
PRECISIONstringLevel of price aggregation (P0, P1, P2, P3).
The default is P0.
FREQUENCYstringFrequency of updates (F0, F1).
F0=realtime / F1=2sec.
The default is F0.
PRICEfloatPrice level.
COUNTintNumber of orders at that price level.
±AMOUNTfloatTotal amount available at that price level.
Positive values mean bid, negative values mean ask.
LENGTHstringNumber of price points ("25", "100") [default="25"]

Precision Levels per Pair

PairPrecision LevelNumber of significant figuresExample
BTCUSDP02$0.01
...P11$0.10
...P20$1
...P3-1$10
LTCUSDP04$0.0001
...P13$0.001
...P22$0.01
...P31$0.1
LTCBTCP06฿0.000001
...P15฿0.00001
...P24฿0.0001
...P33฿0.001
ETHUSDP04$0.0001
...P13$0.001
...P22$0.01
...P31$0.1
ETHBTCP06฿0.000001
...P15฿0.00001
...P24฿0.0001
...P33฿0.001

🚧

Error Codes

10011 : Unknown Book precision
10012 : Unknown Book length

📘

NOTE

COUNT=0 means that you have to remove the price level from your book.