Moonwell

Moonwell
DeFiFoundry
15,000 USDC
View results
Submission Details
Severity: medium
Invalid

No incentive to liquidate undercollateralized users could result in protocol going underwater

Summary

Liquidation is the process of selling assets that have been used as collateral to repay a debt when a borrower fails to meet their loan obligations.
To minimize the risk of liquidation, borrowers should regularly monitor their Credit Remaining. It is crucial to ensure that the Credit Remaining is greater than a value of $0 and remains above 0%.

According to Moonwell Docs, one of the factors that affect Credit is:

  1. Changes in Collateral Value

The value of the provided collateral can directly impact the amount of credit available. Fluctuations in collateral value can either increase or decrease the available credit. Borrowers should be aware of these fluctuations and adjust their borrowing activities accordingly.

When a loan becomes undercollateralized, either due to decreased collateral value or increased borrowed amount, liquidators step in to protect depositors and potentially profit themselves.
This means that a user's collateral may fluctuate and adversely decrease the available credit so much to zero in the worst case. At this point, this user is eligible for liquidation but due to the undervalued collateral, there are no incentives to liquidate him.

Vulnerability Details

In the MErc20DelegateFixer::fixUser() function, there is a check to determine the current amount for a user that we'll transfer to the liquidator:

/// @dev current amount for a user that we'll transfer to the liquidator
uint256 liquidated = accountTokens[user];

It then checks if the liquidated != 0 before carrying out the transfer to the liquidator:

/// can only seize collateral assets if they exist
if (liquidated != 0) {
/// if assets were liquidated, give them to the liquidator
accountTokens[liquidator] = SafeMath.add(
accountTokens[liquidator],
liquidated
);
/// zero out the user's tokens
delete accountTokens[user];

This means that there is a possibility that there are no tokens to be transferred to the liquidator in the event of extreme undercollateralization which implies that that the liquidator stands to make no profit from this liquidation process since there is not even enough to cover for the debt clearance.

Impact

Ideally, no liquidator would want to be in this scenario and therefore, there are higher chances that all undercollateralized users may never be liquidated, a fact that would eventually result in the protocol going underwater.

Tools Used

Manual Review

Recommendations

A potential fix would be to set a minimum threshold below which collateral value must not fall before liquidation occurs.

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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