diff --git a/modules/pool/pool.prisma b/modules/pool/pool.prisma index e9189664e..f7a974642 100644 --- a/modules/pool/pool.prisma +++ b/modules/pool/pool.prisma @@ -118,6 +118,11 @@ model PrismaPoolGyroData{ model PrismaPoolDynamicData { @@id([id, chain]) @@unique([poolId, chain]) + // Indexes used for sorting pools in the UI by different metrics + @@index(totalLiquidity) + @@index(totalShares) + @@index(volume24h) + @@index(apr) id String poolId String diff --git a/prisma/migrations/20240123115918_dynamic_data_indexes/migration.sql b/prisma/migrations/20240123115918_dynamic_data_indexes/migration.sql new file mode 100644 index 000000000..0fc74b6c1 --- /dev/null +++ b/prisma/migrations/20240123115918_dynamic_data_indexes/migration.sql @@ -0,0 +1,11 @@ +-- CreateIndex +CREATE INDEX "PrismaPoolDynamicData_totalLiquidity_idx" ON "PrismaPoolDynamicData"("totalLiquidity"); + +-- CreateIndex +CREATE INDEX "PrismaPoolDynamicData_totalShares_idx" ON "PrismaPoolDynamicData"("totalShares"); + +-- CreateIndex +CREATE INDEX "PrismaPoolDynamicData_volume24h_idx" ON "PrismaPoolDynamicData"("volume24h"); + +-- CreateIndex +CREATE INDEX "PrismaPoolDynamicData_apr_idx" ON "PrismaPoolDynamicData"("apr"); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 02648160e..93660db29 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -164,6 +164,11 @@ model PrismaPoolGyroData{ model PrismaPoolDynamicData { @@id([id, chain]) @@unique([poolId, chain]) + // Indexes used for sorting pools in the UI by different metrics + @@index(totalLiquidity) + @@index(totalShares) + @@index(volume24h) + @@index(apr) id String poolId String