From 3f42ec684657bccd05218f19bacd981d896cf920 Mon Sep 17 00:00:00 2001 From: LukasDeco Date: Fri, 2 Aug 2024 18:53:05 -0600 Subject: [PATCH 1/3] feat: more top proposals --- lib/client/indexer/proposals.ts | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/client/indexer/proposals.ts b/lib/client/indexer/proposals.ts index e272cdf..55a324c 100644 --- a/lib/client/indexer/proposals.ts +++ b/lib/client/indexer/proposals.ts @@ -301,7 +301,7 @@ export class FutarchyIndexerProposalsClient implements FutarchyProposalsClient { } } ], - limit: 3, + limit: 5, where: { dao: { dao_detail: { diff --git a/package.json b/package.json index fad83fc..e5a6743 100644 --- a/package.json +++ b/package.json @@ -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", From 580a9a34571906661429db6630c5424486d51531 Mon Sep 17 00:00:00 2001 From: LukasDeco Date: Fri, 2 Aug 2024 21:19:46 -0600 Subject: [PATCH 2/3] fix: proper amounts of top trades+props --- lib/client/indexer/proposals.ts | 2 +- lib/client/indexer/user.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/client/indexer/proposals.ts b/lib/client/indexer/proposals.ts index 55a324c..e272cdf 100644 --- a/lib/client/indexer/proposals.ts +++ b/lib/client/indexer/proposals.ts @@ -301,7 +301,7 @@ export class FutarchyIndexerProposalsClient implements FutarchyProposalsClient { } } ], - limit: 5, + limit: 3, where: { dao: { dao_detail: { diff --git a/lib/client/indexer/user.ts b/lib/client/indexer/user.ts index e970066..b799dc5 100644 --- a/lib/client/indexer/user.ts +++ b/lib/client/indexer/user.ts @@ -419,7 +419,7 @@ export class FutarchyIndexerUserClient implements FutarchyUserClient { const { users } = await this.graphqlClient.query({ users: { __args: { - limit: 5, + limit: 4, order_by: [ { user_performances_aggregate: { From c0be02a2eddd5006ad38a5cc8e5b04a9edc59504 Mon Sep 17 00:00:00 2001 From: LukasDeco Date: Fri, 2 Aug 2024 22:32:24 -0600 Subject: [PATCH 3/3] fix: bugs with top traders --- lib/client/indexer/user.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/client/indexer/user.ts b/lib/client/indexer/user.ts index b799dc5..8bd6e32 100644 --- a/lib/client/indexer/user.ts +++ b/lib/client/indexer/user.ts @@ -416,6 +416,18 @@ export class FutarchyIndexerUserClient implements FutarchyUserClient { } async fetchTopTraders(daoSlug: string | null): Promise { + const userPerformanceWhere = daoSlug + ? { + proposal: { + dao: { + dao_detail: { + slug: { _eq: daoSlug } + } + } + } + } + : undefined; + const { users } = await this.graphqlClient.query({ users: { __args: { @@ -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