Hello,
I've noticed that there isn't a websocket stream similar to
info = client.get_account()
Basically I want a constant update on available Asset Balances but the API takes to much time.
In the official API docs i found a user data stream;
https://github.com/binance-exchange/binance-official-api-docs/blob/master/user-data-stream.md
It is called the outboundAccountInfo
Since I am not that familiar with API wrappers, how can I implement this stream? What has to be considered?
regards
It's the user socket. It doesn't return anything until something changes (so you gotta use get_account at least once), but then it returns both the change (e.g. a placed or cancelled or filled order) and then also your account info (same as get_account, but with one-letter shortened keys) which includes the now updated balances, both free and locked.
I see so there is no other way to get my asset balances without risking time.
Thanks for clearing that up!
I'm not sure what you mean by risking time. You can start the websocket first, then initialize the balances through the REST API, then update it whenever you get an update through the socket, which happens within a split second of an order fill. All updates, including the REST API result, are timestamped, so you can always know which result is more fresh (e.g. if you get a websocket response after you sent the REST API request but before the response arrived.)
alright will try that thanks !
Most helpful comment
I'm not sure what you mean by risking time. You can start the websocket first, then initialize the balances through the REST API, then update it whenever you get an update through the socket, which happens within a split second of an order fill. All updates, including the REST API result, are timestamped, so you can always know which result is more fresh (e.g. if you get a websocket response after you sent the REST API request but before the response arrived.)