-
Notifications
You must be signed in to change notification settings - Fork 7
(Spike) APR Reward Notifier #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| uint256 public constant MAX_REWARD_INTERVAL = 365 days; | ||
|
|
||
| /// @notice APR threshold in basis points. | ||
| uint16 public targetAPR; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
|
Coverage after merging feature/add-apy-reward-notifier into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
No description provided.