Solidity does not have floating-point math, all fractional calculations are done with fixed-point math, meaning that when the amounts are very small, rounding errors become huge. Specifically in the example, USDC ERC-20 token only has 6 decimals, so the 0.000001 USDC value is the smallest value possible - one micro-USDC to be exact.
In order to compute the result amounts in a swap from
x, formulas 6.11 and 6.12 from the whitepaper are used:
Gamma is the fee paid by the swappers, for example 0.003. In your example then input token is USDC. In the implementation of the
delta y calculation, the fee term is rounded up, meaning it can never be zero.
y_in = 100 micro-USDC, the expected fee amount is computed by the frontend as 0.3 micro-USDC, but you actually end up paying 1 micro-USD, leading to 1.0 - 0.3 = 0.7% price impact.
y_in = 10 micro-USDC, the 1 micro-USDC fee is 10% of the input value, so it shows as nearly 10% price impact.
y_in = 1 micro-USDC, the 1 micro-USDC fee is 100% of the input amount, so it shows as nearly 100% price impact. Moreover, you'll get zero wei in the output because all of the input is "eaten" away by the fee!
On the other hand, when
y_in = 1000 the expected fee is exactly 3.0 micro-USDC, so there are no rounding errors.