Skip to content

Add a staking pool stats endpoint returning pool balance, total staked, and recent fee inflow per key #847

Description

@Chucks1093

Summary

The key detail page needs staking pool data to render the APY estimate. A GET /keys/:keyId/staking endpoint that reads staking pool balance, total staked quantity, and recent protocol fee inflow for the key should be added.

Scope

  • Add GET /keys/:keyId/staking endpoint (no auth required)
  • Return stakingPoolBalance, totalStaked, recentFeeInflow (sum of fees in the past 30 days), and stakerCount
  • Read staking state from on-chain contract storage via the Soroban RPC
  • Cache the response in Redis for 60 seconds and invalidate on each stake, unstake, or fee collection event
  • Return 404 for unknown key IDs

Acceptance Criteria

  • All required fields returned correctly
  • recentFeeInflow sums fees for the past 30 days
  • Redis cache served within 60-second TTL
  • Cache invalidated after stake, unstake, or fee event
  • 404 returned for unknown key ID

ETA: 12 hours


Coordinate on Telegram

Activity

  1. Ceepr1an commented on Aug 29, 2026

    @Ceepr1an

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

    Kindly assign this issue to me

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

  2. Netty-kun commented on Aug 29, 2026

    @Netty-kun

    @Netty-kun has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hi maintainer, I have read and understood the issue requirements and checked the necessary documentation. I’m confident I can work on this task effectively and deliver a proper solution.
    Happy to discuss the approach first if that's useful before I start.

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

  3. devJaja commented on Aug 29, 2026

    @devJaja
    Contributor

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

    can I work on this please

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

  4. doncross03 commented on Aug 29, 2026

    @doncross03

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

    Hello @maintainer, I’d like to work on this issue. I have experience handling similar tasks and can start immediately. And I will deliver at the shortest possible time.

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

  5. drips-wave commented on Aug 29, 2026

    @drips-wave

    Congratulations, @devJaja! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @devJaja: 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 🌊

  6. devJaja commented on Aug 31, 2026

    @devJaja
    Contributor

    Closed by PR #859 — staking pool stats endpoint implemented.

  7. devJaja commented on Aug 31, 2026

    @devJaja
    Contributor

    Closed by PR #859

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 program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions