The liquidation process only considers the current price, while the borrowing process takes the average price over the last 4 hours. This can result in burning an insufficient amount of EUROs.
The current price is used in LiquidationPool
in distributeAssets()
function:
However, in smartVaultV3
in the euroCollateral()
function, the price is an average of the last 4 hours calculated by the PriceCalculator.
If Alice has minted 30,000 euros, she has 33,000 euros in collateral. Her collateral has lost value and she now has only 30,000 euros in collateral. However, this value is an average, and if the value of her collateral with the latest price is 20,000 euros, only 20,000 euros will be burned.
This will cause the euro to depeg since, until now, the euro is supposed to be pegged to the average value of the collaterals.
Manuel review
Check in the distributeAssets()
function the average price and not the latest price.
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.