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

Multiple issues with clearing more than one order at a time from the order books #84

Open
ElectricDosh opened this issue Jun 13, 2021 · 11 comments
Assignees
Labels
bug Something isn't working go live requirement Needed for go live testing Testing required

Comments

@ElectricDosh
Copy link

ElectricDosh commented Jun 13, 2021

I'll use whole numbers and ignore fees for simplicity.

Example: there are 3 orders in the sell book to sell 1 XMR, one for 30 GNTL, one for 40 GNTL, and one for 50 GNTL.
I place a buy order at a price of 50 GNTL and commit a total of 150 GNTL.

Expected behaviour: I receive 3 XMR for 120 GNTL, and leave a buy order in the book for 0.6 XMR for the remaining 30 GNTL at a price of 50 GNTL.
Actual behaviour: I receive 3 XMR and nothing is left over.

In addition, a trade that clears more than one order from the book leaves a massive discrepancy off by several orders of magnitude in the Cost column in the user's trade history. As an example I did a trade that cleared 3 sell orders from the book for a total of ~45 GNTL and the cost shows as 111881.5949 GNTL.

@tylerjohneddy
Copy link
Contributor

When you receive your 3 xmr you get your change in GNTL back too right?

@ElectricDosh
Copy link
Author

When you receive your 3 xmr you get your change in GNTL back too right?

Nope, as far as I can tell the full 150 is taken and nothing is returned. I'll do another test and see what happens on the seller's end.

@ElectricDosh
Copy link
Author

Just tested and the seller does not receive the missing funds, so they're just disappearing.

@BKdilse BKdilse added bug Something isn't working go live requirement Needed for go live labels Jun 15, 2021
@tylerjohneddy
Copy link
Contributor

i think i have fixed this. ill upload the fix soon and post when done

@tylerjohneddy tylerjohneddy added the testing Testing required label Jun 25, 2021
@BKdilse
Copy link
Collaborator

BKdilse commented Jun 25, 2021

@tylerjohneddy this is better, the totals balance out correctly.

1 ARQ selling for 30, 40, 50 GNTL:
Seller receives 120 GNTL, and looses 3 ARQ+Fees
Buyer receives 3 ARQ, and looses 120 GNTL+Fees

My Completed trades does not look correct:
Seller's one looks fine, with 3 orders at correct prices.
Buyer's one looks wrong, with 1 order at price of 50 GNTL.

@BKdilse
Copy link
Collaborator

BKdilse commented Oct 25, 2021

@tylerjohneddy I've Re-tested this.

Seller's balances and Completed trades look good, 3 individual trades shown.

Buyers balances look good, but Completed trades has 1 entry @ Price 50 GNTL, 3 ARQ, 120 GNTL Total. When clicking the order buy (50, 3rd in the list), it showed spend of 150 GNTL, instead of 120 GNTL. DB shows 1st amount of 150 GNTL and price in firstticker of 50 GNTL.

@BKdilse
Copy link
Collaborator

BKdilse commented Nov 8, 2021

As the balances for buyer and seller are correct, this appears to be a display issue. When clicking the order, the total is 150 GNTL, but once trade completes, it shows 120 GNTL.

@tylerjohneddy
Copy link
Contributor

so this is a front end issue? and a backend issue stroing the incorrect values in the DB?

@BKdilse
Copy link
Collaborator

BKdilse commented Nov 8, 2021

Yes looks that way.

@tylerjohneddy
Copy link
Contributor

okay, are you able to look at the front end? and take a image of the issue in the DB and send it over?

@BKdilse
Copy link
Collaborator

BKdilse commented Nov 8, 2021

Seller: 30, 40, 50
image

Buyer clicks last order (50):
image

Seller completed:
image
image

Buyer completed:
image
image

DB:
image

Oh, the Fee wallet gained 0.30 (which is for 150 GNTL and not 120 GNTL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working go live requirement Needed for go live testing Testing required
Projects
None yet
Development

No branches or pull requests

3 participants