Skip to content

Commit

Permalink
Merge pull request #181 from metaDAOproject/feat/more-top-proposals
Browse files Browse the repository at this point in the history
feat: more top proposals
  • Loading branch information
LukasDeco authored Aug 3, 2024
2 parents ee12554 + c0be02a commit adf2736
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions lib/client/indexer/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,22 @@ 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: {
limit: 5,
limit: 4,
order_by: [
{
user_performances_aggregate: {
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metadaoproject/futarchy-sdk",
"version": "4.0.0-alpha.8",
"version": "4.0.0-alpha.10",
"main": "dist",
"scripts": {
"preinstall": "npx only-allow pnpm",
Expand Down

0 comments on commit adf2736

Please sign in to comment.