Overview
Every Chain Group in ChainStream GraphQL accepts two optional parameters that control which underlying tables are queried. These parameters let you optimize for freshness, query speed, or data completeness depending on your use case.Dataset Parameter
Thedataset parameter controls the time scope of the data being queried. It determines whether the query hits real-time tables, archive tables, or both.
Usage
Historical Data Backfilling
When building data pipelines or recovering from downtime, you can usedataset: archive with time-range filters to backfill historical data:
- Record the last processed timestamp or block height
- Query
dataset: archivewith awherefilter from your last checkpoint to the current time - Process the backfilled data
- Switch to
dataset: realtimefor ongoing monitoring
Tables Without Dataset Support
Some Cubes always query the same table regardless of thedataset value. These include:
- DWS Cubes:
TokenHolders,WalletTokenPnL,DEXPools— these represent current-state snapshots - Special tables:
TransactionBalances,PredictionTrades,PredictionManagements,PredictionSettlements
dataset is silently ignored.
Aggregates Parameter
Theaggregates parameter controls whether the query uses pre-aggregated materialized views (DWM layer) instead of raw detail tables (DWD layer). Pre-aggregated tables contain pre-computed rollups (typically per-minute) that are significantly faster to query.
Usage
When to Use Each Mode
Combining Both Parameters
You can usedataset and aggregates together:
Performance Considerations
Use realtime for dashboards
dataset: realtime queries a smaller table partition, resulting in faster response times for monitoring use cases.Use aggregates for analytics
aggregates: yes or only leverages pre-computed rollups that are orders of magnitude faster than scanning raw event tables.Related Documentation
Schema Overview
See how dataset and aggregates fit into the overall query structure.
Data Cubes
Check which Cubes support dataset switching.

