recent trades, historical and aggregate

I have a question with the following, in the API documentation appears recent trades, aggregate trades and historical trades, what difference is there between the three? they are all between the same timestamp, the api returns: ‘isBuyerMaker’: True,
I suppose it means if the buyer is a maker or taker if it is false, to differentiate if the order is limit it will be True and if the order is in market it will be false, because in the aggregates there are also ‘isBuyerMaker’: False, if they are trades that they have just been added and in the recent trades the same, the historical should be the only ones that have taker trades since the orders would have been bought or sold to the makers, there is some way to know in the API if the taker has bought or has sold, that is if the taker has settled an order from an ask or a bid, thank you very much

“…recent trades, aggregate trades and historical trades, what difference is there between the three?”

api/v3/trades - has a request weight of 1 and can only be used to get the most recent raw trades, up to the last 1000. This endpoint is very fast.

api/v3/historicalTrades - has a request weight of 5 and can get any raw trades from any point in time since the symbol has started trading. This endpoint could have to fetch some very old data and so it is not as fast.

api/v3/aggTrades - has a request weight of 1 and can get any aggregate trades from any point in time since the symbol has started trading. This endpoint could have to fetch some very old data and so it is not as fast.

Raw trades vs Aggregate trades

A raw trade is strictly defined as 1 taker and 1 maker trading some quantity at a price, but an aggregate trade is defined as 1 taker, n makers, trading the sum of all the individual raw trade quantities at a price.

For example, a user places a market order to buy 10 BNB for $16.50. The user trades with 3 different makers at the price of $16.50 for 2, 5, and 1 BNB, and then 1 maker at the price of $16.51 for 2 BNB. The raw trades would be:

  1. 2 BNB @ $16.50
  2. 5 BNB @ $16.50
  3. 1 BNB @ $16.50
  4. 2 BNB @ $16.51

The aggregate trades would be:

  1. 8 BNB @ $16.50
  2. 2 BNB @ $16.51

Aggregate trades display the same information in a “compressed” way that sends less data over the network and takes up less space in a UI.

The isBuyerMaker flag

The isBuyerMaker flag is used to convey which side initiated the trade: the buy-side or the sell-side. The side that initiates the trade is the “taker” and the side which was already on the order book is the “maker”. Some trading indicators and algorithms use this data.

  • isBuyerMaker: true => the trade was initiated by the sell-side; the buy-side was the order book already.
  • isBuyerMaker: false => the trade was initiated by the buy-side; the sell-side was the order book already.

“I suppose it means if the buyer is a maker or taker if it is false, to differentiate if the order is limit it will be True and if the order is in market it will be false…”

This is not the case. A market sell will have “isBuyerMaker: true”. Also, limit orders that immediate trade will be the taker order for those trades.

7 Likes