aloysius-pgast / bittrex-signalr-client

Node.js implementation of SignalR protocol tailored for Bittrex exchange
39 stars 14 forks source link

Difference between "trade" and "orderBookUpdate" #21

Closed Henriii closed 5 years ago

Henriii commented 5 years ago

Hi,

First I want to thank you for creating this project, so far it works really good for me!

Now to my question: Could you explain the difference between "trade" and "orderBookUpdates" events? From my understanding a trade would also trigger an orderBookUpdate, since it changes the orderbook on the exchange?!

Do I need to handle "trade" events when I want to keep a sync of an orderbook?

aloysius-pgast commented 5 years ago

Hi. Thanks for your feedback. Regarding the events :

If you're interested in keeping your order book in sync, handling orderBook & orderBookUpdate is enough, you don't need to handle trades event (unless you also want to keep track of the orders which have been matched).

When an order is matched, any exchange will emit both events :

Henriii commented 5 years ago

Thank you! Much appreciated.