I have decided to accumulate most of my questions & answers to them from telegram chat. It should be helpful for others too, or so I hope.
Quick descriptions of scope: I want to save all the trades & orders data (historical & new) from my user on Binance to Mongo database.
Historical are already saved.
My first idea was that there is some API like ‘all orders for Date’, but you must sending a symbol is required. I guess this is because most users have thousandth of orders per day.
I have tried querying https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data and /apidocs/spot/en/#all-orders-user_data , but having more than 100 active symbols (e.g. ones user use) to check I was quickly going through my API limits.
Now I am going for websockets which are better use for this, namely /apidocs/spot/en/#user-data-streams
If we check the payload on order update /apidocs/spot/en/#payload-order-update it seems that all is there, but I have yet to test it.
Hopefully tomorrow, after tests, I will update this post.
Here are some questions:
- Is my idea right? Is there a better way to do it?
- Will I get all the info from that socket - all that is returned in #all-orders-user_data and all that is returned in #account-trade-list-user_data?
- Additionally I want to get the same info for futures (fapi) with https://binance-docs.github.io/apidocs/futures/en/#event-order-update - will it work too? Why in seven hells the payload structure is different?
I will gladly dive into discussion,
P.S. sorry for cut links - I can’t add more than two in a post.