Skip to content

Commit

Permalink
fix: bugs with top traders
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasDeco committed Aug 3, 2024
1 parent 580a9a3 commit c0be02a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib/client/indexer/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,18 @@ export class FutarchyIndexerUserClient implements FutarchyUserClient {
}

async fetchTopTraders(daoSlug: string | null): Promise<UserRanking[]> {
const userPerformanceWhere = daoSlug
? {
proposal: {
dao: {
dao_detail: {
slug: { _eq: daoSlug }
}
}
}
}
: undefined;

const { users } = await this.graphqlClient.query({
users: {
__args: {
Expand All @@ -428,10 +440,16 @@ export class FutarchyIndexerUserClient implements FutarchyUserClient {
}
}
}
]
],
where: {
user_performances: userPerformanceWhere
}
},
user_acct: true,
user_performances_aggregate: {
__args: {
where: userPerformanceWhere
},
aggregate: {
sum: {
total_volume: true
Expand Down

0 comments on commit c0be02a

Please sign in to comment.