Skip to main content
ChainStream GraphQL is an OLAP analytical API that exposes multi-chain on-chain data (Solana, Ethereum, BSC, Polygon) through a single GraphQL endpoint. Query exactly the fields you need, aggregate data on the fly, and explore the schema interactively — all powered by a high-performance OLAP database.

What is ChainStream GraphQL

ChainStream GraphQL provides a declarative query interface for on-chain analytical data. Instead of calling dozens of REST endpoints with fixed response shapes, you write a single GraphQL query that specifies exactly what data you want, how it should be filtered, and how it should be aggregated. The service is built on activecube-rs, which dynamically generates a GraphQL schema from Cube definitions — each Cube represents an analytical data model (e.g. DEX trades, token transfers, OHLC candles). Queries are compiled into optimized SQL and executed against a high-performance OLAP database.

GraphQL vs REST Data API

GraphQL APIREST Data API
Query StyleDeclarative — you define shape, filters, aggregationImperative — fixed endpoints with predefined params
Field SelectionClient picks exactly the fields neededServer returns a fixed response schema
AggregationBuilt-in count, sum, avg, min, max per queryPredefined aggregated endpoints only
EndpointSingle endpoint for all data modelsOne endpoint per resource
Paginationlimit + offset in query argumentslimit + offset / cursor in query params
Best ForAnalytics, dashboards, flexible explorationSimple lookups, real-time price, wallet balance
LatencyOptimized for throughput over latencyOptimized for low-latency single-resource reads
Use GraphQL when you need flexible analytical queries — aggregating trades, computing PnL across time ranges, or building custom dashboards. Use the REST API when you need fast, simple lookups like current token price or wallet balance.

Core Advantages

Single Endpoint

One URL serves 25 data Cubes across 4 chains. No endpoint sprawl — just change your query.

Client-Selected Fields

Request only the columns you need. No over-fetching, no under-fetching — ideal for bandwidth-constrained clients.

Built-in Aggregation

Compute count, sum, avg, min, max directly in your query without post-processing.

Supported Chains

Network IDBlockchainChain GroupCoverage
ethEthereumEVMFull DEX, transfers, balance updates, events, traces, token stats
bscBNB Chain (BSC)EVMFull DEX, transfers, balance updates, events, traces, token stats
polygonPolygonEVMFull DEX, transfers, balance updates, prediction markets
solSolanaSolanaFull DEX, transfers, instructions, token holders, OHLC, PnL
Queries are organized into three Chain Groups: EVM (requires a network argument), Solana, and Trading (cross-chain OHLC and token statistics). See Chain Groups for details.

Available Data Cubes

25 Cubes are available across three Chain Groups, each representing a distinct analytical model:
  • DEXTrades — Individual DEX swap events with buy/sell amounts, prices, and DEX protocol info
  • DEXTradeByTokens — DEX trades indexed by token for efficient per-token queries
  • DEXOrders — DEX order events including limit orders (Solana only)
  • DEXPoolEvents — Liquidity add/remove events on DEX pools
  • DEXPools — DEX pool snapshots with current reserves and metadata
  • DEXPoolSlippages — Pool slippage data (EVM only)
  • TokenSupplyUpdates — Mint and burn events affecting token supply
  • Transfers — Token transfer events with sender, receiver, amounts, and USD values
  • BalanceUpdates — Wallet balance change events per token
  • TokenHolders — Current holder list and distribution for a token
  • WalletTokenPnL — PnL per wallet-token pair
  • Pairs — OHLC candlestick data at configurable time intervals (formerly referenced as OHLC)
  • Tokens — Aggregated trade statistics per token: volume, trade count, unique traders (formerly referenced as TokenTradeStats)
  • Blocks — Block-level data (timestamps, height, miners/validators)
  • Transactions — Transaction-level data (hash, status, gas/fees)
  • TransactionBalances — Per-transaction balance changes
  • Events — Smart contract event logs (EVM only)
  • Calls — Internal call traces (EVM only)
  • Instructions — Instruction-level data (Solana only)
  • InstructionBalanceUpdates — Instruction-level balance changes (Solana only)
  • Rewards — Validator/staking rewards (Solana only)
  • MinerRewards — Miner/validator rewards (EVM only)
  • Uncles — Uncle block data (EVM only)
  • PredictionTrades — Prediction market trade events (EVM — Polygon)
  • PredictionManagements — Prediction market management events (EVM — Polygon)
  • PredictionSettlements — Prediction market settlement events (EVM — Polygon)

Key Query Parameters

Beyond standard filtering and pagination, ChainStream GraphQL supports two powerful parameters at the Chain Group level:
ParameterValuesDescription
datasetrealtime, archive, combined (default)Controls data source scope — recent data only, historical data, or full range
aggregatesyes, no, onlyControls whether to use pre-aggregated tables for faster analytical queries
See Dataset & Aggregates for detailed usage and examples.

Architecture

All requests pass through the APISIX gateway for authentication and rate limiting. The chainstream-graphql service compiles GraphQL queries into optimized SQL executed against the OLAP analytical database.

Next Steps

Endpoints & Auth

Configure the endpoint URL, authentication headers, and understand the request/response format.

First Query

Run your first GraphQL query step by step — from the IDE or cURL.

GraphQL IDE

Explore the interactive GraphQL IDE with auto-complete, query templates, and code export.