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

Price Discrepancies between DEX UI and SIfchainJS #740

Open
lufa23 opened this issue Sep 1, 2022 · 4 comments
Open

Price Discrepancies between DEX UI and SIfchainJS #740

lufa23 opened this issue Sep 1, 2022 · 4 comments
Assignees
Labels
bug Something isn't working Front End Team

Comments

@lufa23
Copy link
Contributor

lufa23 commented Sep 1, 2022

Current behavior
Price Discrepancies between SifchainJS and DEX UI. Price discrepancies are higher if the price impact is higher (for example when swapping in low-depth pools).
Expected behavior

  • Use the DEX UI to perform a swap and get the same exact price than with using the SIfchainJS

Steps to reproduce

  • Use the DEX UI and get to the swap screen, specifying the amount of token A that you want to swap
  • Check how many token B amount will be received for that token A amount
  • Note down the expected prices (and the minimum received field)
  • Try the above with different pools
  • Compare the results with the results from using the SIfchainJS

What tokens are you interacting with when this issue occurs?
All tokens. Price differences are higher when Price Impact is higher

VIDEO

5432345432_gd5NGSO4.mov
@lufa23 lufa23 added bug Something isn't working Front End Team labels Sep 1, 2022
@lufa23
Copy link
Contributor Author

lufa23 commented Sep 13, 2022

another user witnessed a similar issue:

Testing the SifchainJS docs, and trying to run the code for the function simulateSwap, the output received from signingClient.simulateSwap() is:
minimumReceiving for 1 rowan -> usdc is 0 as per sample code by querying console.log("Min Receiving: ", swap.minimumReceiving.toString());

Screenshot_2022-09-13_at_3 48 25_PM

Screenshot_2022-09-13_at_3 40 30_PM

From the UI, the user i expecting at least 0.003855 USDC -> 3855 (6 decimal places)

@lufa23
Copy link
Contributor Author

lufa23 commented Oct 3, 2022

hey guys we got another feedback regarding this, as it is mentioned that last version introduced results that are very off.. can you check on this?

@lufa23 lufa23 unassigned tien Oct 4, 2022
@lufa23
Copy link
Contributor Author

lufa23 commented Oct 8, 2022

the second user is providing more information:
Same time, in the case of version 0833b21 gives a result(discrepant from the UI), in the case of the latest version (1.0.0) the result is 0
s1.png
s3.png
s2.png

Anyways the version 0833b21 gives a result different from the UI.

s3.png

@lufa23
Copy link
Contributor Author

lufa23 commented Oct 8, 2022

As we don't provide backwards compatibility, we will focus on understanding why on version 1.0.0 getting the simulateSwap gives result that is 0 (or a discrepant number, depending on the pools)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Front End Team
Projects
None yet
Development

No branches or pull requests

3 participants