Trade data does not specify if buyer or seller

How can I use streaming or historical trade data to identify whether a trade was a buyer or a seller?

Analyzing Binance website interface, I see color changes of trade price history depend only on “Is the buyer the market maker?”

This doesn’t make sense to me. What about Takers who are sellers?

Is this data simply just missing from Binance?

In order for a trade to be completed, it involves a buyer and a seller. Binance matches them together on the exchange and if there is a match, there is a trade.

Yes, I realise that. It’s kinda obvious. It’s how exchanges work…

I want to know how to use streaming data API or even historical trade data to identify whether a trade was a buyer or a seller.

It appears to be impossible with Binance API.
And the website seems to essentially fake buyers and sellers with green and red prices in trade history by using IsBuyerMaker flag to specify the trade is a buyer, which is not always correct.

Does anyone know how to identify buyers and sellers, and makers and takers, in trade data?

Hi.

This doesn’t make sense to me. What about Takers who are sellers?

The convention is to call it a ‘sell’ if taker sold (and maker bought), and a ‘buy’ if taker bought (and maker sold). So, the field isBuyerMaker indicates whether it was a ‘sell’ by this convention, because when maker buys, taker sells.

Does this make more sense now?

Going by what you say, if a taker buys then, as isBuyerMaker indicates and the name suggests, that the buyer is the maker, which is wrong.

If I understand correctly, you are essentially saying that ‘isBuyerMaker’ should be renamed ‘isSeller’.
Is this what you mean? And if so, then how do I identify makers and takers?

Going by what I say, if taker buys, then isBuyerMaker will be ‘false’ (obviously), and nothing will be wrong.

There are two parties in a trade. A maker and a taker. One of them is selling, the other is buying. It’s either maker sold and taker bought, or reverse - maker bought and taker sold. One binary field is enough to distinguish the two cases. No other cases are possible.

But when you say that a trade is ‘a sell’ you also have to specify which party you mean was selling. A convention is that on the website in UI, a trade is named by the taker’s side - if taker is selling, then it’s a sell in UI. However, in the api, they use the reverse notion - they specify maker’s side of the trade. So if isBuyerMaker is true, then maker bought, and taker sold, thus by convention this is a ‘sell’ in UI.

You can’t ‘identify makers and takers’ from a trade. Trade involves two parties, a taker and a maker, they both participate, one side sold, the other bought. So a trade is always a sell from one side and a buy from the other, and always both a maker and a taker participate.

What exactly are you trying to accomplish? Are you trying to figure out which side of the orderbook was consumed? If so then isBuyerMaker=true indicates that bids were consumed (buy orders in the orderbook) , otherwise asks were consumed (sell orders). If that’s not what you’re up to then please tell me more.

Thanks for the clarification. Just to be more clear.

When talking about futures trading in this case.

isBuyerMaker=true would mean that a buy limit order was placed, an aggressive seller then placed a market sell order. This turned the limit order of the buyer into a long position. If the position is then closed with market order then a new trade would take place in which the market order would be met with buy limit order, in which case there would be new trade entry with isBuyerMaker=true. If the position is closed with limit order then new trade entry would be with isBuyMaker=false.

If isBuyerMaker=false means that a sell limit order was placed, an aggressive seller then place sell market order and the limit order then became a short position.

I am trying to calculate trade volumes at price intervals, in the case of isBuyMaker=true, I would add to sell volume at a given price, and isBuyMaker=false, I would add buy volume to given price.

Any guidance would be much appreciated. Thanks