Skip to main content

Trading Data Overview — Chain-Level Trades vs Trading Cube

Bitquery exposes DEX trading data through two complementary product families. The choice between them is driven primarily by how far back you need to look.

Rule of thumb — pick by time window
  • Real-time + last ~30 days → use the Trading cube (Trading.Trades for swap-level rows, Trading.Tokens / Currencies / Pairs for pre-aggregated OHLC). USD price, market cap, and supply come baked in — across 8 chains in one API.
  • Older than ~30 days (historical / archive) → use chain-level DEXTrades or DEXTradeByTokens (with dataset: combined or dataset: archive). Full history, raw on-chain detail, but you derive USD yourself.

Already know you want a chain-level cube and just need to choose between DEXTrades and DEXTradeByTokens? Jump to the row-shape-level comparison: DEXTrades vs DEXTradeByTokens vs Trades cube.

Chain-Level TradesTrading Cube
Time windowFull historical archive — years of data via dataset: combined / archiveReal-time + last ~30 days only (rolling window)
Cubes / fieldsEVM.DEXTrades, EVM.DEXTradeByTokens, Solana.DEXTrades, Solana.DEXTradeByTokens, etc.Trading.Trades, Trading.Currencies, Trading.Tokens, Trading.Pairs
What it isRaw, parsed swaps directly from each chainCurated, multi-chain trading feed built on top of chain-level trades
GranularityPer-chain, per-DEX, per-swap (with calls / instructions / events context)Per-swap (Trades) + pre-aggregated OHLC (Tokens / Currencies / Pairs)
USD pricesNot present for every token — you derive prices yourselfUSD price, market cap, FDV, supply on every row via the Bitquery Price Index
OHLCBuilt on the fly from raw trades inside your query (any interval)Pre-aggregated down to 1 second (fixed intervals)
Quality filteringRaw — every on-chain swap, including MEV / outliersMEV and low-quality trades filtered out for cleaner feeds
Calls / events / instructionsYes — full transaction context availableNo — trade-only schema
ChainsEach chain has its own root (EVM, Solana, Tron, etc.)8 chains under one API: Ethereum, BSC, Solana, Base, Arbitrum, Tron, Optimism, Polygon
Best forHistorical analytics (anything older than ~30 days), archive backfills, on-chain research, anything that needs call / event contextReal-time + last ~30 days — trading UIs, charting apps, price tickers, bots, screeners, alerts — anything that wants "ready-to-use" trade + price + supply data

TL;DRLast 30 days + real-time → Trading cube. Older than 30 days → DEXTrades / DEXTradeByTokens. Same trades underneath: the Trading cube reads from DEXTrades, attaches Price-Index USD + supply, drops MEV / bad trades, and ships a clean multi-chain stream — but only for the rolling 30-day window. For anything deeper into history, drop down to the chain-level archive.


1. Chain-Level Trades — DEXTrades & DEXTradeByTokens

Chain-level trades are parsed directly from each blockchain. Every DEX swap that lands on-chain is captured, decoded, and exposed under the chain's root in GraphQL (e.g. EVM.DEXTrades, Solana.DEXTradeByTokens).

Characteristics

  • Raw and complete — every swap on every supported DEX, including MEV bots, sandwich attacks, and zero-value noise.
  • No USD price on every row — many long-tail tokens have no direct USD pair, so price has to be derived (e.g. via a routing token like WETH/USDC).
  • Full chain context — same row can be joined to calls / instructions and events / logs for the originating transaction.
  • Full historical archive — use dataset: archive or dataset: combined to backfill years of trades.
  • OHLC is built in-query — aggregate Trade.Price / Trade.PriceInUSD with Block.Time(interval: ...) to build candles at any custom interval.
  • Two access shapes for the same data:
    • DEXTrades — one row per swap, from the pool's perspective (Buy / Sell side).
    • DEXTradeByTokens — two rows per swap, from each token's perspective (ideal for token-level OHLC and "all pairs a token trades in"). Read more in the DEXTradeByTokens cube guide.

Use chain-level trades when you need:

  • Data older than ~30 days — the Trading cube doesn't go back further; only chain-level archives do.
  • Deep historical OHLC, backfills, or archive ranges of any size.
  • Per-trade detail that includes the originating call, instruction, or event log.
  • Custom OHLC intervals not supported by the pre-aggregated cubes.
  • On-chain analytics scoped to a single chain or a specific DEX protocol.

Learn more: DEX Trades API (EVM) · DEXTradeByTokens Cube · Crypto Price API vs DEXTradeByTokens.


2. Trading Cube — Trading.Trades, Tokens, Currencies, Pairs

The Trading cube is the product layer built on top of chain-level trades. It is designed for people who want trade and price data they can put straight into a UI, bot, or chart without writing aggregation logic.

It is exposed under a single Trading root and covers 8 chains in one API: Ethereum, BSC, Solana, Base, Arbitrum, Tron, Optimism, and Polygon.

What lives in the Trading cube?

CubeWhat it gives youTypical use
Trading.TradesIndividual swap-level rows with USD price, USD amounts, market cap, FDV, supply, and pair / trader / tx contextLive trade feeds, copy-trading bots, whale alerts, per-swap analytics
Trading.TokensPre-aggregated OHLC, volume, supply and moving averages for a token on a specific chainToken-level price charts, token screeners
Trading.CurrenciesPre-aggregated OHLC for a currency aggregated across chains (e.g. BTC across WBTC, cbBTC, native BTC, etc.)Chain-agnostic global price for an asset
Trading.PairsPre-aggregated OHLC and volume per trading pair on a specific market/DEXPair-specific charts (e.g. SOL/USDC on Raydium)

Characteristics

  • USD price on every row — powered by the Bitquery Price Index, which derives a USD value for every token (even long-tail tokens with no direct stable pair).
  • Supply & market-cap snapshots included — MarketCap, FullyDilutedValuationUsd, CirculatingSupply, TotalSupply, MaxSupply. See Supply fields.
  • Pre-aggregated OHLC in Tokens, Currencies and Pairs — down to 1-second candles, with fixed intervals (1, 3, 5, 10, 30, 60, 300, 900, 1800, 3600 seconds).
  • MEV and low-quality trades are filtered out — outliers, sandwich attacks, near-zero amounts, and bad prints are removed so the feed is safe to render to end users.
  • No calls / events / instructions — the schema is intentionally trade-shaped; for transaction context, drop down to the chain-level APIs.
  • Rolling ~30-day window — Trading cube data is not a deep archive; for older trades use the chain-level DEXTrades archive.

Use the Trading cube when you need:

  • Real-time data or anything within the last ~30 days — this is the default for live trading UIs, bots, dashboards, and screeners.
  • A multi-chain trade or price stream without writing per-chain queries.
  • USD pricing, market cap, and supply ready on every row (no separate price lookups).
  • Pre-aggregated OHLC at 1-second or longer intervals (Tokens / Currencies / Pairs).
  • A clean, MEV-filtered feed safe to render in a trading UI or feed to a bot.
  • Sub-second latency over GraphQL subscriptions or the trading.prices Kafka topic.

Learn more: Crypto Trades API · Crypto Price API · Price Index Algorithm.


How the two layers relate

                ┌───────────────────────────────────────┐
│ On-chain swaps (every DEX) │
└────────────────────┬──────────────────┘
│ parsed per chain

┌──────────────────────────────────────────────────────────────┐
│ Chain-Level Trades │
│ EVM.DEXTrades / EVM.DEXTradeByTokens │
│ Solana.DEXTrades / Solana.DEXTradeByTokens / … │
│ + calls, events, instructions │
│ + full historical archive │
└────────────────────┬─────────────────────────────────────────┘
│ MEV + bad-trade filtering
│ Bitquery Price Index attaches USD + supply

┌──────────────────────────────────────────────────────────────┐
│ Trading Cube (8 chains under one API) │
│ Trading.Trades — clean swap-level rows + USD │
│ Trading.Tokens — pre-aggregated token OHLC │
│ Trading.Currencies — cross-chain currency OHLC │
│ Trading.Pairs — per-market pair OHLC │
│ ~30-day rolling window │
└──────────────────────────────────────────────────────────────┘

In short: Trading.Trades is sourced from DEXTrades, with MEV / low-quality trades dropped and Price-Index USD + supply data joined on. The aggregated cubes (Tokens, Currencies, Pairs) are then built on top of that cleaned trade stream.


Which API should I use?

The first two rows answer the question for 80% of users — pick by how far back you need data. The rest are tie-breakers when both windows would technically work.

If you want to…Use
Get real-time or last ~30 days of trades / OHLCTrading.Trades (swap-level) or Trading.Tokens / Pairs / Currencies (OHLC)
Get older than ~30 days of trades or candles (historical / archive)EVM.DEXTradeByTokens / Solana.DEXTradeByTokens (with dataset: combined or archive)
Render a real-time trade tape in a trading UITrading.Trades
Power a price ticker / candle chart with ready USD valuesTrading.Tokens or Trading.Pairs
Get a chain-agnostic price for an asset (e.g. BTC across all chains)Trading.Currencies
Stream all swaps on 8 chains in one subscriptionTrading.Trades
Build OHLC at a custom interval (e.g. 7-second, 4-hour)DEXTradeByTokens (in-query aggregation)
Join trades to the originating call / instruction / event logEVM.DEXTrades / Solana.DEXTrades
Analyse MEV, sandwich attacks, or raw flowChain-level (Trading cube filters these out)
Build wallet-level PnL with USD attribution out-of-the-boxTrading.Trades
Mixing both layers

A common pattern is to use the Trading cube for the live + 30-day-window tab of your UI (clean USD prices, low latency, multi-chain) and drop down to DEXTradeByTokens for the historical tab of the same UI (deep archive, custom intervals).


Next steps