SmartVaultV3:swap
function can have slippage protection of 0 if the user collateral excluding the swap fund is enough to cover the debt, this can result in the loss of the user collateral because of a sandwich attack.
In smartVaultV3
, users can exchange their collateral for another supported asset to avoid liquidation. This option is useful when they expect the value of their original collateral to decrease soon.
The swapping is done using uniswapV3, and the amountOutMinimum
is set to 0 if the total user collateral minus the swap amount is sufficient to cover the user debt and prevent liquidation.
While this is acceptable for the protocol but setting 100% as a slippage makes it an easy target for MEV bots, they can easily manipulate the transaction and return 0 as the received token, resulting in the loss of the user's collateral.
Link to how this type of attack works:
https://medium.com/coinmonks/defi-sandwich-attack-explain-776f6f43b2fd
User swap 100 LINK to ETH where slippage is set to 0
Due to the sandwich attack, the user will receive 0 ETH
his 100 LINK is lost
Users will lose their tokens and can be easily liquidated if the remaining collateral value falls even a small amount.
Manual review
Allow the user to set the amoutOutMinimum, instead of protocol doing that, because if a user is swapping he may be aware of the possible output.
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.