Some rare tokens have 0 decimals: https://etherscan.io/token/0xcc8fa225d80b9c7d42f96e9570156c65d6caaa25
For these tokens, small losses of precision will be amplified by the lack of decimals.
Consider a constant product pool with 1000 of token0 (with no decimals), and 1000 of token1 (also with no decimals). Suppose I swap n= 1,2,3,4 of token0 to token1. Then my output amount of token1 will be 0,1,2,3.
If token0/1 are valuable than I will be losing 100%, 50%, 33%, 25% of my trade to rounding.
Currently there is no valuable token with 0 decimals, but there may be in the future.
Rounding the final getAmountOut division upwards would fix this.
maxsam4 (Sushi) commented:
