Core Contracts

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

Dead Zone in Stability Pool Market Allocations

Summary

The Stability Pool's market allocation system fails to account for the LendingPool's 80% liquidation threshold, resulting in 20% of allocated capital becoming permanently unusable for liquidations. This creates significant capital inefficiency across the protocol.

Vulnerability Details

The issue arises from a mismatch between the Stability Pool's allocation system and the LendingPool's fundamental liquidation constraints:

// StabilityPool.sol
contract StabilityPool {
mapping(address => uint256) public marketAllocations;
function setMarketAllocation(address market, uint256 allocation) external {
marketAllocations[market] = allocation; // Treats full amount as usable
}
}
// LendingPool.sol
contract LendingPool {
uint256 public constant BASE_LIQUIDATION_THRESHOLD = 80 * 1e2; // 80%
function calculateHealthFactor(address user) public view returns (uint256) {
uint256 collateralValue = getUserCollateralValue(user);
uint256 collateralThreshold = collateralValue.percentMul(liquidationThreshold);
return (collateralThreshold * 1e18) / getUserDebt(user);
}
}

When allocating funds to markets, the Stability Pool doesn't consider that:

  • Users can only borrow up to 80% of their collateral value

  • The remaining 20% is a required safety buffer against price fluctuations

  • This buffer can never be used for liquidations, as it would make positions undercollateralized

Example:

Market A allocation: 8,000 USDC (80% of pool)
Liquidation threshold: 80%
Maximum usable amount: 8,000 * 0.80 = 6,400 USDC
Dead zone: 1,600 USDC (allocated but unusable)

Impact

  • Capital inefficiency: Up to 20% of allocated capital becomes unusable

  • Misleading allocations: Markets appear to have more usable allocation than they actually do

  • Reduced protocol effectiveness: Other markets cannot use the dead zone funds

  • System-wide impact: Affects all markets and reduces overall protocol efficiency

Tools Used

  • Manual code review

Recommendations

  • Adjust market allocation calculations to account for liquidation threshold:

contract StabilityPool {
function setMarketAllocation(address market, uint256 requestedAllocation) external {
// Calculate effective allocation considering liquidation threshold
uint256 effectiveAllocation = (requestedAllocation * BASE_LIQUIDATION_THRESHOLD) / 10000;
marketAllocations[market] = effectiveAllocation;
// Track both requested and effective allocations
MarketInfo storage info = marketInfo[market];
info.requestedAllocation = requestedAllocation;
info.effectiveAllocation = effectiveAllocation;
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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