Currently, we have a separate callback for order book events and trades. This is a problematic API because a trade event obviously has an impact on the order book but it's impossible to tell whether a price level size changed because of an execution or an cancellation. Trade event callbacks, on the other hand, are invoked after order book has been updated which makes it difficult to see what the order book state was when the trade occurred.
The issue can be fixed by unifying the order book event and trade event callbacks into one callback that updates the order book (new order or cancellation), reports a trade (non-displayable order was executed or trade happened on another venue), or both updates the order book and reports a trade (order execution).
Currently, we have a separate callback for order book events and trades. This is a problematic API because a trade event obviously has an impact on the order book but it's impossible to tell whether a price level size changed because of an execution or an cancellation. Trade event callbacks, on the other hand, are invoked after order book has been updated which makes it difficult to see what the order book state was when the trade occurred.
The issue can be fixed by unifying the order book event and trade event callbacks into one callback that updates the order book (new order or cancellation), reports a trade (non-displayable order was executed or trade happened on another venue), or both updates the order book and reports a trade (order execution).