From 5e23de5a77db98d5f2d1f00c81b0be9fd5ffe249 Mon Sep 17 00:00:00 2001 From: ReflectiveChimp <55021052+ReflectiveChimp@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:58:34 +0100 Subject: [PATCH] filter out empty snapshots (#28) --- src/queries/VaultHistoricPrices.graphql | 3 ++- src/queries/VaultHistoricPricesRange.graphql | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/queries/VaultHistoricPrices.graphql b/src/queries/VaultHistoricPrices.graphql index d68e1f6..f06dfb3 100644 --- a/src/queries/VaultHistoricPrices.graphql +++ b/src/queries/VaultHistoricPrices.graphql @@ -20,7 +20,8 @@ query VaultHistoricPrices( skip: $skip orderBy: roundedTimestamp orderDirection: asc - where: { roundedTimestamp_gte: $since, period: $period } + # TODO remove managerTotalSupply_gt once reindexed to not save snapshots when total supply is 0 + where: { roundedTimestamp_gte: $since, period: $period, managerTotalSupply_gt: 0 } ) { roundedTimestamp priceRangeMin1 diff --git a/src/queries/VaultHistoricPricesRange.graphql b/src/queries/VaultHistoricPricesRange.graphql index 53126f6..ad6b07a 100644 --- a/src/queries/VaultHistoricPricesRange.graphql +++ b/src/queries/VaultHistoricPricesRange.graphql @@ -4,7 +4,8 @@ query VaultHistoricPricesRange($vault_address: ID!, $period: BigInt!) { first: 1 orderBy: roundedTimestamp orderDirection: asc - where: { period: $period } + # TODO remove managerTotalSupply_gt once reindexed to not save snapshots when total supply is 0 + where: { period: $period, managerTotalSupply_gt: 0 } ) { roundedTimestamp } @@ -12,7 +13,8 @@ query VaultHistoricPricesRange($vault_address: ID!, $period: BigInt!) { first: 1 orderBy: roundedTimestamp orderDirection: desc - where: { period: $period } + # TODO remove managerTotalSupply_gt once reindexed to not save snapshots when total supply is 0 + where: { period: $period, managerTotalSupply_gt: 0 } ) { roundedTimestamp }