Repository navigation
fix(rfox): source the apy distribution rate from the current epoch - #12754
Conversation
The latest completed epoch only covers contracts that existed when it closed, so a newly launched program (ethereum mainnet) rendered 0% APY until its first epoch completed. Read the rate from the current epoch metadata like the simulator and emissions pool already do. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe current APY selector now reads distribution rates from current epoch metadata by staking contract. It returns ChangesCurrent APY
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue is established in the reviewed change; it appears mergeable after normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the epoch’s rate, Comment |
Description
The rFOX APY badge read the distribution rate from the latest completed epoch's
detailsByStakingContract. A completed epoch only covers contracts that existed when it closed, so the new ethereum mainnet program rendered 0.00% APY until its first epoch (27) completes at the end of October.The hook now reads the rate from the current epoch metadata's
distributionRateByStakingContract, which is what the simulator, emissions pool and current-epoch rewards already use. Revenue still comes from the latest completed epoch as the monthly basis.Side effect: the sunset arbitrum program now resolves to 0% since the current epoch no longer assigns it a rate, which is accurate.
Issue (if applicable)
closes #
Risk
Low. Display-only change to the APY figure on the rFOX and FOX ecosystem pages, no transaction or wallet changes.
None.
Testing
Engineering
Validated against live data by replicating the hook's arithmetic: current epoch rate 0.5, epoch 26 revenue $46,893.76, on-chain
totalStaked()of 17.14M FOX on the mainnet contract, FOX price at epoch 26 end. Result ~302% APY, matching the figure rendered locally (301.66%, price-feed delta only).Operations
Open the FOX ecosystem page with the ethereum mainnet rFOX program selected. The APY badge next to the rFOX Staking heading should show a non-zero APY (several hundred percent while the pool is small) instead of 0.00%.
Screenshots (if applicable)
🤖 Generated with Claude Code
Summary by CodeRabbit