Closed sherlock-admin closed 1 year ago
Valid, some cool down can be implemented. However, with stable/stable exchanges (esp USDC/DAI) we would go via the Maker PSM which has no slippage and is guaranteed to be 1-1. Also, vault capacities are capped so we would know ahead of time what our max trading amount would be.
This is a separate issue from #105 . Would say this is confirmed but low severity
xiaoming90
medium
No Settlement Cooldown On
CrossCurrencyfCashVault
Summary
The settlement cooldown was not implemented on the CrossCurrencyfCashVault.
Vulnerability Detail
The Boosted3TokenAuraVault and MetaStable2TokenAuraVault vaults implement a cooldown to give some time between settlements to give the market time to arbitrage back into position as per the comments in
SettlementUtils
contract.https://github.com/sherlock-audit/2022-09-notional/blob/main/leveraged-vaults/contracts/vaults/balancer/internal/settlement/SettlementUtils.sol#L50
The following shows that the settlement cooldown is implemented on Boosted3TokenAuraVault and MetaStable2TokenAuraVault vaults.
https://github.com/sherlock-audit/2022-09-notional/blob/main/leveraged-vaults/contracts/vaults/Boosted3TokenAuraVault.sol#L100
https://github.com/sherlock-audit/2022-09-notional/blob/main/leveraged-vaults/contracts/vaults/MetaStable2TokenAuraVault.sol#L105
During the settlement of CrossCurrencyfCashVault vault (USDC/DAI), a large amount of DAI will be traded for USDC in the open market to repay the debt. However, the cooldown feature is not implemented on the CrossCurrencyfCashVault vault gives the market time to arbitrage back into position before the next settlement starts. It is expected that the leverage vault will be trading with a large amount of DAI as the amount of DAI to be traded is a combination of all the vault users' leveraged assets. Thus, it will likely cause a swing in the market price.
https://github.com/sherlock-audit/2022-09-notional/blob/main/leveraged-vaults/contracts/vaults/CrossCurrencyfCashVault.sol#L121
Impact
Time is required between settlements to give the market time to arbitrage back into position after a settlement has occurred. If not, the next settlement will be executed with significant slippage.
Code Snippet
https://github.com/sherlock-audit/2022-09-notional/blob/main/leveraged-vaults/contracts/vaults/balancer/internal/settlement/SettlementUtils.sol#L50 https://github.com/sherlock-audit/2022-09-notional/blob/main/leveraged-vaults/contracts/vaults/Boosted3TokenAuraVault.sol#L100 https://github.com/sherlock-audit/2022-09-notional/blob/main/leveraged-vaults/contracts/vaults/MetaStable2TokenAuraVault.sol#L105 https://github.com/sherlock-audit/2022-09-notional/blob/main/leveraged-vaults/contracts/vaults/CrossCurrencyfCashVault.sol#L121
Tool used
Manual Review
Recommendation
It is recommended to implement a settlement cooldown on the CrossCurrencyfCashVault vault, similar to what has been implemented on Boosted3TokenAuraVault and MetaStable2TokenAuraVault vaults.