docs: fix Solana aggregate queries that filter on USD-denominated fields - #244
Merged
Conversation
Solana DEXTradeByTokens on dataset: archive/combined is served from
pre-aggregated tables that carry no USD-denominated columns. Filtering on
PriceAsymmetry, Side.AmountInUSD, AmountInUSD or PriceInUSD fails with a hard
GraphQL error ("no table can query DEXTradeByToken" / "database schema not
defined for archive cube"), so eight documented examples did not run at all.
Verified live against streaming.bitquery.io/graphql:
- USD filters and PriceAsymmetry error on archive/combined, work on realtime
- native equivalents (Trade.Amount, Trade.Side.Amount, Trade.Price) work
- USD *measures* (sum(of: Trade_Side_AmountInUSD), quantile(of: Trade_PriceInUSD))
work fine on aggregates -- only filters are affected
Removed the unsupported filters from the 8 broken examples, substituting the
native Side.Amount equivalent where a single quote currency is pinned. All 8
now execute successfully. Added a filter-limitation table to the Solana
historical aggregate page, a matching Q&A on the combined dataset page, and
documented the default dataset on the options page.
Tier 2 (Trade.Account filters) and Tier 3 (Transaction.Result.Success) were
audited and left unchanged -- both verified working.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The three "run it here" links pointed at IDE saved queries owned by other accounts that still carried the unsupported filters, so the linked query errored even though the markdown was fixed. Corrected copies now exist under the docs account: historical-ohlc-for-solana_3 -> Historical-OHLC-for-Solana-archive ath-with-price-delta_1 -> ATH-with-price-delta-Solana ATH-of-multiple-tokens-using-... -> ATH-of-multiple-tokens-quantile-Solana Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Solana,
DEXTradeByTokenswithdataset: archiveorcombinedis served from pre-aggregated tables that carry no USD-denominated columns. Filtering on them fails with a hard GraphQL error:Eight documented examples did this, so they did not run at all — including the flagship OHLC example on the Historical Solana Data page.
Verified behaviour
Tested live against
streaming.bitquery.io/graphql(fixed historical window, each filter compared against its own no-filter baseline):Trade.Amount,Trade.Side.AmountTrade.Price,Trade.Account.AddressTrade.Side.Type,Trade.Dex,Block.TimeTrade.PriceAsymmetryTrade.Side.AmountInUSD,Trade.AmountInUSDTrade.PriceInUSDUSD fields work fine as output measures on aggregates —
sum(of: Trade_Side_AmountInUSD)andquantile(of: Trade_PriceInUSD)both return correct values. Onlywhere:filters are affected.Causally confirmed: deleting only the
Side.AmountInUSDline from an otherwise unchanged failing query makes it return data.Changes
8 query fixes — 7 filter removals plus one substitution (
Side.AmountInUSD {gt "10"}→Side.Amount {gt "0.05"}, the native-unit equivalent, used only where a single quote currency is pinned). All 8 now execute successfully.Documentation — a filter-limitation table on the Solana historical aggregate page, a matching Q&A on the combined-dataset page, and the previously undocumented default dataset (
realtime) on the dataset options page. The existing warning only covered theTrade Side Accountprojection; nothing documented the filter restriction.Three IDE links repointed — the linked saved queries were owned by other accounts and still carried the broken filters, so the "run it here" links errored even with the markdown fixed. Corrected copies now exist under the docs account.
Deliberately unchanged
Transaction: {Result: {Success: true}}(21 queries) — verified working; it is a documented default filter and is ignored on every dataset, realtime included.Trade.Accountfilters (4 queries) — verified working on aggregates.dataset:argument — the default behaves asrealtime, where all filters work.Known limitation
The originals owned by other accounts still carry the broken filters and remain in the public Query Library; a one-line fix by their owners would retire the duplicates.
Verification
All 8 edited queries executed against the live API and returned data. Full-tree rescan: 42 Solana aggregate query blocks, 0 residual broken filters.
🤖 Generated with Claude Code