Skip to content

Support validator unbonding epochs and commission deduction in staking.ts #972

Closed

Description

@k-deejah

Description: Problem

  1. In src/lib/staking.ts (calculateEstimatedRewards), reward yield calculations do not deduct validator commission percentages, overstating net APY in the UI.
  2. The unbonding time calculator assumes a static 21-day period instead of checking protocol epoch boundaries.
  3. Missing unit tests verifying compounding yield calculations for partial redelegations.

Solution

Compute net reward rate: grossReward * (1 - validatorCommission / 100). Account for protocol epoch close cycles in unbonding completion estimates, and add test cases for partial redelegation in src/lib/staking.test.ts.

Acceptance Criteria

  • APY calculation reflects validator commission deductions.
  • Unbonding completion estimates match protocol epoch timings.
  • Compounding and partial redelegation tests pass in src/lib/staking.test.ts.

Note for Contributors

If you're assigned to this issue, write a clear and detailed description for your pull request. Explain what was changed, why it was needed, how it was implemented, and include any relevant testing or screenshots where applicable.

Activity

  1. added
    bugSomething isn't working
    testsTest coverage, test setup, or test infrastructure
    on Oct 14, 2026
  2. area523ufo commented on Oct 15, 2026

    @area523ufo

    Hi! I've submitted a fix with unit tests for this issue in PR #978. Please let me know if any adjustments are needed!

  3. pelumixxril commented on Oct 15, 2026

    @pelumixxril

    @pelumixxril has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi maintainer, I would like to work on this issue.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @pelumixxril to this issue.

  4. playmaker410 commented on Oct 16, 2026

    @playmaker410

    @playmaker410 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I would love to take this on. I have hands on experience with Rust, Soroban, Cairo, and TypeScript, and I’m confident I can deliver a solid solution within 24 hours.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @playmaker410 to this issue.

  5. temmytopeabdulghaneey commented on Oct 17, 2026

    @temmytopeabdulghaneey

    @temmytopeabdulghaneey has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Kindly assign it to me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @temmytopeabdulghaneey to this issue.

  6. AdEmOnD07 commented on Oct 17, 2026

    @AdEmOnD07
    Contributor

    @AdEmOnD07 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I would like to work on this issue PLEASE
    I will deliver best and fast

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @AdEmOnD07 to this issue.

  7. drips-wave commented on Oct 17, 2026

    @drips-wave

    Congratulations, @AdEmOnD07! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @AdEmOnD07: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  8. drips-wave commented on Oct 26, 2026

    @drips-wave

    This issue has been completed by @AdEmOnD07 as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @AdEmOnD07: You earned 150 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingstakingtestsTest coverage, test setup, or test infrastructure

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions