node.bittrex.api icon indicating copy to clipboard operation
node.bittrex.api copied to clipboard

Orderbook websocket

Open LRonHubs opened this issue 7 years ago • 6 comments

Does Bittrex really not have documentation for accessing the full orderbook via websocket? Isn't this the type of thing that would make people use your exchange more?

LRonHubs avatar Sep 08 '17 16:09 LRonHubs

Step 1: Subscribe to the websocket for the order book with the getmarkethistory() function Step 2: Download complete order book history with /public/getorderbook Step 3: Now you're always in sync

jaggedsoft avatar Sep 09 '17 21:09 jaggedsoft

The ugly tech specs for this part of the api are located at: https://github.com/n0mad01/node.bittrex.api/files/1104308/WebSocketAPI_MarketTracking.docx

jaggedsoft avatar Sep 09 '17 21:09 jaggedsoft

You basically first subscribe to the delta data for a currency pair by calling SubscribeToExchangeDeltas to make sure you don't miss anything. After that you call QueryExchangeState to get the initial state of the order book. Now you just need to apply all updates you receive after the call to QueryExchangeState on top of that.

See https://github.com/gliwka/bittrex-market/blob/master/lib/manager.js#L140 for the initialisation logic and https://github.com/gliwka/bittrex-market/blob/master/lib/market.js for handling the update messages.

gliwka avatar Sep 11 '17 15:09 gliwka

Anyone know what the different order book event types mean? There are 3: "0", "1", and "2". Bittrex's API documentation is a bit limited.

skeller88 avatar Sep 24 '17 07:09 skeller88

Generally one of these means "remove this order from the orderbook", another means "add this order to the orderbook", another means "keep this order on the orderbook,m but change the amount.

While I'm not sure which of these is which, the bittrex-market github repo does all this for you, you don't even need the aforementioned steps.

On Sun, Sep 24, 2017 at 3:34 AM, Shane Keller [email protected] wrote:

Anyone know what the different order book event types mean? There are 3: "0", "1", and "2". Bittrex's API documentation is a bit limited.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/n0mad01/node.bittrex.api/issues/66#issuecomment-331692934, or mute the thread https://github.com/notifications/unsubscribe-auth/AWRK7JZW9NE5sRnOEv9syOpXw_EIyIQnks5slgYhgaJpZM4PRaN- .

LRonHubs avatar Sep 24 '17 15:09 LRonHubs

Here some details about the orderbook types, in case anybody is searching for this information and finds this issue: https://github.com/gliwka/bittrex-market/issues/9

gliwka avatar Sep 24 '17 21:09 gliwka