-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add endpoint for leaderboards #839
Conversation
From my tests, the query is taking ~3s, due to the sorting with
Leaderboard is a ranking of top contributors, should be obvious to sort by proposals count if 2 users have the same number of votes, else order will be random A 3s query should be acceptable, will depend if that scale, as we get more data in the leaderboard table |
True that it takes less time, using BINARY casting on only one column. Still, I just think this PR should be merged only after we resolve the COLLATION issue, and just remove all |
Refactored to remove all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tAck
Following snapshot-labs/snapshot-sequencer#127
Add endpoint to return data from
leaderboard
tableTest with the query
This require that you have run the refresh_leaderboard script from sequencer to populate the table first.
user
andspace
can return the full User and Space object.Leaderboard API is written in order to match the format used in https://api-1.snapshotx.xyz/
Add
proposal_count
andvote_count
toUser
objectThanks to the new leaderboard table, we now have access to the total number of votes and proposals created by an user.
Will return
Those 2 new properties have been added to match the
User
object returned by the SX apiNote
Return properties name are
proposalsCount
andvotesCount
for consistency with existing hub API, and not matching theproposal_count
andvote_count
name on sx