-
Notifications
You must be signed in to change notification settings - Fork 570
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
[1.5][abitmore] User executed a buy order for the exact sell order and trade is not going through #562
Comments
The OLD rounding issue. The price is not exactly same.
|
This needs to be researched in the UI. We've got to get this right. The PRIVATECAY asset has a fee when tokens are purchased. This might be causing some of the issue. |
This issue has been in discussion long long before, and still on going. Not an easy fix IMHO. |
Seems duplicate of #314? |
The GUI generated both of those first numbers though through clicks. I feel like this is a garbage in / garbage out issue. @xeroc could really use your help on this one as well. I understand that it's a long standing problem, but issues like this are very hard to explain to average people. The GUI calculated the number of shares of PRIVATECAY based upon 2 inputs
Maybe we need to alter the Balance amount so it's evenly divisible forcing the numbers to match evenly. This would allow for the number to remain the same throughout the entire flow (Balance, Qty, Confirmation) |
I think it's related to #497. |
No it's not related to 497, it's the age old of issue of trying to match orders without knowing how the backend actually makes matches, and trying to round amounts correctly when the amounts become inexact due to precisions. |
The logic in the back end is simple: the order will match if the bid price is not lower than lowest ask.
Amounts are integers, so, all final calculations SHOULD use the amounts but NOT the prices, since prices are usually float points thus inaccurate. In addition, use multiplications and avoid divisions at least for the final check. //Edit: after reviewed the code and made some tests, I think divisions are probably okay in js, we can leave it unchanged so far. We can try to fix if it started to cause trouble. Related code is here. |
Reproduce:
The key is: when placing a new order, in order to successfully match,
and
The behaviors when inputting amounts are correct because
These lines are incorrect: here, here, here and here. Actually, perhaps we can always call I will submit a PR. |
abit's commit might have solved it, as always with this issue only time will tell.. |
Agreed. We can keep iterating until we catch all the edge cases. Thanks for your work@abitmore |
200 PRIVATECAY for .4 LTC/PRIVATECAY were available for sale. The user clicked on lowest ask and committed all of their OPEN.LTC by clicking on their balance.
As you can see, the trade did not go through.
The intended behavior is that the trade would execute since the buyer offered at the lowest ask. I can leave this order on the books to allow for testing.
The text was updated successfully, but these errors were encountered: