delay between execution and wallet update

hi,

Using python API:

  1. I’ve successfully placed a buy limit order, it has been executed so I am now long SOLANA (say).

  2. I immediately want to place a stop_limit_order (as I now OWN the SOLANA as executed above).

However, after I get the order status as FILLED (from 1 above), 2) fails as it tells me I dont have sufficient funds to do so. However I definitely do. If I use the “refresh wallet” button in the GUI, the SOLANA are immediately available, however I obviously cannot use that from the API.

Is there a means to programmatically “refresh wallet” or the equivalent, such that once I OWN the SOLANA in 1) above, I can proceed to 2) (sell the same SOLANA) without any issues. Seems like an API call is needed to do the refresh but I can’t find it.

Thanks much,

Graham

https://binance-docs.github.io/apidocs/spot/en/#account-information-user_data

You can use the endpoint above to check if you own the asset before placing an order.

Hi Chai,

thanks but thats not what I need. When I buy an asset and it is executed, the asset doesn’t immediately appear in my wallet (it should !). Instead there is an arbitrary delay between execution (I now HOLD Solana, say) and my being able to actually sell it.

If I use the approach above I have to poll the binance endpoint periodically (recall that I cannot issue too many requests to binance or I will get kicked off, calls are limited). So what I actually need is some means of either;

  1. explictly telling binance to update/refresh my (just like you can do in the GUI).
    or
  2. having some sort of asynchronous listener that is invoked when a wallet update happens.

Both of these approaches will prevent me from polling binance. Polling is evil and wrong and will eventually get me thrown off binance, even if I put large sleep times in there. Bear in mind that this is an automated trader so it will be running 24/7

Thanks much

Graham

https://binance-docs.github.io/apidocs/spot/en/#payload-account-update

The user data stream listens to your account via websocket. Any updates to your account will be pushed via this stream.

Thanks for that, do you have any examples of that in use?

regards

Graham