Skip to content

Commit 2ecf3d9

Browse files
committed
chore: update rewards calculator formula for estimated annual tokens
1 parent 46c48de commit 2ecf3d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/StakingRewardsCalculator.sol

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ contract StakingRewardsCalculator {
194194
}
195195

196196
/// @dev Calculate weekly rewards based on total stake weight and APY
197-
/// @dev Formula: weeklyRewards = (totalStakeWeight * targetApy) / (52 * 1e18 * 100)
197+
/// @dev Formula: weeklyRewards = (totalStakeWeight * 4 * targetApy) / (52 * 1e18 * 100)
198+
/// @dev The multiplication by 4 converts stake weight to equivalent annual staked tokens
198199
/// @dev The division by 100 converts percentage to decimal
199200
/// @param actualTotalStakeWeight Current total stake weight considering lock periods (in wei)
200201
/// @param targetApy Target APY calculated from stake weight curve (in wei, e.g., 12% = 12e18)
@@ -207,7 +208,8 @@ contract StakingRewardsCalculator {
207208
pure
208209
returns (uint256 weeklyRewards)
209210
{
210-
uint256 annualRewardsWithPrecision = (actualTotalStakeWeight * uint256(targetApy));
211+
// Multiply by 4 to convert stake weight to equivalent annual staked tokens
212+
uint256 annualRewardsWithPrecision = (actualTotalStakeWeight * 4 * uint256(targetApy));
211213

212214
// Step 4: Convert annual rewards to weekly rewards
213215
weeklyRewards = annualRewardsWithPrecision / (PRECISION * 100 * WEEKS_IN_YEAR);

0 commit comments

Comments
 (0)