Core Contracts

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

Unfair boost allocation due to incorrect formula

Summary

The function calculateBoost incorrectly implements Curve's formula by not accounting for the value of the deposit, leading to incorrect calculations and users receiving less than they should

Details

The boost exists to increase the earning weight of the liquidity provided by a user. It was introduced by Curve Finance and was based on 4 parameters:

  1. v = amount of veTKN user has

  2. V = all veTKN in the system

  3. d = value of user deposit

  4. D = total value deposited in a pool's gauge

The formula is the following

However the current formula does not account for the deposited and total amounts

function calculateBoost(
uint256 veBalance,
uint256 totalVeSupply,
BoostParameters memory params
) internal pure returns (uint256) {
if (totalVeSupply == 0) {
return params.minBoost;
}
uint256 votingPowerRatio = (veBalance * 1e18) / totalVeSupply; // @note this is v / V
uint256 boostRange = params.maxBoost - params.minBoost;
uint256 boost = params.minBoost + ((votingPowerRatio * boostRange) / 1e18); // @audit formula is missing D / d
if (boost < params.minBoost) {
return params.minBoost;
}
if (boost > params.maxBoost) {
return params.maxBoost;
}
return boost;
}

Users who have equal veRaac but different deposit amounts will have the same boost applied, breaking the invariant of boosts being proportional to deposit sizing.
Incorrect boost allocation leads to unfair reward distribution when calculating earned in gauges.

Impact

Unfair reward distribution, logic error

Mitigation

Implement Curve's formula

Updates

Lead Judging Commences

inallhonesty Lead Judge
7 months ago
inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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

Give us feedback!