When a position is liquidated, the PerpetualVault contract permanently sets depositPaused to true, requiring manual intervention to resume deposits. This could lead to extended periods where the vault remains inaccessible to new deposits, impacting system availability.
The issue is in the afterLiquidationExecution function in PerpetualVault.sol (lines 665-683):
When a position is liquidated, the contract sets depositPaused to true but provides no automatic mechanism to reset this state. The only way to resume deposits is for the contract owner to manually call setDepositPaused(false).
If a liquidation occurs and the contract owner does not promptly respond to unpause deposits, users will be unable to deposit into the vault for an extended period. This creates both:
A potential denial of service for new deposits
A dependency on active monitoring and quick response from contract administrators
Potential lost opportunity costs for users who cannot deposit during favorable market conditions
While this doesn't directly risk existing user funds, it could significantly impact the protocol's usability and reliability, especially if liquidations happen during off-hours or periods of high market volatility when administrator response might be delayed.
Manual code review
Implement one of the following options:
Automatic reset of deposit pause after liquidation recovery:
Set a time-based automatic reset:
At minimum, add an event when deposits are paused to improve monitoring:
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.