Skip to content

Commit

Permalink
PoolDynamicData indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
gmbronco committed Jan 23, 2024
1 parent b3279ae commit 44e470e
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 @@ -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
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 @@ -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
Expand Down

0 comments on commit 44e470e

Please sign in to comment.