Submitted by WatchPug
The current formula to calculate the amountOut for a swap is:
https://github.com/code-423n4/2021-11-vader/blob/429970427b4dc65e37808d7116b9de27e395ce0c/contracts/dex/math/VaderMath.sol#L99-L111
We believe the design (the formula) is wrong and it will result in unexpected and unfavorable outputs.
Specifically, if the amountIn is larger than the reserveIn, the amountOut starts to decrease.
Given:
For the same pool reserves, paying more for less output token is unexpected and unfavorable.
SamSteinGG (Vader) disputed:
alcueca (judge) commented:
SamSteinGG (Vader) commented:
