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
| Family | Root | Cubes | What it is for |
|---|---|---|---|
| EVM | EVM(network: eth) and the other EVM chains | DEXTrades, DEXTradeByTokens, DEXPools, Transfers, Balances, Holders, BalanceUpdates, Transactions, Calls, Events, Blocks, MinerRewards | Anything on Ethereum, BNB Chain, Base, Arbitrum, Optimism, Polygon or Robinhood Chain, from a single swap to decoded contract logs |
| Solana | Solana | DEXTrades, DEXTradeByTokens, DEXOrders, DEXPools, Transfers, BalanceUpdates, Instructions, Transactions, Blocks, Rewards, TokenSupplyUpdates | Solana at instruction level, including launchpads and program calls |
| Trading | Trading | Trades, Tokens, Pairs, Currencies | Prices, OHLC, market cap and supply across nine chains with one schema and USD on every row |
Which cube answers which question
| Question | Cube |
|---|---|
| Every swap on a DEX, with both sides and the trader | DEXTrades |
| Volume, OHLC, buyers and sellers for one token over time | DEXTradeByTokens |
| Pool creation and liquidity changes | DEXPools |
| Who sent what to whom | Transfers |
| What an address holds right now, or who holds a token | Balances and Holders |
| Every balance change, with the reason | BalanceUpdates |
| Method calls, internal transactions, reverts | Calls |
Decoded contract logs, an eth_getLogs replacement | Events |
| Receipts, gas, status | Transactions |
| A token's price on any chain, market cap, candles | Trading.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
| Page | Read it for |
|---|---|
| EVM builder terms | Every argument and field name across the EVM cubes, in one place |
| Solana builder terms | The same for Solana |
| DEX Trades cube | Swap-level rows with filters and aggregates |
| DEXTradeByTokens cube | Per-token aggregates, OHLC and stats |
| DEXTrades vs DEXTradeByTokens vs Trades | Picking between the three trade cubes |
| DEXPools cube on EVM | Pools, reserves and liquidity events |
| Transaction cube | Transactions and receipts |
| Balances and Holders cubes | Current balances and holder rankings |
| Balance Updates cube | Per-change balance history |
| Transfers cube | Token and native transfers |
| EVM token holders schema | Field 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.
Related pages
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.