When a user increases or decreases liquidity the tokens (fees earned) must be swapped into the correct ratio to reinvest them without having any big dust.
The user will pass the swap amount and the ratio is being verified to make sure the amount can't be manipulated to benefit the user.
The amountOut defines how many tokens out are expected, the parameter will be passed by the user. The user in this case is not a trusted actor of the system, we need to add a verification using a price oracle or similar.
When a user increases or decreases liquidity the tokens (fees earned) must be swapped into the correct ratio to reinvest them without having any big dust.
The user will pass the swap amount and the ratio is being verified to make sure the amount can't be manipulated to benefit the user.
The amountOut defines how many tokens out are expected, the parameter will be passed by the user. The user in this case is not a trusted actor of the system, we need to add a verification using a price oracle or similar.