high

There is no incentive to liquidate small positions

Reward

Total

4514.29 USDC

1327.73 USDC
1327.73 USDC
Selected
1858.82 USDC
Selected Submission

There is no incentive to liquidate small positions

Severity

High Risk

Relevant GitHub Links

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/d1c5501aa79320ca0aeaa73f47f0dbc88c7b77e2/src/DSCEngine.sol#L229-L262

Summary

there is no incentive to liquidate low value accounts such as 5$ usd value accounts because of gas cost

Vulnerability Details

Liquidators liquidate users for the profit they can make. If there is no profit to be made than there will be no one to call the liquidate function. For example an account has 6$ worth of collateral and has 4 DSC minted. This user is undercollateralized and must be liquidated in order to ensure that the protocol remains overcollateralized. Because the value of the account is so low, after gas costs, liquidators will not make a profit liquidating this user. In the end these low value accounts will never get liquidating, leaving the protocol with bad debt and can even cause the protocol to be undercollateralized with enough small value accounts being underwater.

Impact

The protocol can be undercollateralized potentially not allowing users to redeem their DSC for its value, complete loss of funds.

Tools Used

manual review

Recommendations

A potential fix could be to only allow users to mint DSC if their collateral value is past a certain threshold.