15,000 USDC
View results
Submission Details
Severity: high

Wasted lost collateral tokens at liquidation

Summary

Liquidations result in collateral tokens being lost to the protocol

Vulnerability Details

DSCEngine.sol line 229 will calculate amount of token including bonus paid to liquidator. We will show below with case where liquidator is repaying all the amount of debt

Let At start liquidated account deposits and mints max amount stablecoin at the health factor:
If price falls below this value this user can be liquidated.
collaterizationFactor = 1.5
Price Collateral Asset WETH = wethPrice
Amount WETH deposited = wethAmount
Amount Minted Max = amountDSCMinted = (wethPrice * wethAmount) / 1.5 //PART A

Let price of WETH fall by factor g from its original price 0<g<1 newPrice = wethPrice*g

Liquidator comes in to repay all debt owing of this user = amountDSCMinted
The amount collateral they can get = amountDSCMinted / newPrice = amountDSCMinted / (wethPriceg)
Add the 10% bonus so they get 1.1 factor -> amount collateral can get = (1.1 * amountDSCMinted )/ (wethPrice
g)

Remaining Collateral = Start Collateral - Amount Collateral Can Get
= wethAmount - ((1.1 * amountDSCMinted)/ (wethPrice * g)) //replace amountDSCMinted with partA
= wethAmount - ((1.1* (wetHPricewethAmount)/1.5) / wethPriceg)
= wethAmount - wethAmount * (1.1 * g /1.5)
= wethAmount( 1 - 0.733333*g)
since 0<g<1 Remaining collateral you can see can never be 0 implying every liquidation at current parameters of bonus, collateralRatio etc will lead to some collateral left behind in protocol which does not have any functionality to move or use these tokens

Assume price changes to a factor of 0.99 of its original price -> Remaining Amount = wethAmount*0.266666
The above represents about 26% of collateral remaining behind and being wasted

Impact

High: This is wastage of value, capital inefficient, locks tokens of value in the protocol that could have been made useful in other ways

Tools Used

Manual Analysis

Recommendations

It is recommended that this is well documented and understood by users
It is recommended these remaining amounts of collateral on liquidation maybe add to treasury
It is recommended these remnant collateral be transfered/paid to the unhealthy lawn owner in liquidation

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.