Slippage setting #2945
Unanswered
daron4ever
asked this question in
Q&A
Replies: 1 comment
-
This should have been opened as a discussion, not an exceptional issue. You can either re-arrange your maths to prevent underflow (or mitigate it earlier in evaluation) or use fixed-point maths, using the For 0.5% slipage, I would use a formula akin to: amountOutMin = amounts[1].sub(amounts[1].mul(995).div(1000)); But the FixedNumber class, while more complex is also more advanced if you need more dynamic values and don't want to deal with figuring out the significant digits yourself. It is also useful if you wish to compound other operations. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe your Issue
We normally use the following snippets to get slippage.
But I have the error when I use decimal slippage such as 0.5%
Anyways to pass the slippage with a decimal point?
This is an exception issue
Beta Was this translation helpful? Give feedback.
All reactions