node.bittrex.api
node.bittrex.api copied to clipboard
Orderbook websocket
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?
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
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
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.
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.
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- .
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