The Surprise

Photo by Shubham Dhage on Unsplash

Greetings, everyone! Recently we started to work on’s integration into our lightning-fast library Did you notice that there is an important problem with’s market data feed? Yeah, seriously there is a jaw-dropping problem! If your algorithm relies on the trade direction field in their trades API, then there is a good chance that you’ve been screwed up. For a given trade, the trade direction reported by their WebSocket API is exactly the opposite of the value reported by their REST API.


Trade direction for trade id 1763687923 reported by WebSocket API


Trade direction for trade id 1763687923 reported by REST API

We pay attention to the smallest details as we develop our trading library and our market data archive because we do perform trading using our own library and data with private capital and any mistakes directly have an impact on ourselves. In two of our previous articles entitled “Leveraging Trade Directions” and “The Nitty-Gritty of Paper Trading a Market Making Strategy”, we discussed the importance of trade directions. After thorough investigation on’s API documentation, we were unable to find out why the reported trade directions are opposite. The only explanation is that one API reports the maker side and the other API reports the taker side. Without clear documentations, how do we know which is which? Let’s look at their web trading interface:

Trade direction for trade id 1763687923 reported by web trading interface

Tada! It’s obvious that this trade originated from a maker-buy order previously sitting on the order book at a price level of $54653.29. In our API the field called “is_buyer_maker” thus is unambiguously assigned a true value for this trade. And you don’t have to worry about whether the underlying code uses the exchange’s WebSocket API or REST API.

If you are interested in our work or collaborating with us, join us on Discord: 🎉 We specialize in market data collection, high speed trading system, infrastructure optimization, and proprietary market making. You’re welcome to hire us as engineers, liquidity providers, traders, or asset managers.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store