How to interprete aggregated trade data?

Hi,

I am currently testing out spot API. I placed an order that trades 10USDT for 0.0002BTC, and I can see that my order is executed from my order history tab like below.


And when I request trade history through Postman, it returns the multiple transactions in JSON like this:

[
{
    "a": 901227218,
    "p": "48832.30000000",
    "q": "0.01367000",
    "f": 1029684907,
    "l": 1029684907,
    "T": 1630267406847,
    "m": true,
    "M": true
},
{
    "a": 901227219,
    "p": "48832.26000000",
    "q": "0.00330000",
    "f": 1029684908,
    "l": 1029684908,
    "T": 1630267406847,
    "m": true,
    "M": true
},
{
    "a": 901227220,
    "p": "48832.02000000",
    "q": "0.00040000",
    "f": 1029684909,
    "l": 1029684909,
    "T": 1630267406847,
    "m": true,
    "M": true
},

After quick googling, I noticed that market orders can be filled with a series of transactions until the total sum of quantity meets the requested amount. However, I have a completely different number which is 20.4494 when I add up quantity (“q”) value from all transactions.

Isn’t it supposed to be the amount of BTC, I bought with 10 USDT?

Also, if I just want to get data that matches exactly the same as the one from the order history tab, which endpoint should I use?

Hi.
I’m not so sure if I understand the question correctly. May I clarify which endpoint did you call, GET /api/v3/aggTrades? If so, this is used to query market data instead of personal records. If you want to check the order history, GET /api/v3/order is what you need. ( https://binance-docs.github.io/apidocs/spot/en/#query-order-user_data )