Skip to content

Conversation

@aso20455
Copy link

@aso20455 aso20455 commented Sep 13, 2025

Remove obsolete HybridBTC APY hardcoded override that expired on 2025-09-08.

The condition new Date() < hybridBTCEndDate is always false since the expiration date has passed, making this dead code. Simplifies the APY calculation logic by removing the unused conditional and constant.

  • Removes expired hack setting HybridBTC APY to 2%
  • Removes unused hybridBTCEndDate constant
  • Cleanup technical debt in strategy APY calculation

Summary by CodeRabbit

  • Bug Fixes
    • HybridBTC pool APY now reflects live data instead of a temporary 2% override.
    • Removed date-based gating to ensure consistent APY behavior across time.
    • If no APY is available from the data source, the value defaults to 0 for clarity.

@vercel
Copy link

vercel bot commented Sep 13, 2025

@aso20455 is attempting to deploy a commit to the distributed-crafts Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 13, 2025

Walkthrough

Removes 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

Cohort / File(s) Summary
Gateway strategy APY logic
sdk/src/gateway/strategy.ts
Deleted HybridBTC-specific 2% apyBase override and its end-date constant; apyBase now always sourced from defillamaPool.apyBase ?? 0. No other logic altered.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • slavastartsev

Poem

I nibbled the code, a tiny bite,
Trimmed a 2% carrot from Hybrid’s site.
No dates to chase, no special brew—
Just APY straight, clean and true.
Hop, hop, commit—less fudge, more light! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title concisely and accurately summarizes the main change: removal of the expired HybridBTC APY override. It directly reflects the code and PR description (deleting the date-gated override and end-date constant) and is clear and specific enough for a teammate scanning history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 hybridBTCEndDate constant, 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.

?? 0 won’t catch NaN. Normalize numbers to avoid leaking NaN into 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0ca91dc and 888c3ee.

📒 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

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.

2 participants