Skip to content

Commit

Permalink
fix(leaderboard): Calculate rank only when volume exist (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
chef-huan authored May 19, 2022
1 parent bc2a18f commit 40a3ff6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/cron/refreshLeaderboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const getUsersFirstPage = async (tradingCompSubgraph: string) => {
tradingCompSubgraph,
gql`
{
users(first: 1000, orderBy: volumeUSD, orderDirection: desc) {
users(first: 1000, orderBy: volumeUSD, orderDirection: desc, where: { volumeUSD_gt: 0 }) {
id
volumeUSD
team {
Expand Down
7 changes: 6 additions & 1 deletion api/cron/refreshSpecificTokenLeaderboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ const getUsersFirstPage = async (tradingCompSubgraph: string) => {
tradingCompSubgraph,
gql`
{
users(first: 1000, orderBy: darVolumeUSD, orderDirection: desc) {
users(
first: 1000
orderBy: darVolumeUSD
orderDirection: desc
where: { darVolumeUSD_gt: 0 }
) {
id
darVolumeUSD
}
Expand Down

1 comment on commit 40a3ff6

@vercel
Copy link

@vercel vercel bot commented on 40a3ff6 May 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.