Hey guys,
I’m getting inconsistent data when I query the API for aggTrades versus when I connect to the Websocket stream for the same symbol!
For example here’s the API response for DATAUSDT
aggTrades [/api/v3/aggTrades]
:
[{'a': 82505, 'p': '0.04699000', 'q': '1489.60000000', 'f': 82537, 'l': 82537, 'T': 1704676515756, 'm': False, 'M': True}, {'a': 82506, 'p': '0.04700000', 'q': '5425.60000000', 'f': 82538, 'l': 82538, 'T': 1704676515756, 'm': False, 'M': True}]
And here’s the one from Websocket stream [wss://stream.binance.com:9443/ws/datausdt@aggTrade]
:
{'e': 'aggTrade', 'E': 1704676539567, 's': 'DATAUSDT', 'a': 23123165, 'p': '0.04708000', 'q': '1570.00000000', 'f': 31496080, 'l': 31496082, 'T': 1704676539566, 'm': True, 'M': True}
Notice the key “a” representing the aggtrade_id
in the data! They are way off!