Skip to main content

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

ChainStream GraphQL organizes its 25 Cubes into three Chain Groups. Each group represents a blockchain ecosystem and determines which Cubes are available, how the network parameter works, and what chain-specific fields exist.
type ChainStream {
  EVM(network: Network!, dataset: Dataset, aggregates: Aggregates) { ... }
  Solana(network: SolanaNetwork, dataset: Dataset, aggregates: Aggregates) { ... }
  Trading(dataset: Dataset, aggregates: Aggregates) { ... }
}

EVM

The EVM group contains Cubes for all EVM-compatible blockchains. It requires a network argument to specify which chain to query.

Available Networks

Network IDBlockchain
ethEthereum
bscBNB Chain (BSC)
polygonPolygon
Polygon data availability: Currently only Prediction Markets Cubes (PredictionTrades, PredictionManagements, PredictionSettlements) have data available for Polygon. Other Cubes (DEXTrades, Blocks, Transfers, etc.) are being deployed — queries against them may return errors.

Cubes

Shared with Solana: DEXTrades, DEXTradeByTokens, Transfers, BalanceUpdates, DEXPoolEvents, TokenSupplyUpdates, Blocks, Transactions, TransactionBalances, DEXPools, TokenHolders, WalletTokenPnL EVM-only:
  • Events — Smart contract event logs (decoded topics and data)
  • Calls — Internal call traces (CALL, DELEGATECALL, CREATE, etc.)
  • MinerRewards — Block rewards breakdown (static, dynamic, uncle, burned fees)
  • DEXPoolSlippages — Pool price slippage analysis
  • Uncles — Uncle block data (primarily Ethereum PoW historical)
  • PredictionTrades — Prediction market trades (primarily Polygon)
  • PredictionManagements — Prediction market management events (primarily Polygon)
  • PredictionSettlements — Prediction market settlements (primarily Polygon)

Example Query

query {
  EVM(network: eth, dataset: combined) {
    DEXTrades(
      limit: {count: 10}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time Number }
      Transaction { Hash }
      Trade {
        Buy { Currency { SmartContract Symbol } Amount PriceInUSD }
        Sell { Currency { SmartContract Symbol } Amount }
        Dex { ProtocolName }
      }
    }
  }
}

Solana

The Solana group contains Cubes for the Solana blockchain. The network argument is available and accepts solana as its value. It is optional and defaults to solana.

Cubes

Shared with EVM: DEXTrades, DEXTradeByTokens, Transfers, BalanceUpdates, DEXPoolEvents, TokenSupplyUpdates, Blocks, Transactions, TransactionBalances, DEXPools, TokenHolders, WalletTokenPnL Solana-only:
  • Instructions — Program instruction data (program address, method, accounts, logs)
  • InstructionBalanceUpdates — Balance changes at instruction level
  • Rewards — Validator and staking rewards
  • DEXOrders — DEX order book events (limit orders, cancellations, fills)

Example Query

query {
  Solana(dataset: realtime) {
    DEXTrades(
      limit: {count: 10}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time Slot }
      Transaction { Hash }
      Trade {
        Buy { Currency { MintAddress Symbol } Amount PriceInUSD }
        Sell { Currency { MintAddress Symbol } Amount }
        Dex { ProgramAddress ProtocolName }
      }
    }
  }
}

Field Names Across Chains

The table below shows the conventional field names for each chain. However, the Record type contains all fields from all chains as a superset — both MintAddress and SmartContract exist in every Cube’s Record type and return the same underlying data. You can use either name on any chain.
ConceptConventional (Solana)Conventional (EVM)Cross-chain?
Token addressMintAddressSmartContractBoth work on all chains
Transaction IDSignature / HashHashBoth work on all chains
Block identifierSlotNumberBoth work on all chains
Program/ContractProgramAddressSmartContractBoth work on all chains
Fee payerFeePayerFromBoth work on all chains
This means you can use a single query template across all chains without changing field names. For example, Currency { MintAddress } works on both Solana and EVM queries.

Trading

The Trading group provides cross-chain pre-aggregated trading analytics. It combines data from all supported chains into unified materialized views with a chain dimension for filtering.

Cubes

  • Pairs — OHLC candlestick data (open/high/low/close, volume, trade count)
  • Tokens — Per-token trade statistics (volume, buy/sell breakdown, unique traders)

Key Differences from EVM/Solana Groups

  1. No network argument — The Trading group combines data across chains. Use the chain dimension within the data to filter by network.
  2. Cross-chain data — A single query can return data for sol, eth, and bsc together.
  3. Pre-aggregated — Data is materialized at minute granularity from the DWM layer.

Example: Cross-Chain OHLC

query {
  Trading(aggregates: yes) {
    Pairs(
      where: { Token: { Address: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } } }
      limit: {count: 60}
      orderBy: {descending: Block_Time}
    ) {
      Token { Address }
      Market { Network }
      Interval { Time }
      Price { Ohlc { Open High Low Close } }
      Volume { Usd Native }
      Stats { TradeCount BuyCount SellCount }
    }
  }
}

Example: Token Trade Stats by Chain

query {
  Trading {
    Tokens(
      where: {
        Token: { Address: { is: "0xdac17f958d2ee523a2206206994597c13d831ec7" } }
        Market: { Network: { is: "eth" } }
      }
      limit: {count: 30}
      orderBy: {descending: Block_Time}
    ) {
      Interval { Time }
      Volume { Usd BuyVolumeUSD SellVolumeUSD }
      Stats { TradeCount UniqueBuyers UniqueSellers }
    }
  }
}

Chain Group Comparison

FeatureEVMSolanaTrading
network argumentRequired (eth, bsc, polygon)Optional (solana, defaults to solana)Not needed (cross-chain)
Unique CubesEvents, Calls, MinerRewards, Uncles, DEXPoolSlippages, Prediction*Instructions, InstructionBalanceUpdates, Rewards, DEXOrdersPairs, Tokens
Data granularityPer-event (DWD) + aggregated (DWM/DWS)Per-event + instruction-levelPre-aggregated (DWM)
dataset supportYes (most Cubes)Yes (most Cubes)Yes
aggregates supportYesYesYes

Data Cubes

Detailed field structures and use cases for all 25 Cubes.

Dataset & Aggregates

Control data source scope and pre-aggregation behavior.