Skip to content

Leaderboard API – Fetch & Rank Users Based on Total $DCU Earned #14

@LuminaEnvision

Description

@LuminaEnvision

Implement an API that retrieves verified PoIs leading to Impact Product claims, successful referrals, and streak participation to rank users based on total $DCU earned.

Tasks:

Fetch User Data for Leaderboard Ranking:

  • Retrieve wallet address / ENS for each user.
  • Fetch verified PoIs that led to Impact Product level claims.
  • Fetch total referrals that resulted in a verified PoI claim.
  • Fetch streak participation data (consecutive weekly verified PoI submissions).

Calculate Total $DCU Earned Per User:

  • +10 $DCU per verified PoI leading to a claimed Impact Product level.
  • +3 $DCU per verified PoI if streak was maintained (PoI submitted within 7 days of the previous one).
  • +1 $DCU per successful referral (only if referred user’s PoI was verified).

Store & Optimize Leaderboard Rankings:

  • Store total $DCU earned per user for quick leaderboard access.
  • Rank users dynamically based on total $DCU points.
  • Index frequently queried fields to improve API response speed.

Create API Endpoint for Leaderboard Retrieval:

  • Implement GET /api/leaderboard.
  • Return top-ranked users based on $DCU points.
  • Provide optional pagination & filtering (e.g., top 100, country-based rankings in future updates).

Response & Error Handling:

  • Return leaderboard data sorted by total $DCU earned.
  • Handle cases where no users have submitted PoIs yet.

Metadata

Metadata

Assignees

Labels

backendnon-rewardedonlydust-waveContribute to awesome OSS repos during OnlyDust's open source week

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions