SymBot icon indicating copy to clipboard operation
SymBot copied to clipboard

Add Funds not Adding Funds

Open simonwhybrow opened this issue 1 year ago • 17 comments
trafficstars

I have a deal that's been open for a while now. I've successfully manually added funds to the deal a while back when we were going through the dip and eventually it got even worse and placed all safety orders. Ever since I've not been able to add funds manually to the deal. It say's it's been successful, but I can't see any transaction on the exchange. I thought it might be because it had reached it's limit of safety orders so tried changing that, but it wouldn't let me through the GUI, so did it directly in the database, but it still wont actually add the funds.

Screenshot 2024-09-27 at 11 13 11 Screenshot 2024-09-27 at 11 15 53

simonwhybrow avatar Sep 27 '24 10:09 simonwhybrow

Thank you for reporting. A few things to check:

  • Do you seeing anything in the logs that shows something like "BUY SUCCESS" at the time of adding funds or any error messages?
  • Is the bot you're using not listed as sandbox mode in the DCA Bots web interface?
  • Does your bot.json configuration file have the right exchange and credentials set for the deal?

3cqs-coder avatar Sep 27 '24 13:09 3cqs-coder

So i don't see anything in the logs for "BUY SUCCESS". I see a stop request for the deal, then an add funds to deal is requested and straight after the deal is resumed.

Just to confirm the bot is not listed as sandbox mode and the exchange credentials are fine (I've been able to add funds to another deal).

simonwhybrow avatar Sep 27 '24 15:09 simonwhybrow

Thanks for the detail. Are you running the latest version of SymBot? If so, when you added funds to another deal was that using a previous version or the latest?

3cqs-coder avatar Sep 27 '24 15:09 3cqs-coder

Yep, upgraded the latest version last night to see if it fixed this odd issue. Unfortunately it didn't.

I added funds to another deal after the upgrade.

simonwhybrow avatar Sep 27 '24 15:09 simonwhybrow

Ok, to confirm, when you added funds to another deal using the latest version, the order was successfully placed on the exchange? Are you able to see the manual buy order in the logs to also confirm the manual order was placed via SymBot?

3cqs-coder avatar Sep 27 '24 16:09 3cqs-coder

Yep, order was successfully placed on the exchange and has to have been done by SymBot as I've not got any other app automatically trading for me. I can also see a BUY SUCCESS in the logs.

It's very odd! I can only think I've broken some logic somewhere when adjusting the safety orders and placing the manual trade in the past on this deal.

simonwhybrow avatar Sep 27 '24 17:09 simonwhybrow

There is now a new SymBot branch called "hub" that contains some improved exchange connectivity tracking along with add funds logic. This may address the issue you're experiencing if you want to try that version.

3cqs-coder avatar Sep 28 '24 12:09 3cqs-coder

Sorry, been away for the weekend. Will see if I can try the hub branch to see if this fixes this issue. Is it possible to switch back to the main branch if it doesn't?

simonwhybrow avatar Oct 01 '24 19:10 simonwhybrow

You should be able to since there are no database or app configuration changes between the two branches. Making a database backup periodically from the System Tools menu in SymBot is also highly recommended.

3cqs-coder avatar Oct 01 '24 22:10 3cqs-coder

Hey @3cqs-coder, finally had time to switch over to the hub branch and tried adding funds again, but afraid it's exactly the same. Same entries in the log too.

simonwhybrow avatar Oct 03 '24 17:10 simonwhybrow

Hey, if your logs aren't showing any buy success or failed messages, then something must be telling SymBot that your bot or the deal in question is a sandbox deal. A few things to check:

  1. Was the bot your deal started on ever a sandbox (paper) bot? Once a bot is created as real / sandbox it should stay that way unless something has altered the database.
  2. Is your bot.json config file set to sandBox: true? If so, that may skip talking to the exchange when adding funds.
  3. You also mentioned accessing the database directly. Are you able to see if that deal's config object has sandBox: true? If so, that would be why the exchange is not being called when adding funds.

The logic to actually send the order to the exchange or not when adding funds is pretty simple since it just checks the sandBox flag, so unfortunately unable to replicate the issue so far.

3cqs-coder avatar Oct 03 '24 18:10 3cqs-coder

Hey, cheers for all your help in trying to get to the bottom of this oddity.

The deal wasn't ever started on a sandbox bot and double checked the bot.config and that's all set to sandbox: false.

Also jumped in to the database and checked the deal individually. That also says sandbox false.

It's very odd! I'll play around with a few things to see if I can get it working.

simonwhybrow avatar Oct 03 '24 21:10 simonwhybrow

I can see something funky has gone on in the database with the orderNo values for that particular deal. There were a lot of safety orders and 1 - 69 are fine. They look to be entered as integers.

Order 70 has an orderNo of '70' and 71 has an orderNo of '71' (as opposed to the previous orderNo values not having single quotes round them).

Subsequent orderNo values are then all suffixed with 11 (e.g. 7211, 7311, 7411)

If I can update these back to the correct values would that potentially fix it??

simonwhybrow avatar Oct 03 '24 22:10 simonwhybrow

That is very strange indeed, but hard to say if that will fix the issue of the order not being sent to the exchange. It's possible since those order numbers are so out of range it's not accounting for them as your max safety orders were originally at 69. I would be very cautious altering the database manually, but if you do try it, use a minimum amount to add for testing purposes and make backups.

3cqs-coder avatar Oct 03 '24 22:10 3cqs-coder

How does SymBot decide if a deal is active or not? I can update the database for this specific deal, but when I restart SymBot it says the deal is complete and can see that the database is updated with a sellData block, but no sell is actually placed on the exchange.

simonwhybrow avatar Oct 04 '24 09:10 simonwhybrow

Active deals are tracked by the "status" flag in the deal. 0 = active, 1 = not active. But updating the flag directly in the database will only prevent SymBot from seeing and processing it any further since it thinks the deal is closed. In order for it to actually process the deal and send orders to the exchange you would need to close the deal at market price (panic sell) through the web interface. I would truly caution modifying the database directly though going forward :).

3cqs-coder avatar Oct 04 '24 12:10 3cqs-coder

Hey, yep totally understand. I don't want to play with the database too much at all. I'll have to wait this deal out to see if it eventually closes.

simonwhybrow avatar Oct 04 '24 14:10 simonwhybrow