Documentation Index
Fetch the complete documentation index at: https://docs.chainstream.io/llms.txt
Use this file to discover all available pages before exploring further.
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.
| Value | Description | Typical Use Case |
|---|---|---|
combined | Queries both real-time and archive data (default) — typically covers the last ~7–10 days | General-purpose queries where you need the full range |
realtime | Only recent data (approximately the last 24 hours) | Monitoring dashboards, latest trades, real-time alerts |
archive | Only historical data within the retention window (~7–10 days) | Historical analysis, backfilling, trend research |
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.
| Value | Description | Typical Use Case |
|---|---|---|
yes | Prefer pre-aggregated tables when available (default behavior) | Most analytical queries |
no | Use raw detail tables only | When you need per-event granularity |
only | Only use pre-aggregated tables | Maximum query speed, accepts limited field set |
Usage
When to Use Each Mode
| Scenario | Recommended | Why |
|---|---|---|
| Building OHLC charts | aggregates: only | Pre-computed candlestick data, fastest response |
| Volume trends over time | aggregates: yes | Leverages pre-aggregated volume stats |
| Individual trade analysis | aggregates: no | Need per-event detail that rollups don’t provide |
| Counting unique traders | aggregates: yes | Pre-computed unique counts available |
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.

