jediswaplabs / dashboard-backend

Example Apibara project indexing a DEX and providing data through a GraphQL API.
Apache License 2.0
2 stars 6 forks source link

Volume Contest Query #16

Closed princearoragithub closed 1 year ago

princearoragithub commented 1 year ago

Specs for volume contest: https://docs.google.com/spreadsheets/d/1P9UNzZnr-kuF-zOTj8MyRaDfmJRkbCbpo_UqS7EraKY/edit#gid=1464182994

We need to write a query for calculating user points. We have all the swaps in mongo db. The query needs to: 1) Fetch all the required swaps for a user (from a particular block or datetime) 2) Calculate the points based on USD volume and pair (stable or not) 3) Add up the scores to give weekly points and total score. The weekly points need to adhere to upper limit of points per week.

duxin0817060114 commented 1 year ago

That's a good idea.