Take a look at SmartVaultV3.sol#L206-L212
As seen, for swaps to be processed the value of the minimum amount out is calculated on-chain and in a case where the collateral value mins swap fee is less than the required collateral value, the min amount out value is set to 0, otherwise this value is directly set to requiredCollateralValue - collateralValueMinusSwapValue
now this traslates to protocol setting a 0% percent slippage for swap attempts, which goes against the idea of slippage and might lead to reverts in the attempt to swap.
Slippage being hardcoded, completely breaks logic of "slippage" and in some cases would cause reverts to occur while a swap is being attempted.
Manual Review
Slippage value should always be calculated or queried off chain, i.e the value should be passed in on the attempt to swap and then this value can then be checked agains t to see if it's equal to or less than requiredCollateralValue - collateralValueMinusSwapValue
, this way the slippage is not hardcoded to 0
and can be set to whatever.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.