I’ve successfully placed a buy limit order, it has been executed so I am now long SOLANA (say).
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 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;
explictly telling binance to update/refresh my (just like you can do in the GUI).
or
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