Skip to content

Commit

Permalink
filter out empty snapshots (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReflectiveChimp authored Jun 19, 2024
1 parent 0791588 commit 5e23de5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/queries/VaultHistoricPrices.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/queries/VaultHistoricPricesRange.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ 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
}
maxSnapshot: snapshots(
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
}
Expand Down

0 comments on commit 5e23de5

Please sign in to comment.