Skip to content

Commit

Permalink
Merge pull request #63 from balancer/pool-dynamic-data-indexes
Browse files Browse the repository at this point in the history
PoolDynamicData indexes
  • Loading branch information
franzns authored Jan 24, 2024
2 parents e74d513 + 44e470e commit 8820ae0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/pool/pool.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,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
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
5 changes: 5 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,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
Expand Down

0 comments on commit 8820ae0

Please sign in to comment.