Fast Khaki Raccoon
Medium
No slippage upon withdrawing from LendingAssetVault
will result in a loss for the withdrawer
Upon withdrawing from LendingAssetVault
, we have this code:
function withdraw(uint256 _assets, address _receiver, address _owner) external override returns (uint256 _shares) {
_updateInterestAndMdInAllVaults(address(0));
_shares = convertToShares(_assets);
_withdraw(_shares, _assets, _owner, _msgSender(), _receiver);
}
As seen, there is no slippage which will cause a user to receive less than expected in a certain case.
No response
No response
- User wants to withdraw his 100 shares and expects to receive 100 assets in return
- While his transaction is in the mempool, there is a bad debt liquidation in the underlying pair (
FraxlendPair
) - Instead of receiving 100 assets, he only receives 50 as the share value went down due to step 2
Users receive less than expected
No response
Allow users to provide the minimum amount of assets they are willing to receive