Leaderboard Feature Spec Sheet
old leaderboard spec
- gamification of humans and devas in the ecosystem
- ability to filter / sort via multiple parameters available
- user stories:
- I want to see the best Devas based on
- Karma spent on the Deva
- Responses
- As a user, I want to see the best Creators based on
- Total Karma spent on all the Creator’s Deva
- As a user, I want to see who are the best trainers based on
- number of proposed variants
- number of publish variants
- karma earned based on variants being used for responses
- As a user, I want to be able to click on a trainer and see
- All the Devas the trainer has proposed variants for
- And how much karma each Deva has sent to the trainer
- And the referral split of the Deva to the trainer (set by Creator)
- As a user, I want to be able to see the best referrers based on
- Karma earned from referrals
- As a user, I want to be able to see best governors based on
- how many vouches a governor has from
- other governors (have invested in 10P)
- non-governors
- a vouch is a news feed post “vouch !governor”
- how many vouches a governor has from
System Backend Requirements
1. Human Leaderboard API
Endpoint: /api/leaderboard/human
Method: GET
Parameters:
metric: (optional) Specifies the sorting metric. Defaultkarma-spentkarma-spentkarma-earnedkarma-earned-creationkarma-earned-trainingkarma-earned-referralsgem-valueores-holdings
limit: (optional) Number of records to return. Default is 100offset: (optional) For pagination. Default is 0.
Response:
data: Array of humans with following fields:user_iddisplay_nameavatarleveltotal_karma_spenttotal_karma_earnedkarma_earned_creationkarma_earned_trainingkarma_earned_referralsaggregated_gem_valueores_holdings
meta: Metadata for pagination:total_recordslimitoffset
2. Devas Leaderboard API
Endpoint: /api/leaderboard/devas
Method: GET
Parameters:
metric: (optional) Specifies the sorting metric. Defaultkarma-earnedkarma-earnedunique-gem-holderstrainers-contributorsreferred-users
limit: (optional) Number of records to return. Default is 100.offset: (optional) For pagination. Default is 0.
Response:
data: Array of devas with the following fields:idusernameavatarleveltotal_karma_earnedunique_gem_holderstrainers_contributors_countreferred_users_count
meta: Metadata for pagination:total_recordslimitoffset
3. Deva Specific Leaderboard API
Endpoint: /api/leaderboard/deva/:username
Method: GET
Parameters:
metric: (optional) Specifies the sorting metric. Defaultcontributionstotal_contribution- humans with most contributions ( tkarma + rkarma )training- humans who’ve trained the mostreferral- humans who’ve referred the most people
limit: (optional) Number of records to return. Default is 100offset: (optional) For pagination. Default is 0.
Usage on frontend:
- request based on tab selected by user
- on click of a metric
- query appropriate leaderboard api with metric in the same format as the enum
- pagination
- specify offset and limit while user clicks on next page / dynamic pagination via scroll handlers
— Certainly! I’ll simplify the tasks list accordingly.
1. Devas Leaderboard Tasks
- Set up API endpoint:
/api/leaderboard/devas - Create queries/functions to compute:
rankingusername( alphabetical sorting )levelkarma-earnedgem-holdersores-rewarded
- Handle pagination (use
limitandskipparameters)
2. Creator Leaderboard Tasks
- Set up API endpoint:
/api/leaderboard/creators - Create queries/functions to compute:
karma-spentkarma-earned-creationkarma-earned-training
- Handle pagination (use
limitandskipparameters)
3. Contributor (Prompter) Leaderboard Tasks
- Set up API endpoint:
/api/leaderboard/contributors - Create queries/functions to compute:
karma-spentkarma-earned
- Handle pagination (use
limitandskipparameters)
4. Trainer Leaderboard Tasks
- Set up API endpoint:
/api/leaderboard/trainers - Create queries/functions to compute:
variants-proposedvariants-publishedkarma-earned
- Handle pagination (use
limitandskipparameters)
5. Referrer Leaderboard Tasks
- Set up API endpoint:
/api/leaderboard/referrers - Create queries/functions to compute:
karma-earned-referral
- Handle pagination (use
limitandskipparameters)
6. Governor Leaderboard Tasks
- Set up API endpoint:
/api/leaderboard/governors - Create queries/functions to compute:
vouches-governorsvouches-non-governors
- Handle pagination (use
limitandskipparameters)
7. Deva Specific Leaderboard Tasks
- Set up API endpoint:
/api/leaderboard/deva/:username - Create queries/functions to compute:
total_contributiontraining
- Handle pagination (use
limitandskipparameters)
leaderboard spec
Introduction
- gamification of humans and devas in the ecosystem
- ability to filter / sort via multiple parameters available
- answers questions users have
- I want to see the best Devas based on
- Karma spent on the Deva
- Responses
- As a user, I want to see the best Creators based on
- Total Karma spent on all the Creator’s Deva
- As a user, I want to see who are the best trainers based on
- number of proposed variants
- number of publish variants
- karma earned based on variants being used for responses
- As a user, I want to be able to click on a trainer and see
- All the Devas the trainer has proposed variants for
- And how much karma each Deva has sent to the trainer
- And the referral split of the Deva to the trainer (set by Creator)
- As a user, I want to be able to see the best referrers based on
- Karma earned from referrals
- As a user, I want to be able to see best governors based on
- how many vouches a governor has from
- other governors (have invested in 10P)
- non-governors
- a vouch is a news feed post “vouch !governor”
- how many vouches a governor has from
- I want to see the best Devas based on
1. Deva tab
metrics
- ranking (by karma earned)
- userdata ( pfp, username )
- categories
- level
- karma-earned ( total karma spent by users on the deva )
- gem-holders
- number of ores rewarded
filter options
- filter by just silver karma earned
- filter by just gold karma earned
API
Endpoint: /api/leaderboard/deva
Method: GET
Parameters:
metric: (optional) Specifies the sorting metric. Defaultkarma-earnedrankingusername( alphabetical sorting )levelkarma-earnedgem-holders
filter: (optional)karma-silverkarma-gold
limit: (optional) Number of records to return. Default is 100skip: (optional) For pagination. Default is 0.
2. Creator tab
all karma earned = sum of all creator’s devas
metrics
- ranking (by karma earned )
- userdata ( pfp, username )
- level (by karma earned )
- karma earned
- number of gem holders (of all creator’s devas)
filter options
- filter by just silver karma earned
- filter by just gold karma earned
API
Endpoint: /api/leaderboard/creator
Method: GET
Parameters:
metric: (optional) Specifies the sorting metric. Defaultkarma-earnedrankingusername( alphabetical sorting )levelkarma-earnedgem-holders
filter: (optional)karma-silverkarma-gold
limit: (optional) Number of records to return. Default is 100skip: (optional) For pagination. Default is 0.
3. Promptoor tab
all karma spent = sum of all karma spent across all devas
metrics
- ranking (by karma spent )
- userdata ( pfp, username )
- level (by karma spent )
- karma spent
- number of gem holdings
- number of ores earned
filter options
- filter by just silver karma spent
- filter by just gold karma spent
API
Endpoint: /api/leaderboard/prompter
Method: GET
Parameters:
metric: (optional) Specifies the sorting metric. Defaultkarma-earnedrankingusername( alphabetical sorting )levelkarma-spentgems-countores-earned
filter: (optional)karma-silverkarma-gold
limit: (optional) Number of records to return. Default is 100skip: (optional) For pagination. Default is 0.
4. Trainer tab
karma earned = sum of all karma earned from variant proposal and publishing across all devas
metrics
- ranking (by karma earned )
- userdata ( pfp, username )
- level (by karma earned )
- karma earned ( only silver can be earned, so no filters )
- number of variants proposed
- number of variants published
- number of responses which used published variants
API
Endpoint: /api/leaderboard/trainer
Method: GET
Parameters:
metric: (optional) Specifies the sorting metric. Defaultkarma-earnedrankingusername( alphabetical sorting )levelkarma-earnedvariants-proposedvariants-publishedresponses-using-variants
limit: (optional) Number of records to return. Default is 100skip: (optional) For pagination. Default is 0.
5. Referrer tab
karma earned = sum of all karma earned by referral
metrics
- ranking (by karma earned )
- userdata ( pfp, username )
- level (by karma earned )
- karma earned ( only silver can be earned, so no filters )
- number of referrals
API
Endpoint: /api/leaderboard/referrer
Method: GET
Parameters:
metric: (optional) Specifies the sorting metric. Defaultkarma-earnedrankingusername( alphabetical sorting )levelkarma-earnedreferral-count
limit: (optional) Number of records to return. Default is 100skip: (optional) For pagination. Default is 0.
6. Governor tab
metrics
- ranking (by number of vouches from current governors, which means they’ve invested in safe/warrant)
- userdata ( pfp, username )
- level
- number of vouches from current governors
- number of vouches from non-governors
API
Endpoint: /api/leaderboard/governor
Method: GET
Parameters:
metric: (optional) Specifies the sorting metric. Defaultkarma-earnedrankingusername( alphabetical sorting )levelvouches-current-governor-countvouches-non-governor-count
limit: (optional) Number of records to return. Default is 100skip: (optional) For pagination. Default is 0.
Deva specific leaderboard page
Endpoint: /api/leaderboard/deva/:username
Method: GET
Parameters:
metric: (optional) Specifies the sorting metric. Defaultcontributionstotal_contribution- humans with most contributions ( tkarma + rkarma )training- humans who’ve trained the mostreferral- humans who’ve referred the most people
limit: (optional) Number of records to return. Default is 100offset: (optional) For pagination. Default is 0.
The below is mostly repeated logic around:
- Hiding/Showing (Customize Button)
- Group By (Tabs)
- Sorting (Sort by Clicking on Column to switch column by Ascending, Descending)
- Filtering (Filter Button)
- Aggregating (Tabs showing different default aggregated data)
Examples of Filters:
- Filter by group (tabs like Deva, Creator, etc)
- Filter out gold or silver karma in filter button
- Filter by dates (last 7 days, this week, last 30 days, this month, last 90 days, this quarter, last 365 days, this year, input your own dates with calendar pop up modal)
Customize button can add or remove any of the columns or re-order the columns
Deva Tab
- ranking (by karma earned)
- pfp
- name/@username
- categories
- level
- karma earned (shows by default SUM of gold and silver karma, with an option to filter out gold or silver karma in filter button)
- gem holders
- of ore rewarded
clicking on a Deva shows the “Deva @username + Deva” at top next to Devas, indicating that it is the “@username creator tab”
- shows in sorted order of karma spent by each user/contributor (rows) and the columns
- karma SUM(spent from each contributor and earned from each trainer) (shown as @taylorswift13 points)
Deva User Stories
- As a user, I want to see the best Devas based on
- Karma spent on the Deva
- Responses
Creator Tab
- ranking (by karma earned SUM of all creator’s devas)
- pfp
- name/!username
- level (by karma earned SUM of all creator’s devas)
- karma earned (shows by default SUM of gold and silver karma, with an option to filter out gold or silver karma in filter button)
- number of gem holders (of all creator’s devas)
- number of ore rewarded (of all creator’s devas)
clicking on a creator shows the “creators !username + Creator” at top next to Devas, indicating that it is the “!username creator tab”
- shows in sorted order of karma earned from each user (rows) and the columns
- karma SUM(spent from each contributor and earned from each trainer) (shown as !taylorswift13 points)
Creator User Stories
- As a user, I want to see the best Creators based on
- Total Karma spent on all the Creator’s Devas
Contributor (prompter) Tab
- ranking (by karma spent SUM of all karma spending across all devas)
- pfp
- name/!username
- level (spent SUM of all karma spending across all devas)
- karma earned (shows by default SUM of gold and silver karma, with an option to filter out gold or silver karma in filter button)
- gem holdings (of all contributor’s deva gems
- of ore earned (from karma spending)
Trainer Tab
-
ranking (by karma from variant proposals and publishing)
-
pfp
-
name/!username
-
level (by karma earned SUM)
-
karma earned (shows by default SUM of silver karma)
-
training score (karma earned from variant proposals and publishing)
-
number of variants proposed
-
number of variants published
-
number of variants used in deva responses
-
gem holdings (from devas) of ore rewarded
-
clicking on a trainer shows the “trainers username + Trainer” at top next to Devas, indicating that it is the “username trainer tab”
-
shows in sorted order of karma earned from each deva (rows) and the columns
-
karma earned from each deva
-
number of gem holdings
-
As a user, I want to see who are the best trainers based on
- number of proposed variants
- number of publish variants
- karma earned based on variants being used for responses
-
As a user, I want to be able to click on a trainer and see
- All the Devas the trainer has proposed variants for
- And how much karma each Deva has sent to the trainer
- And the referral split of the Deva to the trainer (set by Creator)
Referrer Tab
- ranking (by referral karma)
- pfp
- name/!username
- level (by karma earned SUM by referral)
- karma earned (shows by default SUM of silver karma)
- referral score (karma earned from variant proposals and publishing)
- number of referrals
- gem holdings (from devas)
- number of ore rewarded
Referrer User Stories
- As a user, I want to be able to see the best referrers based on
- Karma earned from referrals
Governor Tab
- ranking (by number of vouches from current governors, which means they invested in safe/warrant)
- pfp
- name/!username
- level (by number of vouches from current governors, which means they invested in safe/warrant)
- of vouches by current governors
- of vouched by non-governors
- karma earned (shows by default SUM of silver karma)
- training score (karma earned from variant proposals and publishing)
- gem holdings (from devas)
- number of ore rewarded
Governor User Stories
- As a user, I want to be able to see best governors based on
- how many vouches a governor has from
- other governors (have invested in 10P)
- non-governors
- a vouch is a news feed post “vouch !governor”
- how many vouches a governor has from