Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Valid

Whale Positions Cannot Be Liquidated Due to Full-Liquidation Requirement

Summary

The LendingPool's liquidation mechanism requires the StabilityPool to liquidate a borrower's entire debt position at once, rather than allowing partial liquidations. This creates a significant risk when large borrowers become liquidatable, as the StabilityPool must have sufficient funds to cover the entire debt position.

Vulnerability Details

In LendingPool.sol, the finalizeLiquidation() function forces the StabilityPool to liquidate the entire debt position of a user:

function finalizeLiquidation(address userAddress) external nonReentrant onlyStabilityPool {
UserData storage user = userData[userAddress];
uint256 userDebt = user.scaledDebtBalance.rayMul(reserve.usageIndex);
// Forces full debt liquidation
IERC20(reserve.reserveAssetAddress).safeTransferFrom(msg.sender, reserve.reserveRTokenAddress, amountScaled);
}

The StabilityPool must have enough funds to cover the entire userDebt amount, which could be very large for whale positions.

function liquidateBorrower(address userAddress) external onlyManagerOrOwner nonReentrant whenNotPaused {
//..
uint256 crvUSDBalance = crvUSDToken.balanceOf(address(this));
if (crvUSDBalance < scaledUserDebt) revert InsufficientBalance();
//...
}

Impact

  • StabilityPool may be unable to liquidate large underwater positions due to insufficient funds

  • Creates systemic risk if large positions cannot be liquidated

  • Leads to protocol insolvency if bad debt accumulates

Tools Used

Manual review

Recommendations

Modify the liquidation mechanism to allow partial liquidations

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

StabilityPool has no ability to liquidate large positions due to all-or-nothing design - partial liquidation not supported, risking protocol insolvency

Support

FAQs

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