-
Notifications
You must be signed in to change notification settings - Fork 215
Open
Description
I'm trying to get the full level 2 orderbook for every market, and then maintain a live version of the orderbook using the websocket.
For coinbase I would make a request:
// Request
{
"type": "subscribe",
"channels": ["level2"],
"product_ids": [
"ETH-USD",
"BTC-USD"
]
}
and then the first response is the entire current orderbook for each product:
{
"type": "snapshot",
"product_id": "BTC-USD",
"bids": [["10101.10", "0.45054140"]],
"asks": [["10102.55", "0.57753524"]]
}
and then subsequent events are changes like the following:
{
"type": "l2update",
"product_id": "BTC-USD",
"time": "2019-08-14T20:42:27.265Z",
"changes": [
[
"buy",
"10101.80000000",
"0.162567"
]
]
}
This lets me always maintain the current orderbook for all products.
What's the best way to do this with Bitkub?
I tried first using the REST API to fetch the current orderbook for each market and then starting a separate websocket for each market to update the orderbook. However, when I then hit the REST API endpoint for the orderbook again and compare it against what I have, it seems different. Any help is appreciated, thanks!
Metadata
Metadata
Assignees
Labels
No labels