Continuing the discussion from fromId error in myTrades:
Hello dino.
I read a topic where you have answer.
What is my goal - I want to have full info what was happend with my XML.
Would you like to explain me how to fix this problematic situation. When I fetch data from allOrders i got XLM with orderID=12867665 - it is first order on this asset.
symbol orderId orderListId clientOrderId price origQty executedQty cummulativeQuoteQty status timeInForce type side stopPrice icebergQty time updateTime isWorking origQuoteOrderQty asset
153 XLMBNB 12867665 -1 and_0f93157b1e5743728a35981efebc35fd 0.028200 46.100000 46.100000 1.298637 FILLED GTC LIMIT BUY 0.0 0.0 1542275559627 1542275559627 True 0.000000 XLM
When i want to find more details i query myTrades. That is answer from a query with only symbol.
symbol id orderId orderListId price qty quoteQty commission commissionAsset time isBuyer isMaker isBestMatch asset
0 XLMBNB 1252140 12867665 -1 0.028170 46.100000 1.29863700 9.722100e-04 BNB 1542275559627 True False True XLM
1 XLMBNB 1253774 12868297 -1 0.029600 46.100000 1.36456000 1.023420e-03 BNB 1542325206629 False True True XLM
2 XLMBNB 1265156 13051006 -1 0.032190 129.400000 4.16538600 3.117680e-03 BNB 1542702116239 True True True XLM
Everything is working fine, because i have less than 500 orders and less than 500 trades.
When i (suppose) will do the same in the future - for example after 5 years.
How should i ask api about my trades XML with tradeID=12867665?
It is a little bit complicated because in future i can have for example 100000 orders and 500000 trades for this orders.
I checked on https://binance-docs.github.io/apidocs/spot/en/#current-open-orders-user_data
and
GET /api/v3/allOrders (HMAC SHA256)
has orderId as input not mandatory parametr
I checked also on https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
and
GET /api/v3/myTrades (HMAC SHA256)
has fromId parametr wiht description TradeId to fetch from. Default gets most recent trades
Because both api have ID but one have fromId
second fromId
and both with the same description
fromId LONG NO TradeId to fetch from. Default gets most recent trades.
It was clear for my that when I have orderId from allOrders i should use it as input parametr in myTrades.
According to description i expected minimum that myTrades return trades with orderID=12867665 or all trades which was executed after my trade.
But when i quered myTrades with symbol
and fromId
I got empty list.
Have you solution how to fix it? How deep should i query? Should i query about all trades from ??? and next inside a loops looking for my trades with orderID=12867665 . (for me that is the worst solution).
I am open for discusion.