-
Notifications
You must be signed in to change notification settings - Fork 103
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
fix: spot prices display edge cases #5311
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
9281e75
to
6ea2d80
Compare
6ea2d80
to
9bb7b67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the issue? I can see the operation is more compact, but the old code reads correct to me. Are we not handling something we should in inputFraction.divide(outputFraction)
?
In some cases, the fraction ended up with huge numbers, without needing to. For example: 100000/200000 is equivalent to 1/2, but the fraction representation was using 100000 instead of 1 (but with lot more zeros in the real case). See https://docs.uniswap.org/sdk/core/reference/classes/Fraction and https://github.com/Uniswap/sdk-core/blob/9997e88/src/entities/fractions/fraction.ts#L154 Although, that's a good question. @elena-zh did that work for tokens with different decimals? Keep in mind USDC on Sepolia has 18. |
@alfetopito Opened this task to address it |
New attempt to fix it at #5317 |
Summary
Fix issue when sometimes spot/market prices are not loaded
To Test