ASAP DCA bot not starting new deals

Bug info:
I’ve a recurring issue and I’d successfully solved it in the past by changing the TP currency and changing it back to force a refresh, but that doesn’t work now. I have to restart the bot which resets the stats and defeats the purpose of not requiring manual intervention.

BTTC/USDT Bot complains that exchange doesn’t have enough balance and so won’t start new deal. Yet, in the balance shown in the currency Reference, there’s clearly more than enough to run the whole deal. I also checked the exchange Balance has more than enough funds available for the deal.

Balance:

Required:

It seems it needs to refresh its connection to the API (is the balance cached somewhere?).

Seems unable to connect to the API as it doesn’t show balances:

Could you please send a patch to fix this?

Anyways, thanks in advance!

  • Note that this error has occurred for other bot for different pairs including SOL/ETH.

  • Bot URL → Gainium app

  • Expected result → Bot should open new deals ASAP.

Thank you for reporting this issue and providing detailed information, including screenshots and references. We’ve received your report and are currently reviewing the situation. It appears the bot might not be syncing with the exchange API properly, potentially causing the balance display and deal-starting issues. We’ll investigate this further and provide an update as soon as possible.

In the meantime, please ensure your API connection is active and has the appropriate permissions for the affected exchange accounts, as this can sometimes contribute to similar issues. We appreciate your patience!

Thanks for sharing the details! It looks like the issue with your BTTC/USDT bot is due to the bot relying on the exchange’s live data to confirm the available free balance (not the total balance), which is likely causing the “not enough balance” error. Based on the information provided, the bot does not use cached data for this check, so it’s entirely dependent on the live free balance reported by your exchange.

If you believe the free balances shown are incorrect for this bot or other bots, feel free to share their details. We’ll take a closer look to ensure everything is functioning as expected.

That can’t be right. I know that the balance reported on the exchange UI is correct. A simple diagnostic is that typically, all it takes is restarting the bot or making a trivial update to the bot settings (like the TP currency) to make it pull the correct data.

It’s not obvious to me that the exchange reported the wrong balance.

I’m only getting AI replies. Is someone actually looking into this?

Same issue on a different bot: Gainium app

I’ve not fixed that yet, so you can take a look and see that funds are clearly available:

This is when I try to edit the bot, even there, the balance clearly exceeds what the bot needs:

The free balance is taking directly from the exchange.
Have you restarted the bot immediately after the error, or it take while?
On the first screenshot you are showing BTC balance and the errors, but the error was 7 hours ago, and balance is what we can see now.

Well, nothing should’ve changed since this exchange account is managed exclusively by Gainium and the bots have dedicated assets. So, if the bot is looking to start a new deal after closing a deal, it should have exactly all the assets available to it in the previous deal.

My point is that the time interval is irrelevant in this case. At any rate, even if the funds were unavailable because they’re tied up in a deal, then the bot shouldn’t be looking to start another deal.

Any chance the balance check is happening before the funds from the last deal have become available?

This might be on some exchange, but binance not among them.

So, what is the problem? I’m sure it’s not the case that the assets aren’t on the exchange. Please look into it further. My guess is the response is being cached somewhere - maybe by the exchange API itself.

Looking deeper into logs on the exchange and on Gainium:

The deal was closed at 02:53 this morning.

Exchange log:

As you can see on the exchange above, nothing else occurred on that account until the next BO order came in (after I tweaked a bot setting to force it to restart). This means the sold assets were immediately available for the next deal but for some reason, the gainium bot wrongly complained that there wasn’t enough balance.

In any case, it should be clear that the balance on the exchange is greater than what is reported by Gainium after the deal was closed.

Gainium logs:

Can you add retry logic for checking the balance for stalled ASAP bots? I understand that’s an architectural change and may take some time.

As a stop gap, can an email notification be sent to notify of bot errors? Better yet, is there a Telegram integration or other means of mobile notification?

I checked the bot, balance check happened after order canceled and TP filled. Usually that time enough to unfreeze assets. At least its not known problem in Binance.
Bot doesn’t calculate anything, it only compare free coin amount with required.

We have and option to skip balance check. It was only for futures, now I added it all types of exchanges. You will see it in Strategy section after update.

Notifications are available, both telegram and email. Check settings page.

2 Likes

Thanks for the fix. Would be good if we didn’t have to disable such an important feature to get the bots to work. Would you be willing to develop a feature to automatically rescue ASAP bots complaining of insufficient funds – maybe check every hour for fund availability?

Does that have to be a feature request?

P.S. What is that Planned field in the Gainium portfolio table? Think it has something to do with the error?