-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
amountIn calculation formula bug #125
Comments
division in solidity takes the floor value, to compensate that loss in decimal, they are adding 1. |
Should the formula for getAmountIn look like this?:
|
I´m also having a similar issue in that whenever I perform getAmountsIn, the amountRequired ALWAYS supersedes the amountReceived via swapXXX function. Any ideas as to why is this happening? |
This would result in an ever worse amountRequired value over the amountReceived after a swap |
hey,
Based on getAmountOut formula, we should not use 'add(1)' to calculate amountIn value.
But I find that getAmountIn function use 'add(1)' to calculate amountIn , I do not know why.
maybe its a bug ? .
Expecting your reply !
The text was updated successfully, but these errors were encountered: