Skip to main content

Book (Level 2)

CHANNEL

wss://ws.kraken.com

book

Order book levels. On subscription, a snapshot will be published at the specified depth, following the snapshot, level updates will be published

Subscription Request

MESSAGE BODY

event string required
Value: subscribe
pair array of strings required
Example: ["BTC/USD", "MATIC/GBP"]
The currency pairs for this request.
subscription object
name string required
Value: book
depth integer
Possible values: [10, 25, 100, 500, 1000]
Default value: 10
Specifies the number of price levels (in each side of the book) to be received.
reqid string
Optional client originated request identifier sent as acknowledgment in the response.

Subscription Snapshot and Update Response

Note, there is no checksum on the snapshot.

MESSAGE BODY

array [
[0] channel_id integer deprecated
Deprecated Usage: Use 'channel_name' and 'pair'.
Channel identifier.
[1] book object
as array [
Ask price levels, ascending from best ask.
[many] level array [
[0] price string
The price of this level.
[1] volume string
Price level volume, for updates volume = 0 for level removal/deletion
[2] timestamp string
Format: Epoch Seconds
Example: 1534614248.456738
Timestamp when the level last updated. Timestamp has microsecond precision and is not unique across all price levels.
]
]
bs array [
Bid price levels, ascending from best bid.
[many] level array [
[0] price string
Price level
[1] volume string
Price level volume, for updates volume = 0 for level removal/deletion
[2] timestamp string
Format: Epoch Seconds
Example: 1534614248.456738
Timestamp when the level last updated. Timestamp has microsecond precision and is not unique across all price levels.
]
]
[2] pair string
Example: "BTC/USD"
The symbol of the currency pair.
[3] channel_name string
Value: book-[depth]
The name of the channel.
]

Update Response

MESSAGE BODY

array [
[0] channel_id integer deprecated
Deprecated Usage: Use 'channel_name' and 'pair'.
Channel identifier.
[1] book object
a array [
Ask price levels.
[many] level array [
[0] price string
The price for this level.
[1] volume string
The cumulative volume at this price level. If volume is 0, remove level from book.
[2] timestamp string
Format: Epoch Seconds
Example: 1534614248.456738
Timestamp when the level was last updated. Timestamp has microsecond precision and is not unique across all price levels.
[3] update_type string conditional
Condition: Republish only.
Value: r
]
c string conditional
Condition: Only present on last update.
Example: "4088505763"
Book checksum as a quoted unsigned 32-bit integer.
]
b array [
Bid price levels.
[many] level array [
[0] price string
The price for this level.
[1] volume string
The cumulative volume at this price level. If volume is 0, remove level from book.
[2] timestamp string
Format: Epoch Seconds
Example: 1534614248.456738
Timestamp when the level was last updated. Timestamp has microsecond precision and is not unique across all price levels.
[3] update_type string conditional
Condition: Republish only.
Value: r
]
c string conditional
Condition: Only present on last update.
Example: "4088505763"
Book checksum as a quoted unsigned 32-bit integer.
]
[2] pair string
Example: "BTC/USD"
The symbol of the currency pair.
[3] channel_name string
Value: book-[depth]
The name of the channel.
]