The root cause of this issue is that debt is accounted negatively. However in order to settle the debt of a vault the function will swap collateral for USDC and further decrease the marketsRealizedDebtUsd
resulting in increasing the debt instead of settling it.
In the settle vault debt for a vault to be in debt the following condition is required:
Here the vaultUnsettledRealizedDebtUsdX18
is the result of the following function:
After the collateral is swapped the following storage update is made:
As a result the getUnsettledRealizedDebt
will now return an even more negative value. This is incorrect as debt should be decreased. In order for it to be decreased the marketsRealizedDebtUsd
should be increased.
The settleVaultsDebt
will actually put the vault in more debt
Manual Review
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.