-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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: Invariant crash when adding liquidity #10661
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
|
3f421f3
to
ac89191
Compare
ac89191
to
68a8233
Compare
tickSpaceLimits?.[Bound.LOWER] !== undefined && | ||
leftPrice && | ||
priceToClosestTick(leftPrice) <= tickSpaceLimits[Bound.LOWER] |
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.
not found crash with the desc link
and if this is issue, we should fixed it by add a division check but not just catch
for example: try check price's denominator !== 0
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.
It happens some of the no-liquidity/not yet created pools with min/max price on the params
https://pancakeswap.finance/add/0xCF18E4ff8433D32d8d2CC17C7674dbAea01DBA63/BNB/100?minPrice=0.000000000000000000&maxPrice=340256786836388094070642339899681172762.184832000000000000
PR-Codex overview
This PR improves error handling in the
RangeSelector
component by wrapping logic intry-catch
blocks. This ensures that if an error occurs during the calculation of price values, the function will return an empty string instead of potentially causing a runtime error.Detailed summary
try-catch
blocks around price calculations forleftPrice
andrightPrice
.tickSpaceLimits
.