Skip to content

Conversation

@alexkeating
Copy link
Collaborator

No description provided.

@alexkeating alexkeating changed the title Feature/add apy reward notifier (Spike) APR Reward Notifier Nov 25, 2025
uint256 public constant MAX_REWARD_INTERVAL = 365 days;

/// @notice APR threshold in basis points.
uint16 public targetAPR;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider changing to aprCap or similar


// Avoids revert in underlying staker if scaled reward rate is 0
if (amountToNotify == 0 && (RECEIVER.scaledRewardRate() / RECEIVER.SCALE_FACTOR()) == 0) {
return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we revert?

// Calculate the maximum amount we can notify without exceeding the target
uint256 maxAllowableAmount = _calculateMaxNotifyAmount(currentAPR);
amountToNotify = rewardAmount > maxAllowableAmount ? maxAllowableAmount : rewardAmount;
nextRewardTime = block.timestamp + rewardInterval;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're past the reward interval, but currently at/above the cap, do we want to extend the next reward time? Or just prevent reward notification until that changes?

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Coverage after merging feature/add-apy-reward-notifier into main will be

99.45%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   DelegationSurrogate.sol100%100%100%100%
   DelegationSurrogateVotes.sol100%100%100%100%
   Staker.sol100%100%100%100%
src/calculators
   BinaryEligibilityOracleEarningPowerCalculator.sol100%100%100%100%
   IdentityEarningPowerCalculator.sol100%100%100%100%
src/extensions
   StakerCapDeposits.sol100%100%100%100%
   StakerDelegateSurrogateVotes.sol100%100%100%100%
   StakerOnBehalf.sol100%100%100%100%
   StakerPermitAndStake.sol100%100%100%100%
src/notifiers
   APRRewardNotifier.sol95.28%82.35%100%96.77%128–129, 133–134, 206, 223
   MintRewardNotifier.sol100%100%100%100%
   RewardTokenNotifierBase.sol100%100%100%100%
   TransferFromRewardNotifier.sol100%100%100%100%
   TransferRewardNotifier.sol100%100%100%100%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants