-
Notifications
You must be signed in to change notification settings - Fork 66
refactor: remove expired HybridBTC APY override hack #759
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: master
Are you sure you want to change the base?
Conversation
|
@aso20455 is attempting to deploy a commit to the distributed-crafts Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughRemoves the date-gated HybridBTC-specific APY override in sdk/src/gateway/strategy.ts. The apyBase is now taken directly from defillamaPool.apyBase (defaulting to 0) without checking pool ID or an end date. No exported/public signatures changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant Strategy
participant DefiLlama as DefiLlama Pool Data
Client->>Strategy: request strategy data
Strategy->>DefiLlama: fetch pool metrics
DefiLlama-->>Strategy: defillamaPool (apyBase, etc.)
rect rgba(200,230,255,0.3)
note over Strategy: New flow (no HybridBTC override)
Strategy->>Strategy: apyBase = defillamaPool.apyBase ?? 0
end
Strategy-->>Client: strategy data with computed apyBase
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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. Comment |
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.
Summary of Changes
Hello @aso20455, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request focuses on cleaning up technical debt by removing an expired and obsolete hardcoded Annual Percentage Yield (APY) override for HybridBTC. The original override, set to expire on 2025-09-08, is no longer necessary as its condition is always false. By eliminating this dead code and an associated constant, the PR simplifies the APY calculation logic and improves overall code maintainability.
Highlights
- Expired APY Override Removal: Removed an obsolete hardcoded Annual Percentage Yield (APY) override for HybridBTC, which had an expiration date of 2025-09-08 and is now considered dead code.
- Constant Removal: Eliminated the unused
hybridBTCEndDateconstant, as its purpose has expired. - Code Simplification: Simplified the APY calculation logic by removing the conditional statement that checked against the now-expired date, streamlining the codebase.
- Technical Debt Cleanup: Addressed technical debt by removing an outdated temporary solution, improving maintainability.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request removes an APY override for HybridBTC. The justification in the description is that the override has expired, but the expiration date is set to 2025-09-08, which is in the future. This means the code being removed is still active, and this change has a functional impact. I have added a critical review comment to highlight this discrepancy, as it may be an unintended change.
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
sdk/src/gateway/strategy.ts (1)
214-216: Guard against NaN from upstream data.
?? 0won’t catchNaN. Normalize numbers to avoid leakingNaNinto consumers.Apply:
- apyBase: defillamaPool?.apyBase ?? 0, - apyReward: defillamaPool?.apyReward ?? 0, + apyBase: Number.isFinite(Number(defillamaPool.apyBase)) ? Number(defillamaPool.apyBase) : 0, + apyReward: Number.isFinite(Number(defillamaPool.apyReward)) ? Number(defillamaPool.apyReward) : 0,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
sdk/src/gateway/strategy.ts(2 hunks)
🔇 Additional comments (2)
sdk/src/gateway/strategy.ts (2)
212-219: Expired HybridBTC APY override removed — good cleanup.Dead code is gone; behavior now consistently reflects DefiLlama data.
176-176: Verify no stray references to the removed end-date hack remain.rg returned "unrecognized file type: tsx" — the scan was inconclusive. Re-run a full-text search across all extensions (no --type filters). Recommended commands:
- rg -n --hidden -S '\bhybridBTCEndDate\b' -g '!.git' -g '!node_modules' || true
- rg -nP -C2 '(HybridBTC|hybridBTC)' --hidden -S -g '!.git' -g '!node_modules' || true
- rg -nP -C2 '\b(0.02|2\s*%|2.0\s*%|2.00\s*%)\b' --hidden -S -g '!.git' -g '!node_modules' | rg -v 'readme|changelog|comment' || true
Remove obsolete HybridBTC APY hardcoded override that expired on 2025-09-08.
The condition
new Date() < hybridBTCEndDateis always false since the expiration date has passed, making this dead code. Simplifies the APY calculation logic by removing the unused conditional and constant.hybridBTCEndDateconstantSummary by CodeRabbit