January 31, 2019 at 9:54 am #5697
I think there is something not quite right with the available balance calculations and how it works and affects the exchange.
I have started off with blank exchange with no trades on and then proceeded to add some trades.
BTC Balance shows correctly then I add a buy order, all good so far.
Now I place that order and this is the result, all good so far.
Now I place another order on the same pair, all still ok here.
Now I go to another coin to place a new order.
On submitting this order everything starts to go wrong from here, the btc amount deducted from available balance is off by a zero, it is deducting 0.0002003 instead of 0.002003 and shows no errors.
Now I go to another coin to place another buy order.
After completing this last order I end up with B-1.86108917 ($-6416.77)
Please let me know if you need more info to help find the problem?
MeganJanuary 31, 2019 at 12:40 pm #5708
Thank you for reporting this. And I appreciate the detailed screenshots.
I will investigate immediately, as I believe that this is one of the last significant errors with the exchange.
Hopefully I will have a better reply soon.
In the meantime, could you please confirm that you are using
4.0.xof wallets and
0.6.0-betaof the Exchange?
thanksJanuary 31, 2019 at 12:58 pm #5709
All latest plugins.
I also thought maybe it was becuase i was cross trading coins with each other, but then changed to only have the coins against BTC but resulted same errors.
Alt Coins Adapter: by Alex Georgiou – 0.1.0 Bitcoin and Altcoin Wallets: Exchange extension by dashed-slug – 0.6.0-beta Bitcoin and Altcoin Wallets: Full Node Multi Coin Adapter extension by dashed-slug – 1.0.5 Bitcoin and Altcoin Wallets: WooCommerce Cryptocurrency Payment Gateway by dashed-slug – 2.0.0 Bitcoin and Altcoin Wallets: by dashed-slug – 4.0.0
Let me know if you need anything else.
Just a note I also tried with all plugins disabled and on default wp template and still got the same issue.
MeganJanuary 31, 2019 at 7:04 pm #5722
(I would have liked to reply to you sooner but I spent all day assisting people who faced memory issues with the latest update, causing the cron jobs to not run in some cases. Version
4.0.1solves most of these issues but in certain server configurations with multiple external wallets there can be problems. Fortunately there is now a way to debug these issues. I noticed that you have enabled a few coins yourslef, so if you detect any such problems, let me know.)
As for your issue with the exchange, the error is mine. I have made a mistake that I will correct in the next patch. I am a bit surprised that I never saw any error message, but somehow this went undetected.
Perhaps you could apply the fix to your code directly, and tell me if this is enough to solve the problem you encountered:
1357, it now reads:
SUM( amount - filled ) * rate AS a
This is obviously a mistake that can cause a MySQL error 1140, and can therefore cause the available balance calculation to be wrong.
The correct expression would be:
SUM( ( amount - filled ) * rate ) AS a
If you can, please edit your code and see if the problem is resolved.
As always I appreciate very much your help in spotting this.
with regardsJanuary 31, 2019 at 7:06 pm #5723
I will apply patch and see it it resolves the issue 🙂
I will feedback as soon as tested.
MeganJanuary 31, 2019 at 7:33 pm #5724
Ok, I have tested all coins against BTC and available BTC balances calculated correctly 🙂
I will now go setup everything again and try trades across the coins to see if they also work and balance correclty.
Will let you know as soon as tested.January 31, 2019 at 8:44 pm #5725
Your patch seems to have worked.
I have now tested across all coin pairs and all the balances look to be calculating correctly now 🙂
If I do find any further issues with the balances I will revert back 🙂
MeganFebruary 1, 2019 at 8:14 am #5729
Helo Megan, that’s great news! I will release a patch for the exchange extension with only this fix for now.
with regardsFebruary 1, 2019 at 8:36 am #5731
I have maybe found another small glitch with prices of one coin on the exchange rates shortcodes, not sure if it’s related, will open new thread shortly.
You must be logged in to reply to this topic.