Bids and asks
What is this endpoint for?
All bids and asks on an exchange's order books. Use Kaiko Stream for real-time tick-level updates, or Rest API for snapshots at 30-second intervals. When you connect, you first receive a snapshot of the current order book, followed by continuous real-time updates for every change ("delta") that takes place.
When you subscribe, you'll initially receive a full snapshot within a few seconds, followed by all subsequent tick-level updates. If you receive another full snapshot, replace your local snapshot with the new one. This should happen infrequently and only occurs if we detect a consistency issue, such as a lost connection to the exchange or the exchange being down for some time.
If you receive an update with an amount of 0, you should remove the corresponding price level from your local order book. You'll occasionally receive a 0 message for a price level that doesn't exist in your local order book - this can be safely ignored and is due to various exchange limitations.
The order book should not be considered valid until all updates with the same tsExchange
have been applied to your local order book, meaning all potential messages from the same update batch have been processed.
Endpoints
Parameters
instrumentCriteria
A nested object to configure following properties for your stream:
exchange
(String) - The code(s) for the exchange(s)instrument_class
(String) - The class(es) of the instrument(s) .code (String) -
The Kaiko code for the instrument.
cbse
spot
algo-btc
Configuring a wildcard
A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream.
Use a *
in place of the relevant exchange
, instrument
, or class
parameter.
For example, the configuration below would deliver trades for BTC/USD across all exchanges where itâs supported:
exchange: *
class: spot
instrument: btc-usd
Fields
class
Instrument class, empty when not mapped.
code
Instrument code, empty when not mapped.
exchange
Instrument exchange code.
sequenceId
Sequence ID for event. Sortable in lexicographic order.
updateType
SNAPSHOT
- A new Snapshot of the order book
UPDATED
- A new batch of bids & asks since the snapshot
asks
Represents sell orders
amount
: the quantity of the base asset available for sale
price
: the price per unit of the base that the seller is willing to accept in the quote asset, represented as a scientific notation
Example: algo-btc
base asset = algo
quote asset = btc
amount
:42656.0
price
:1.97e-06
The asker has
42656.0
Algo availableFor each unit of Algo, the buyer is willing to accept
1.97e-06
BTC, equal to 0.00000197 when converted to a decimal number
bids
Represents buy orders.
amount
: the quantity of the base asset the buyer is willing to purchase
price
: the price per unit of the base that the buyer is willing to pay in the quote asset, represented as a scientific notation
Example: algo-btc
base asset = algo
quote asset = btc
amount
:80569.0
price
:1.96e-06
The buyer will purchase up to
80569.0
AlgoFor each unit of Algo, the buyer is willing to pay
1.96e-06
BTC, equal to 0.00000196 when converted to a decimal number
tsExchange
The timestamp provided by the exchange for the data.
tsCollection
The timestamp for when Kaiko received the data from the exchange.
tsEvent
The timestamp the data became available in the Kaiko system.
Request examples
Response Example
Last updated