Skip to content

Add key leaderboard indexer and rankings REST API #1136

Closed

Description

@Chucks1093

Summary

Index LeaderboardUpdated contract events and expose REST endpoints for ranked holder lists per key and metric, used to power the leaderboard tab on the key detail page.

Scope

  • Indexer processes LeaderboardUpdated events into key_leaderboards table
  • GET /keys/:key_id/leaderboard?metric=volume|pnl|holding_days&limit=N — ranked list
  • GET /keys/:key_id/leaderboard/:wallet — wallet's rank and score for each metric
  • Cache TTL 60s; invalidated on LeaderboardUpdated event for key
  • Returns empty list for keys with no leaderboard data

Acceptance Criteria

  • LeaderboardUpdated events indexed with no gaps
  • Leaderboard returns correct ranked list for all three metrics
  • Wallet rank endpoint returns accurate rank and score
  • Cache invalidates correctly on new leaderboard event
  • Empty list returned correctly for keys with no data

ETA

12 hours

Activity

  1. sarah-obasi-analytics commented on Oct 19, 2026

    @sarah-obasi-analytics
    Contributor

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

    hello, can i WORK on this issue?, i can fix it.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @sarah-obasi-analytics to this issue.

  2. maxx-GENIUS commented on Oct 19, 2026

    @maxx-GENIUS

    ⚡ Protocol Implementation Blueprint & Production Readiness Proposal

    Hi @maintainers, I am ready to implement and ship this issue immediately.

    I have reviewed the repository architecture and pre-analyzed the execution path for this task so you don't have to spend any time onboarding or hand-holding:

    1. Scope & Execution Boundary

    • Target Domain: Backend Services & Distributed APIs (Node.js / TypeScript)
    • Target Issue: Add key leaderboard indexer and rankings REST API
    • Architectural Scope: Review API route contracts, payload schemas, and database interaction boundaries for Add key leaderboard indexer and rankings REST API.

    2. Implementation Strategy & Invariants

    • Engineer idempotent request handlers with strict schema validation, robust error propagation, and optimized database queries.
    • Preserves backward compatibility and strict type invariants across existing public APIs and internal interfaces.

    3. Verification & Quality Assurance Guarantee

    • Validate end-to-end endpoint contracts with integration tests and verify OpenAPI/Swagger documentation parity.
    • CI Guarantee: 100% green local test runs, zero linter/formatter warnings, and clean build checks before opening the PR.

    4. Turnaround SLA & Track Record

    • Estimated Delivery: Complete, atomic, ready-to-merge PR within 1–2 hours of assignment.
    • Zero Maintainer Overhead: Fully autonomous execution—branch is ready, dependencies reproduced locally, and ready to push.
    • Review SLA: Active availability with sub-15 minute revisions for any requested review tweaks.
    • Verified Pedigree: 166+ Merged PRs across Stellar & Web3 protocols | OSS Activity Score: 83 (Top 2% Global Contributor) | Fast & deterministic protocol-grade delivery.

    Looking forward to your green light! Ready to branch and ship.

  3. reinaldyalt commented on Oct 19, 2026

    @reinaldyalt

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

    Hi, I'm reinaldyalt. I'd like to work on this issue: indexing LeaderboardUpdated contract events into a key_leaderboards table and exposing the ranked leaderboard REST endpoints for volume, pnl and holding_days metrics, following the repo's existing indexer-service pattern with cache invalidation on new events. I can start right away and deliver a tested PR within a couple of days.

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

  4. Stanley-Owoh commented on Oct 19, 2026

    @Stanley-Owoh
    Contributor

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

    Good day maintaner, please i would like to work on this, I have gone through the description and am sure i can handle this task
    I can work on it immediatly with clean code and positive result please assign this issue to me
    Thank you

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

  5. bright5455 commented on Oct 19, 2026

    @bright5455
    Contributor

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

    hello maintainer

    i have read and understand the issue
    im a front end engineer with five years of eperience,with my level of experience,i believe i can deliver a quality PR
    please kindly assign this task to me

    Thank you

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

  6. aabolari commented on Oct 19, 2026

    @aabolari

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

    hi maintainer, i would love to work on this issue, i understand the expectations

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

  7. cold-13 commented on Oct 20, 2026

    @cold-13

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

    Hi there, i would like to work on this issue , kindly assign please

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

  8. Ottones commented on Oct 20, 2026

    @Ottones

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

    I’ve looked over the issue and know how to handle the fix. I have successfully handled similar tasks and I am available to start working on it right away.

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

  9. deborahogunjinmi592-byte commented on Oct 20, 2026

    @deborahogunjinmi592-byte

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

    Hi maintainer
    I'm interested in working on the issue
    Could you please assign it to me?

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

  10. DioChuks commented on Oct 20, 2026

    @DioChuks
    Contributor

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

    Hello there, I would like to tackle this, i have a extreme proficiency in backend engineering. Based on your acceptance criteria, i would ensure that: LeaderboardUpdated events indexed with no gaps, Leaderboard returns correct ranked list for all three metrics, Wallet rank endpoint returns accurate rank and score, Cache invalidates correctly on new leaderboard event, Empty list returned correctly for keys with no data(these require cache invalidations, data indexing, rank-score metrics which i can handle properly).

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

  11. drips-wave commented on Oct 20, 2026

    @drips-wave

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

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

  12. grantfox-oss commented on Oct 22, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @DioChuks's PR #1205 was approved and merged by @Chucks1093.

    🏆 @DioChuks: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (602 total points). Track your full progress on GrantFox.

    👏 Great work, @DioChuks! Keep contributing to accesslayerorg.

  13. drips-wave commented on Oct 22, 2026

    @drips-wave

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

    😎 @DioChuks: You earned 200 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 program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions