Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish to prod #874

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# backend

## 1.14.8

### Patch Changes

- ac4ff07: make queries to use wallet indexes properly

## 1.14.7

### Patch Changes
Expand Down
27 changes: 10 additions & 17 deletions modules/pool/lib/pool-gql-loader.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export class PoolGqlLoaderService {
orderBy = { dynamicData: { totalLiquidity: orderDirection } };
break;
case 'totalShares':
orderBy = { dynamicData: { totalShares: orderDirection } };
orderBy = { dynamicData: { totalSharesNum: orderDirection } };
break;
case 'volume24h':
orderBy = { dynamicData: { volume24h: orderDirection } };
Expand Down Expand Up @@ -372,7 +372,7 @@ export class PoolGqlLoaderService {
}

const where = args.where;
const textSearch = args.textSearch ? { contains: args.textSearch, mode: 'insensitive' as const } : undefined;
const textSearch = args.textSearch ? { contains: args.textSearch.toLowerCase() } : undefined;

const allTokensFilter = [];
where?.tokensIn?.forEach((token) => {
Expand All @@ -381,8 +381,7 @@ export class PoolGqlLoaderService {
some: {
token: {
address: {
equals: token,
mode: 'insensitive' as const,
equals: token.toLowerCase(),
},
},
},
Expand All @@ -396,8 +395,7 @@ export class PoolGqlLoaderService {
every: {
token: {
address: {
notIn: where.tokensNotIn || undefined,
mode: 'insensitive' as const,
notIn: where.tokensNotIn.map((t) => t.toLowerCase()) || undefined,
},
},
},
Expand All @@ -412,8 +410,7 @@ export class PoolGqlLoaderService {
userWalletBalances: {
some: {
userAddress: {
equals: userAddress,
mode: 'insensitive' as const,
equals: userAddress.toLowerCase(),
},
balanceNum: { gt: 0 },
},
Expand All @@ -423,8 +420,7 @@ export class PoolGqlLoaderService {
userStakedBalances: {
some: {
userAddress: {
equals: userAddress,
mode: 'insensitive' as const,
equals: userAddress.toLowerCase(),
},
balanceNum: { gt: 0 },
},
Expand Down Expand Up @@ -460,9 +456,8 @@ export class PoolGqlLoaderService {
},
AND: allTokensFilter,
id: {
in: where?.idIn || undefined,
notIn: where?.idNotIn || undefined,
mode: 'insensitive',
in: where?.idIn?.map((id) => id.toLowerCase()) || undefined,
notIn: where?.idNotIn?.map((id) => id.toLowerCase()) || undefined,
},
...(where?.categoryIn && !where?.tagIn
? { categories: { hasSome: where.categoryIn.map((s) => s.toUpperCase()) } }
Expand Down Expand Up @@ -1324,8 +1319,7 @@ export class PoolGqlLoaderService {
userStakedBalances: {
where: {
userAddress: {
equals: userAddress,
mode: 'insensitive' as const,
equals: userAddress.toLowerCase(),
},
balanceNum: { gt: 0 },
},
Expand All @@ -1335,8 +1329,7 @@ export class PoolGqlLoaderService {
userWalletBalances: {
where: {
userAddress: {
equals: userAddress,
mode: 'insensitive' as const,
equals: userAddress.toLowerCase(),
},
balanceNum: { gt: 0 },
},
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": "backend",
"version": "1.14.7",
"version": "1.14.8",
"description": "Backend service for Beethoven X and Balancer",
"repository": "https://github.com/balancer/backend",
"author": "Beethoven X",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- DropIndex
DROP INDEX "PrismaPoolDynamicData_totalShares_idx";

-- CreateIndex
CREATE INDEX "PrismaPoolDynamicData_totalSharesNum_idx" ON "PrismaPoolDynamicData"("totalSharesNum" DESC);
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ model PrismaPoolDynamicData {
@@unique([poolId, chain])
// Indexes used for sorting pools in the UI by different metrics
@@index(totalLiquidity)
@@index(totalShares)
@@index(totalSharesNum(sort: Desc))
@@index(volume24h)
@@index(apr)

Expand Down
2 changes: 1 addition & 1 deletion prisma/schema/pool.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ model PrismaPoolDynamicData {
@@unique([poolId, chain])
// Indexes used for sorting pools in the UI by different metrics
@@index(totalLiquidity)
@@index(totalShares)
@@index(totalSharesNum(sort: Desc))
@@index(volume24h)
@@index(apr)

Expand Down
Loading