Skip to main content

Understanding Bitquery Cubes: Which Cube Answers Which Question

A cube is one GraphQL root per kind of on-chain fact. DEXTrades holds swaps, Transfers holds token movements, Balances holds what an address owns now, Calls and Events hold decoded contract activity, Blocks and Transactions hold the chain itself. Every cube takes the same where, orderBy and limit arguments, supports aggregates such as count, sum and uniq, and runs as a query or, with the keyword changed, as a WebSocket subscription. Cubes come in three families: chain-level EVM cubes under EVM(network: ...), chain-level Solana cubes under Solana, and the cross-chain Trading cubes that carry USD prices for nine chains in one schema. The dataset argument decides how far back a chain-level cube reaches.

The three families

FamilyRootCubesWhat it is for
EVMEVM(network: eth) and the other EVM chainsDEXTrades, DEXTradeByTokens, DEXPools, Transfers, Balances, Holders, BalanceUpdates, Transactions, Calls, Events, Blocks, MinerRewardsAnything on Ethereum, BNB Chain, Base, Arbitrum, Optimism, Polygon or Robinhood Chain, from a single swap to decoded contract logs
SolanaSolanaDEXTrades, DEXTradeByTokens, DEXOrders, DEXPools, Transfers, BalanceUpdates, Instructions, Transactions, Blocks, Rewards, TokenSupplyUpdatesSolana at instruction level, including launchpads and program calls
TradingTradingTrades, Tokens, Pairs, CurrenciesPrices, OHLC, market cap and supply across nine chains with one schema and USD on every row

Which cube answers which question

QuestionCube
Every swap on a DEX, with both sides and the traderDEXTrades
Volume, OHLC, buyers and sellers for one token over timeDEXTradeByTokens
Pool creation and liquidity changesDEXPools
Who sent what to whomTransfers
What an address holds right now, or who holds a tokenBalances and Holders
Every balance change, with the reasonBalanceUpdates
Method calls, internal transactions, revertsCalls
Decoded contract logs, an eth_getLogs replacementEvents
Receipts, gas, statusTransactions
A token's price on any chain, market cap, candlesTrading.Tokens, Trading.Pairs, Trading.Currencies

The comparison page DEXTrades vs DEXTradeByTokens vs Trades settles the most common choice: swap rows, per-token aggregates, or cross-chain USD prices.

Datasets decide depth

Chain-level cubes accept dataset: realtime, archive or combined. Realtime is the freshest and shortest window (hours to days depending on the cube), archive is the history, combined stitches both. Leaving the argument out means realtime, which is the usual reason a query "works" but returns nothing for last month. The Trading cubes take no dataset argument and hold roughly the last 30 days. Per-cube windows are on data coverage and retention.

A first cube query

The latest three DEX trades on Ethereum. Run it in the Bitquery IDE on a free account, then change the network, the cube or the filter.

{
EVM(network: eth) {
DEXTrades(limit: { count: 3 }, orderBy: { descending: Block_Time }) {
Block {
Time
}
Trade {
Dex {
ProtocolName
}
Buy {
Currency {
Symbol
}
Amount
}
Sell {
Currency {
Symbol
}
Amount
}
}
}
}
}

Pages in this section

PageRead it for
EVM builder termsEvery argument and field name across the EVM cubes, in one place
Solana builder termsThe same for Solana
DEX Trades cubeSwap-level rows with filters and aggregates
DEXTradeByTokens cubePer-token aggregates, OHLC and stats
DEXTrades vs DEXTradeByTokens vs TradesPicking between the three trade cubes
DEXPools cube on EVMPools, reserves and liquidity events
Transaction cubeTransactions and receipts
Balances and Holders cubesCurrent balances and holder rankings
Balance Updates cubePer-change balance history
Transfers cubeToken and native transfers
EVM token holders schemaField reference for holders

Frequently Asked Questions

What is a cube in the Bitquery API?

One GraphQL root per kind of on-chain fact, such as DEXTrades for swaps, Transfers for token movements or Balances for current holdings. Every cube takes the same where, orderBy and limit arguments and supports aggregates like count and sum.

Which cube should I use for token prices?

The Trading cubes: Tokens for a token across its pairs, Pairs for one pair, Currencies for an asset aggregated across chains. They carry USD prices, OHLC, market cap and supply for nine chains. For raw swaps on one chain use DEXTrades, and for per-token aggregates over history use DEXTradeByTokens.

Why does my query return nothing for older dates?

Chain-level cubes default to the realtime dataset, which holds only a short recent window. Add dataset: archive or dataset: combined to reach history. The Trading cubes hold about the last 30 days and take no dataset argument.

What is the difference between DEXTrades and DEXTradeByTokens?

DEXTrades returns one row per swap with both sides. DEXTradeByTokens returns one row per token side of a trade, which makes per-token filters and aggregates such as volume, OHLC and buyer counts simple. The comparison page covers the choice in detail.

Can every cube be streamed?

Yes. Change query to subscription and keep the selection set; the same rows arrive over WebSocket as they are produced. Aggregates and some Trading cube features do not survive the conversion, as the subscriptions section explains.

Build with Bitquery

Ready to run this in production?

Get an API key and run these queries in minutes, or talk to us about plans and enterprise delivery.