When calling depositCreditForMarket
, the engine can deposit USD, USDC, or another asset. If the deposited asset is USDC, the function settleCreditDeposit
is triggered. However, this function incorrectly decreases realizedDebtUsdPerVaultShare
, even when the credit is not actually settled.
The settleCreditDeposit
function is responsible for updating the USDC credit per vault share and adjusting the realized debt per vault share.
When USDC is deposited, the function incorrectly reduces realizedDebtUsdPerVaultShare
, even though no actual credit settlement has occurred.
This can lead to incorrect debt calculations, making it appear as if debt has been reduced when, in reality, it has not.
Incorrect debt reduction – The system incorrectly assumes that some of the debt has been settled.
Risk of over-crediting – The system might allow excess credit, based on an incorrect assumption of available funds.
Manual review
To ensure that realizedDebtUsdPerVaultShare
is only adjusted when a valid settlement occurs, update the settleCreditDeposit
function as follows:
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.