Skip to main content

Book (Level 2)

CHANNEL

wss://ws.kraken.com/v2

book

The book channel streams level 2 (L2) order book. It describes the individual price levels in the book with aggregated order quantities at each level.

Subscriptions to this channel can be made for multiple symbols at once by specifying a list of pairs in the symbol.

For more detail on maintaining the order book and generating a checksum, see guide.

Subscribe Request

MESSAGE BODY

method string required
Value: subscribe
params object
channel string required
Value: book
symbol array of strings required
Example: ["BTC/USD", "MATIC/GBP"]
A list of currency pairs.
depth integer
Possible values: [10, 25, 100, 500, 1000]
Default value: 10
The number of price levels to be received.
snapshot boolean
Possible values: [true, false]
Default value: true
Request a snapshot after subscribing.
req_id integer
Optional client originated request identifier sent as acknowledgment in the response.

Snapshot Response

The returned snapshot data contains the specified number of bids and asks for the symbol including a CRC32 checksum of the top 10 bids and asks.

MESSAGE BODY

channel string
Value: book
type string
Value: snapshot
data array [
[0] book object
The book element is always the first and only item in the data payload.
asks array [
[many] level object
price float
The ask price.
qty float
The ask quantity.
]
bids array [
[many] level object
price float
The bid price.
qty float
The bid quantity.
]
checksum integer
CRC32 checksum for the top 10 bids and asks.
symbol string
Example: "BTC/USD"
The symbol of the currency pair.
]

Update Response

The data contains the updates of the bids and asks for the relevant symbol including a CRC32 checksum of the top 10 bids and asks.

Note, it is possible to have multiple updates to the same price level in a single update message. Updates should always be processed in sequence.

MESSAGE BODY

channel string
Value: book
type string
Value: update
data array [
[0] book object
The book element is always the first and only item in the data payload.
asks array [
[many] level object
price float
The ask price.
qty float
The ask quantity.
]
bids array [
[many] level object
price float
The bid price.
qty float
The bid quantity.
]
checksum integer
CRC32 checksum for the top 10 bids and asks.
symbol string
Example: "BTC/USD"
The symbol of the currency pair.
timestamp string
Format: RFC3339
Example: 2022-12-25T09:30:59.123456Z
The book order update timestamp.
]

Unsubscribe Request

MESSAGE BODY

method string required
Value: unsubscribe
params object
channel string required
Value: book
symbol array of strings required
Example: ["BTC/USD", "MATIC/GBP"]
A list of currency pairs.
depth integer
Possible values: [10, 25, 100, 500, 1000]
The number of price levels to be unsubscribed.
req_id integer
Optional client originated request identifier sent as acknowledgment in the response.