Once a user enter liquidation state isUnderLiquidation[userAddress] = true
, the only way to get out of liquidation is by calling closeLiquidation()
. This function check if user has no more debt left. So it's impossible for a user to partially reimburse his debt, he has to fully reimburse it.
The issue here is that a user can still be unfairly liquidated if he partially reimburse his debt using repay()
.
finalizeLiquidation()
doesn't check the healthRatio
of a user before liquidation. As we deal with NFTs representing houses, the value of debts taken against will be extensive. Not allowing users to partially repay to avoid liquidation is unfair and can lead to improper liquidation
userA deposit NFT, with a home value of 100_000$
userA borrows 70_000$ against it.
market event, NFT drops in value to 80_000$
userA enter liquidation state (80_000*0.8 = 64_000$) -> healtRatio = 0.91
userA repay 10_000$, debt is now 60000 -> healtRatio = 1.06, before gracePeriod
userA tries to closeLiquidation()
, it will revert as userA needs to repay his debt fully
gracePeriod pass, userA is liquidated by finalizeLiquidation()
and loses his NFT/ home property unfairly
The way the liquidation state is managed makes it impossible for users to avoid unfair liquidation. A user should be able to partially repay his loans to avoid liquidation. This is exacerbated by the fact that in RAAC, users borrow against home values, which are most of the time high values. If there is a small drop in the housing market, users may not 80% of the value of the home at hand to fully repay their loans.
Manual
closeLiquidation()
and finalizeLiquidation()
should check the healthFactor of users to avoid unfair liquidation:
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.