Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Funds not Adding Funds #53

Open
simonwhybrow opened this issue Sep 27, 2024 · 17 comments
Open

Add Funds not Adding Funds #53

simonwhybrow opened this issue Sep 27, 2024 · 17 comments

Comments

@simonwhybrow
Copy link

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
@3cqs-coder
Copy link
Owner

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?

@simonwhybrow
Copy link
Author

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).

@3cqs-coder
Copy link
Owner

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?

@simonwhybrow
Copy link
Author

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.

@3cqs-coder
Copy link
Owner

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?

@simonwhybrow
Copy link
Author

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.

@3cqs-coder
Copy link
Owner

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.

@simonwhybrow
Copy link
Author

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?

@3cqs-coder
Copy link
Owner

3cqs-coder commented Oct 1, 2024

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.

@simonwhybrow
Copy link
Author

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.

@3cqs-coder
Copy link
Owner

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.

@simonwhybrow
Copy link
Author

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
Copy link
Author

simonwhybrow commented Oct 3, 2024

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??

@3cqs-coder
Copy link
Owner

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.

@simonwhybrow
Copy link
Author

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.

@3cqs-coder
Copy link
Owner

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 :).

@simonwhybrow
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants