Skip to main content

EVM Queries

Updated on
Nov 16, 2026

EVM Queries

SQL Explorer includes pre-built EVM queries for network activity, transactions, token transfers, contracts, and trading. Search or filter the list below to find a query, then expand it for a REST API request and an abbreviated response example. Queries that differ only by network are listed once.

Use cluster ID evm-mainnet when running these queries through the SQL Explorer REST API. See the EVM Schema for the tables and columns used below.

Choose a Network​

Networknetwork value
Multichain MainnetSeveral values in one query
Ethereum Mainnetethereum-mainnet
BSC Mainnetbsc
Base Mainnetbase-mainnet
Arbitrum Mainnetarbitrum-mainnet
Robinhood Mainnetrobinhood-mainnet
Arc Mainnetarc-mainnet
Elysium Mainnetelysium-mainnet

The multichain examples compare all seven networks in the table by default. Edit their network IN (...) lists to include other networks from the table. The Chain filter shows networks with pre-built queries in this catalog. Each expanded query lists its available networks; with the filter set to All chains, examples use ethereum-mainnet.

The examples use evm_hash_pretty() and evm_address_pretty() to display binary hashes and addresses. Some queries contain example addresses, token contracts, or time windows; edit those values for your analysis. Filter large tables by network and block range to limit data scanned.

Browse Queries​

Indexed networksThe indexed chains with their chain ID and native currency.Blocks & Network
Available on
  • Multichain Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Add or remove names in the IN list to list other chains.\nSELECT\n network,\n chain_id,\n symbol AS native_symbol,\n decimals AS native_decimals\nFROM evm_native_currencies FINAL\nWHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\nORDER BY chain_id\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
Chain activity overviewBlocks, transactions, average block time, throughput, gas utilisation and base fee per chain over the last hour.Blocks & Network
Available on
  • Multichain Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Add or remove names in the IN list to compare other chains.\nSELECT\n network,\n count() AS blocks,\n sum(transaction_count) AS transactions,\n round((max(timestamp) - min(timestamp)) / nullIf(count() - 1, 0), 3) AS avg_block_time_s,\n round(sum(transaction_count) / nullIf(max(timestamp) - min(timestamp), 0), 2) AS transactions_per_s,\n round(100 * sum(gas_used) / sum(gas_limit), 2) AS gas_used_pct,\n round(avg(base_fee_per_gas) / 1e9, 3) AS avg_base_fee_gwei\nFROM evm_blocks FINAL\nWHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND block_datetime >= now() - INTERVAL 1 HOUR\nGROUP BY network\nORDER BY network\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
Ingestion freshnessEach chain's newest indexed block, how far it trails the wall clock, and the average delay from block time to ingestion over the last day.Blocks & Network
Available on
  • Multichain Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Add or remove names in the IN list to compare other chains.\nSELECT\n network,\n max(number) AS head_block,\n evm_hash_pretty(argMax(hash, number)) AS head_hash,\n max(block_datetime) AS head_time,\n dateDiff('second', head_time, now()) AS seconds_behind,\n -- Backfilled blocks raise this average, so it reflects live ingestion only when the chain is caught up.\n round(avg(toUnixTimestamp64Milli(ingested_at) / 1000 - timestamp), 2) AS avg_ingest_delay_s\nFROM evm_blocks FINAL\nWHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND block_datetime >= now() - INTERVAL 1 DAY\nGROUP BY network\nORDER BY network\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
Transaction type mixShare of each EIP-2718 transaction type per chain over the last hour.Transactions
Available on
  • Multichain Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Add or remove names in both IN lists to compare other chains.\nSELECT\n network,\n transaction_type,\n multiIf(\n transaction_type IS NULL, 'unknown',\n transaction_type = 0, 'legacy',\n transaction_type = 1, 'EIP-2930 access list',\n transaction_type = 2, 'EIP-1559 dynamic fee',\n transaction_type = 3, 'EIP-4844 blob',\n transaction_type = 4, 'EIP-7702 set code',\n 'chain-specific'\n ) AS type_label,\n count() AS transactions,\n round(100 * count() / sum(count()) OVER (PARTITION BY network), 2) AS pct_of_chain\nFROM evm_transactions FINAL\nWHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND (network, block_number) IN\n (\n SELECT network, number\n FROM evm_blocks\n WHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND block_datetime >= now() - INTERVAL 1 HOUR\n )\n AND block_datetime >= now() - INTERVAL 1 HOUR\nGROUP BY network, transaction_type\nORDER BY network, transactions DESC\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
Failed transactions by chainFailure rate per chain over the last hour and the fees senders paid for transactions that reverted, in native units.Transactions
Available on
  • Multichain Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Add or remove names in both IN lists to compare other chains.\nSELECT\n stats.network AS network,\n stats.transactions AS transactions,\n stats.failed AS failed,\n round(100 * stats.failed / stats.transactions, 2) AS failed_pct,\n stats.failed_fees / exp10(currency.decimals) AS failed_fees_native,\n currency.symbol AS native_symbol\nFROM\n(\n SELECT\n network,\n count() AS transactions,\n countIf(status = false) AS failed,\n sumIf(gas_used * effective_gas_price, status = false) AS failed_fees\n FROM evm_transactions FINAL\n WHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND (network, block_number) IN\n (\n SELECT network, number\n FROM evm_blocks\n WHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND block_datetime >= now() - INTERVAL 1 HOUR\n )\n AND block_datetime >= now() - INTERVAL 1 HOUR\n GROUP BY network\n) AS stats\nGLOBAL LEFT JOIN\n(\n SELECT network, symbol, decimals\n FROM evm_native_currencies FINAL\n) AS currency ON stats.network = currency.network\nORDER BY network\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
Fee spend by chainTotal and average transaction fees per chain in native units over the last hour, with median and p90 effective gas price.Transactions
Available on
  • Multichain Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Add or remove names in both IN lists to compare other chains.\nSELECT\n stats.network AS network,\n stats.transactions AS transactions,\n stats.total_fees / exp10(currency.decimals) AS total_fees_native,\n stats.total_fees / stats.transactions / exp10(currency.decimals) AS avg_fee_native,\n round(stats.p50_gas_price / 1e9, 3) AS p50_gas_price_gwei,\n round(stats.p90_gas_price / 1e9, 3) AS p90_gas_price_gwei,\n currency.symbol AS native_symbol\nFROM\n(\n SELECT\n network,\n count() AS transactions,\n sum(gas_used * effective_gas_price) AS total_fees,\n quantile(0.5)(toFloat64(effective_gas_price)) AS p50_gas_price,\n quantile(0.9)(toFloat64(effective_gas_price)) AS p90_gas_price\n FROM evm_transactions FINAL\n WHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND (network, block_number) IN\n (\n SELECT network, number\n FROM evm_blocks\n WHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND block_datetime >= now() - INTERVAL 1 HOUR\n )\n AND block_datetime >= now() - INTERVAL 1 HOUR\n GROUP BY network\n) AS stats\nGLOBAL LEFT JOIN\n(\n SELECT network, symbol, decimals\n FROM evm_native_currencies FINAL\n) AS currency ON stats.network = currency.network\nORDER BY network\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
Contract deployments by chainSuccessful CREATE and CREATE2 frames per chain over the last hour, split by whether a transaction sender or a contract (factory) deployed them.Contracts
Available on
  • Multichain Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Add or remove names in both IN lists to compare other chains.\nSELECT\n network,\n count() AS deployments,\n countIf(call_type = 'CREATE') AS create_deployments,\n countIf(call_type = 'CREATE2') AS create2_deployments,\n -- A top-level frame has an empty trace address, so the transaction sender deployed it.\n countIf(empty(trace_address)) AS deployed_by_eoa,\n countIf(NOT empty(trace_address)) AS deployed_by_factory,\n uniqExact(from_address) AS unique_deployers\nFROM evm_traces FINAL\nWHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND (network, block_number) IN\n (\n SELECT network, number\n FROM evm_blocks\n WHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND block_datetime >= now() - INTERVAL 1 HOUR\n )\n AND block_datetime >= now() - INTERVAL 1 HOUR\n AND call_type IN ('CREATE', 'CREATE2')\n AND error = ''\nGROUP BY network\nORDER BY network\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
EIP-7702 delegation targetsThe contracts accounts delegated to most through EIP-7702 authorizations over the last hour, and the chains each appears on.Contracts
Available on
  • Multichain Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Add or remove names in both IN lists to compare other chains.\nSELECT\n -- 0x0000000000000000000000000000000000000000 clears an existing delegation.\n evm_address_pretty(delegate) AS delegate_target,\n arraySort(groupUniqArray(network)) AS networks,\n count() AS authorizations,\n uniqExact(network, hash) AS transactions,\n uniqExact(from_address) AS unique_submitters\nFROM evm_transactions FINAL\nARRAY JOIN authorization_addresses AS delegate\nWHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND (network, block_number) IN\n (\n SELECT network, number\n FROM evm_blocks\n WHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND block_datetime >= now() - INTERVAL 1 HOUR\n )\n AND block_datetime >= now() - INTERVAL 1 HOUR\n AND transaction_type = 4\nGROUP BY delegate\nORDER BY authorizations DESC\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
Native transfer volume by chainNative-currency transfers per chain over the last hour, split into top-level and internal (trace-level) ones, with volume in native units.Tokens & Transfers
Available on
  • Multichain Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Add or remove names in both IN lists to compare other chains.\nSELECT\n stats.network AS network,\n stats.transfers AS transfers,\n stats.top_level_transfers AS top_level_transfers,\n stats.internal_transfers AS internal_transfers,\n stats.volume / exp10(currency.decimals) AS volume_native,\n currency.symbol AS native_symbol,\n stats.unique_senders AS unique_senders,\n stats.unique_recipients AS unique_recipients\nFROM\n(\n SELECT\n network,\n count() AS transfers,\n countIf(NOT is_internal) AS top_level_transfers,\n countIf(is_internal) AS internal_transfers,\n sum(amount) AS volume,\n uniqExact(from_address) AS unique_senders,\n uniqExact(to_address) AS unique_recipients\n FROM evm_native_transfers FINAL\n WHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND (network, block_number) IN\n (\n SELECT network, number\n FROM evm_blocks\n WHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND block_datetime >= now() - INTERVAL 1 HOUR\n )\n AND block_datetime >= now() - INTERVAL 1 HOUR\n GROUP BY network\n) AS stats\nGLOBAL LEFT JOIN\n(\n SELECT network, symbol, decimals\n FROM evm_native_currencies FINAL\n) AS currency ON stats.network = currency.network\nORDER BY network\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
ERC-20 activity by chainERC-20 Transfer events per chain over the last hour: transfers, distinct tokens and senders, and the busiest token.Tokens & Transfers
Available on
  • Multichain Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Add or remove names in both IN lists to compare other chains.\nSELECT\n network,\n count() AS transfers,\n uniqExact(address) AS distinct_tokens,\n uniqExact(topic1) AS distinct_senders,\n -- On arc-mainnet the native USDC emitter 0xffff…fffe also emits Transfer for every native movement.\n evm_address_pretty(topK(1)(address)[1]) AS busiest_token\nFROM evm_logs FINAL\nWHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND (network, block_number) IN\n (\n SELECT network, number\n FROM evm_blocks\n WHERE network IN ('ethereum-mainnet', 'bsc', 'robinhood-mainnet', 'arc-mainnet', 'arbitrum-mainnet', 'base-mainnet', 'elysium-mainnet')\n AND block_datetime >= now() - INTERVAL 1 HOUR\n )\n AND block_datetime >= now() - INTERVAL 1 HOUR\n -- A subquery turns the converted literal into a constant the primary key and bloom indexes can use.\n -- keccak256(\"Transfer(address,address,uint256)\"). ERC-721 indexes a third topic instead of data.\n AND topic0 = (SELECT evm_hash('0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'))\n AND topic3 IS NULL\n AND length(data) = 32\nGROUP BY network\nORDER BY network\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
Latest blocksThe 25 most recent blocks: transaction count, gas usage, base fee and fee recipient.Blocks & Network
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head\nSELECT\n number AS block_number,\n evm_hash_pretty(hash) AS block_hash,\n block_datetime,\n transaction_count,\n gas_used,\n gas_limit,\n round(100 * gas_used / gas_limit, 2) AS gas_used_pct,\n round(base_fee_per_gas / 1e9, 3) AS base_fee_gwei,\n evm_address_pretty(miner) AS fee_recipient\nFROM evm_blocks FINAL\nWHERE network = 'ethereum-mainnet' AND number > head - 25\nORDER BY number DESC\nLIMIT 25",
"clusterId": "evm-mainnet"
}
JSON
Gas and fee trendPer-minute base fee, gas utilisation and transactions per block over the last 1000 blocks.Blocks & Network
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head\nSELECT\n toStartOfMinute(block_datetime) AS minute,\n count() AS blocks,\n round(avg(base_fee_per_gas) / 1e9, 3) AS avg_base_fee_gwei,\n round(100 * sum(gas_used) / sum(gas_limit), 2) AS gas_used_pct,\n round(avg(transaction_count), 1) AS avg_txs_per_block\nFROM evm_blocks FINAL\nWHERE network = 'ethereum-mainnet' AND number > head - 1000\nGROUP BY minute\nORDER BY minute DESC\nLIMIT 1000",
"clusterId": "evm-mainnet"
}
JSON
Blob usageEIP-4844 blobs, excess blob gas and base fee for each of the last 100 blocks.Blocks & Network
Available on
  • Ethereum Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head\nSELECT\n number AS block_number,\n evm_hash_pretty(hash) AS block_hash,\n block_datetime,\n -- Each blob consumes 2^17 blob gas.\n intDiv(blob_gas_used, 131072) AS blobs,\n excess_blob_gas,\n round(base_fee_per_gas / 1e9, 3) AS base_fee_gwei\nFROM evm_blocks FINAL\nWHERE network = 'ethereum-mainnet' AND number > head - 100\nORDER BY number DESC\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
Beacon withdrawalsThe 100 addresses that received the most consensus-layer withdrawals over the last 1000 blocks, with the validators paying them.Blocks & Network
Available on
  • Ethereum Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head\nSELECT\n evm_address_pretty(recipient) AS recipient,\n count() AS withdrawals,\n -- Withdrawal amounts are denominated in gwei.\n sum(amount_gwei) / 1e9 AS total_eth,\n uniqExact(validator_index) AS distinct_validators\nFROM evm_blocks FINAL\nARRAY JOIN\n withdrawal_addresses AS recipient,\n withdrawal_amounts AS amount_gwei,\n withdrawal_validator_indexes AS validator_index\nWHERE network = 'ethereum-mainnet' AND number > head - 1000\nGROUP BY recipient\nORDER BY total_eth DESC\nLIMIT 100",
"clusterId": "evm-mainnet"
}
JSON
Block cadenceHistogram of the intervals between the last 1000 blocks, with overall count, median, p99 and share of empty blocks.Blocks & Network
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head,\n (SELECT symbol FROM evm_native_currencies FINAL WHERE network = 'ethereum-mainnet') AS fee_symbol\nSELECT\n -- Block timestamps have one-second resolution, so sub-second blocks share an interval of 0.\n interval_s,\n count() AS blocks,\n round(100 * count() / sum(count()) OVER (), 2) AS pct_of_blocks,\n round(100 * countIf(transaction_count = 0) / count(), 2) AS empty_block_pct,\n round(avg(base_fee_per_gas) / 1e9, 3) AS avg_base_fee_gwei,\n fee_symbol,\n any(total_intervals) AS total_intervals,\n any(p50_interval_s) AS p50_interval_s,\n any(p99_interval_s) AS p99_interval_s,\n any(overall_empty_block_pct) AS overall_empty_block_pct\nFROM\n(\n SELECT\n interval_s,\n transaction_count,\n base_fee_per_gas,\n count() OVER () AS total_intervals,\n quantileExact(0.5)(interval_s) OVER () AS p50_interval_s,\n quantileExact(0.99)(interval_s) OVER () AS p99_interval_s,\n round(100 * avg(transaction_count = 0) OVER (), 2) AS overall_empty_block_pct\n FROM\n (\n SELECT\n number,\n transaction_count,\n base_fee_per_gas,\n toInt64(timestamp) - lagInFrame(toInt64(timestamp)) OVER previous AS interval_s,\n lagInFrame(number) OVER previous AS previous_number\n FROM evm_blocks FINAL\n WHERE network = 'ethereum-mainnet' AND number > head - 1001\n WINDOW previous AS (ORDER BY number ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)\n )\n -- Skips the oldest block and any block whose predecessor is not indexed.\n WHERE previous_number = number - 1\n)\nGROUP BY interval_s\nORDER BY interval_s\nLIMIT 1000",
"clusterId": "evm-mainnet"
}
JSON
Latest block transactionsEvery transaction in the head block with its value and fee in native units.Transactions
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head,\n (SELECT symbol FROM evm_native_currencies FINAL WHERE network = 'ethereum-mainnet') AS native_symbol,\n (SELECT decimals FROM evm_native_currencies FINAL WHERE network = 'ethereum-mainnet') AS native_decimals\nSELECT\n block_number,\n transaction_index,\n evm_hash_pretty(hash) AS transaction_hash,\n evm_address_pretty(from_address) AS sender,\n evm_address_pretty(to_address) AS recipient,\n value / exp10(native_decimals) AS value_native,\n status AS succeeded,\n gas_used * effective_gas_price / exp10(native_decimals) AS fee_native,\n native_symbol\nFROM evm_transactions FINAL\nWHERE network = 'ethereum-mainnet' AND block_number = head\nORDER BY transaction_index\nLIMIT 1000",
"clusterId": "evm-mainnet"
}
JSON
Top contracts by gasThe 25 transaction targets that used the most gas over the last 1000 blocks, with failure rate.Transactions
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head\nSELECT\n evm_address_pretty(to_address) AS target,\n sum(gas_used) AS total_gas_used,\n count() AS transactions,\n round(100 * countIf(status = false) / count(), 2) AS failed_pct\nFROM evm_transactions FINAL\nWHERE network = 'ethereum-mainnet' AND block_number > head - 1000 AND to_address IS NOT NULL\nGROUP BY to_address\nORDER BY total_gas_used DESC\nLIMIT 25",
"clusterId": "evm-mainnet"
}
JSON
Top revert reasonsFailed top-level calls over the last 1000 blocks grouped by error and revert reason, with the most-hit target.Transactions
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head\nSELECT\n error,\n revert_reason,\n count() AS failures,\n evm_address_pretty(topK(1)(to_address)[1]) AS top_target\nFROM evm_traces FINAL\nWHERE network = 'ethereum-mainnet' AND block_number > head - 1000\n AND empty(trace_address)\n AND error != ''\nGROUP BY error, revert_reason\nORDER BY failures DESC\nLIMIT 50",
"clusterId": "evm-mainnet"
}
JSON
Top sendersThe 50 addresses that sent the most transactions over the last 1000 blocks, with gas, fees in native units and failure rate.Transactions
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head,\n (SELECT symbol FROM evm_native_currencies FINAL WHERE network = 'ethereum-mainnet') AS native_symbol,\n (SELECT decimals FROM evm_native_currencies FINAL WHERE network = 'ethereum-mainnet') AS native_decimals\nSELECT\n evm_address_pretty(from_address) AS sender,\n count() AS transactions,\n max(nonce) AS max_nonce,\n sum(gas_used) AS total_gas_used,\n sum(gas_used * effective_gas_price) / exp10(native_decimals) AS fees_native,\n native_symbol,\n round(100 * countIf(status = false) / count(), 2) AS failed_pct\nFROM evm_transactions FINAL\nWHERE network = 'ethereum-mainnet' AND block_number > head - 1000 AND from_address IS NOT NULL\nGROUP BY from_address\nORDER BY transactions DESC\nLIMIT 50",
"clusterId": "evm-mainnet"
}
JSON
Recent ERC-20 transfersDecoded ERC-20 Transfer events from the last 100 blocks, newest first. Amounts are raw (not scaled by token decimals).Tokens & Transfers
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head\nSELECT\n block_number,\n log_index,\n evm_hash_pretty(transaction_hash) AS transaction_hash,\n evm_address_pretty(address) AS token,\n evm_address_pretty(substring(topic1, 13, 20)) AS sender,\n evm_address_pretty(substring(topic2, 13, 20)) AS recipient,\n reinterpretAsUInt256(reverse(data)) AS raw_amount\nFROM evm_logs FINAL\nWHERE network = 'ethereum-mainnet' AND block_number > head - 100\n -- A subquery turns the converted literal into a constant the primary key and bloom indexes can use.\n -- keccak256(\"Transfer(address,address,uint256)\"). ERC-721 indexes a third topic instead of data.\n AND topic0 = (SELECT evm_hash('0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'))\n AND topic3 IS NULL\n AND length(data) = 32\nORDER BY block_number DESC, log_index DESC\nLIMIT 1000",
"clusterId": "evm-mainnet"
}
JSON
Most transferred tokensTokens by ERC-20 Transfer count over the last 1000 blocks, with unique senders and receivers.Tokens & Transfers
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head\nSELECT\n evm_address_pretty(address) AS token,\n count() AS transfers,\n uniqExact(topic1) AS unique_senders,\n uniqExact(topic2) AS unique_receivers\nFROM evm_logs FINAL\nWHERE network = 'ethereum-mainnet' AND block_number > head - 1000\n -- A subquery turns the converted literal into a constant the primary key and bloom indexes can use.\n AND topic0 = (SELECT evm_hash('0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'))\n AND topic3 IS NULL\n AND length(data) = 32\nGROUP BY address\nORDER BY transfers DESC\nLIMIT 50",
"clusterId": "evm-mainnet"
}
JSON
Largest native transfersThe 25 largest native-currency movements over the last 1000 blocks, including internal (trace-level) ones.Tokens & Transfers
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head,\n (SELECT symbol FROM evm_native_currencies FINAL WHERE network = 'ethereum-mainnet') AS native_symbol,\n (SELECT decimals FROM evm_native_currencies FINAL WHERE network = 'ethereum-mainnet') AS native_decimals\nSELECT\n block_number,\n block_datetime,\n evm_hash_pretty(transaction_hash) AS transaction_hash,\n evm_address_pretty(from_address) AS sender,\n evm_address_pretty(to_address) AS recipient,\n amount / exp10(native_decimals) AS amount_native,\n native_symbol,\n is_internal,\n call_type\nFROM evm_native_transfers FINAL\nWHERE network = 'ethereum-mainnet' AND block_number > head - 1000\nORDER BY amount DESC\nLIMIT 25",
"clusterId": "evm-mainnet"
}
JSON
Token transfer historyThe latest 1000 Transfer events of one token (USDC) from the last 7 days. Change the 1e6 divisor to the token's decimals.Tokens & Transfers
Available on
  • Ethereum Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Replace the token address to query another token.\nSELECT\n block_number,\n block_datetime,\n log_index,\n evm_hash_pretty(transaction_hash) AS transaction_hash,\n evm_address_pretty(substring(topic1, 13, 20)) AS sender,\n evm_address_pretty(substring(topic2, 13, 20)) AS recipient,\n reinterpretAsUInt256(reverse(substring(data, 1, 32))) AS raw_amount,\n raw_amount / 1e6 AS amount\nFROM evm_transfer_candidates FINAL\n-- The table is sorted by (network, address), so the primary key reads only this token.\nWHERE network = 'ethereum-mainnet'\n -- A subquery turns the converted literal into a constant the primary key and bloom indexes can use.\n AND address = (SELECT evm_address('0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'))\n -- Bounds the scan for a busy token. Widen it for a quieter one.\n AND block_datetime >= now() - INTERVAL 7 DAY\n -- keccak256(\"Transfer(address,address,uint256)\"). ERC-721 indexes a third topic instead of data.\n AND topic0 = (SELECT evm_hash('0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'))\n AND topic3 IS NULL\n AND length(data) = 32\nORDER BY block_number DESC, log_index DESC\nLIMIT 1000",
"clusterId": "evm-mainnet"
}
JSON
New contract deploymentsContracts deployed in the last 1000 blocks: deployer, whether a factory or an EOA deployed it, and the detected kind.Contracts
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head\nSELECT\n deploy.block_number AS block_number,\n deploy.transaction_index AS transaction_index,\n evm_hash_pretty(deploy.transaction_hash) AS transaction_hash,\n evm_address_pretty(deploy.to_address) AS contract,\n evm_address_pretty(deploy.from_address) AS deployer,\n deploy.call_type AS creation_type,\n if(empty(deploy.trace_address), 'EOA', 'factory') AS deployed_by,\n change.direct_kind AS direct_kind\nFROM\n(\n SELECT block_number, transaction_index, transaction_hash, trace_address, call_type,\n from_address, to_address\n FROM evm_traces FINAL\n WHERE network = 'ethereum-mainnet' AND block_number > head - 1000\n AND call_type IN ('CREATE', 'CREATE2')\n AND error = ''\n ORDER BY block_number DESC, transaction_index DESC\n LIMIT 1000\n) AS deploy\nGLOBAL LEFT JOIN\n(\n SELECT address, direct_kind\n FROM evm_contract_changes FINAL\n WHERE network = 'ethereum-mainnet' AND block_number > head - 1000\n AND change_type IN ('CREATE', 'CREATE2')\n -- The table is sorted by address, so this lets the primary key skip unrelated contracts.\n AND address GLOBAL IN\n (\n SELECT to_address\n FROM evm_traces\n WHERE network = 'ethereum-mainnet' AND block_number > head - 1000\n AND call_type IN ('CREATE', 'CREATE2')\n )\n) AS change ON deploy.to_address = change.address\nORDER BY block_number DESC, transaction_index DESC\nLIMIT 1000",
"clusterId": "evm-mainnet"
}
JSON
Contract change historyEvery recorded change to one contract (the USDC proxy): deployment, proxy upgrades and self-destructs, oldest first.Contracts
Available on
  • Ethereum Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Replace the contract address to query another contract.\nSELECT\n block_number,\n block_datetime,\n change_type,\n evm_hash_pretty(transaction_hash) AS transaction_hash,\n evm_address_pretty(deployer) AS deployer,\n evm_address_pretty(target_address) AS target_address,\n relation_kind,\n direct_kind,\n provenance\nFROM evm_contract_changes FINAL\n-- The table is sorted by (network, address), so the primary key reads only this contract.\nWHERE network = 'ethereum-mainnet'\n -- A subquery turns the converted literal into a constant the primary key and bloom indexes can use.\n AND address = (SELECT evm_address('0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'))\nORDER BY block_number, transaction_index\nLIMIT 1000",
"clusterId": "evm-mainnet"
}
JSON
Proxy upgradesEIP-1967 proxies that switched implementation over the last 10000 blocks, newest first.Contracts
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head\nSELECT\n block_number,\n block_datetime,\n evm_hash_pretty(transaction_hash) AS transaction_hash,\n evm_address_pretty(address) AS proxy,\n evm_address_pretty(substring(topic1, 13, 20)) AS new_implementation\nFROM evm_logs FINAL\nWHERE network = 'ethereum-mainnet' AND block_number > head - 10000\n -- A subquery turns the converted literal into a constant the primary key and bloom indexes can use.\n -- keccak256(\"Upgraded(address)\")\n AND topic0 = (SELECT evm_hash('0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b'))\nORDER BY block_number DESC, log_index DESC\nLIMIT 1000",
"clusterId": "evm-mainnet"
}
JSON
Top DEX poolsThe 50 pools with the most swaps over the last 1000 blocks across Uniswap V2-style, Uniswap V3 and PancakeSwap V3 pools.Trading
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head,\n -- Subqueries turn the converted literals into constants the bloom indexes can use.\n -- keccak256(\"Swap(address,uint256,uint256,uint256,uint256,address)\"): Uniswap V2 and its forks.\n (SELECT evm_hash('0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822')) AS v2_swap,\n -- keccak256(\"Swap(address,address,int256,int256,uint160,uint128,int24)\"): Uniswap V3.\n (SELECT evm_hash('0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67')) AS uniswap_v3_swap,\n -- keccak256(\"Swap(address,address,int256,int256,uint160,uint128,int24,uint128,uint128)\"): PancakeSwap V3.\n (SELECT evm_hash('0x19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc83')) AS pancake_v3_swap\nSELECT\n evm_address_pretty(address) AS pool,\n multiIf(\n topic0 = v2_swap, 'V2',\n topic0 = uniswap_v3_swap, 'Uniswap V3',\n 'PancakeSwap V3'\n ) AS pool_type,\n count() AS swaps,\n -- The indexed sender is usually a router, so this counts routing contracts more than traders.\n uniqExact(topic1) AS unique_senders,\n uniqExact(topic2) AS unique_recipients\nFROM evm_logs FINAL\nWHERE network = 'ethereum-mainnet' AND block_number > head - 1000\n AND topic0 IN (v2_swap, uniswap_v3_swap, pancake_v3_swap)\nGROUP BY address, pool_type\nORDER BY swaps DESC\nLIMIT 50",
"clusterId": "evm-mainnet"
}
JSON
Token approvalsThe 50 spenders granted the most ERC-20 approvals over the last 1000 blocks, with unlimited approvals and revocations.Trading
Available on
  • Ethereum Mainnet
  • BSC Mainnet
  • Robinhood Mainnet
  • Arc Mainnet
  • Arbitrum Mainnet
  • Base Mainnet
  • Elysium Mainnet

Request and response shown for Ethereum Mainnet.

curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "WITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'ethereum-mainnet') AS head\nSELECT\n evm_address_pretty(substring(topic2, 13, 20)) AS spender,\n count() AS approvals,\n countIf(data = unhex(repeat('ff', 32))) AS unlimited_approvals,\n countIf(data = unhex(repeat('00', 32))) AS revocations,\n uniqExact(address) AS distinct_tokens,\n uniqExact(topic1) AS distinct_owners\nFROM evm_logs FINAL\nWHERE network = 'ethereum-mainnet' AND block_number > head - 1000\n -- A subquery turns the converted literal into a constant the primary key and bloom indexes can use.\n -- keccak256(\"Approval(address,address,uint256)\"). ERC-721 indexes a third topic instead of data.\n AND topic0 = (SELECT evm_hash('0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925'))\n AND topic3 IS NULL\n AND length(data) = 32\nGROUP BY topic2\nORDER BY approvals DESC\nLIMIT 50",
"clusterId": "evm-mainnet"
}
JSON
Address activityCalls to and from one address over the last 10000 blocks, including internal ones, with value in native units.Transactions
Available on
  • Robinhood Mainnet
curl -X POST 'https://api.quicknode.com/sql/rest/v1/query' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
--data-binary @- <<'JSON'
{
"query": "-- Replace the address to query another address.\nWITH\n (SELECT max(number) FROM evm_blocks WHERE network = 'robinhood-mainnet') AS head,\n (SELECT symbol FROM evm_native_currencies FINAL WHERE network = 'robinhood-mainnet') AS native_symbol,\n (SELECT decimals FROM evm_native_currencies FINAL WHERE network = 'robinhood-mainnet') AS native_decimals,\n -- The ArbSys precompile. Put the address to inspect here. The subquery turns it into a\n -- constant the address bloom indexes can use.\n (SELECT evm_address('0x0000000000000000000000000000000000000064')) AS target\nSELECT\n block_number,\n transaction_index,\n trace_address,\n evm_hash_pretty(transaction_hash) AS transaction_hash,\n direction,\n call_type,\n evm_address_pretty(counterparty) AS counterparty,\n value / exp10(native_decimals) AS value_native,\n native_symbol,\n error\nFROM\n(\n -- One branch per direction, so each filter can use its own address bloom index.\n SELECT block_number, transaction_index, trace_address, transaction_hash,\n 'out' AS direction, call_type, to_address AS counterparty, value, error\n FROM evm_traces FINAL\n WHERE network = 'robinhood-mainnet' AND block_number > head - 10000 AND from_address = target\n UNION ALL\n SELECT block_number, transaction_index, trace_address, transaction_hash,\n 'in' AS direction, call_type, from_address AS counterparty, value, error\n FROM evm_traces FINAL\n WHERE network = 'robinhood-mainnet' AND block_number > head - 10000 AND to_address = target\n)\nORDER BY block_number DESC, transaction_index DESC, trace_address DESC\nLIMIT 1000",
"clusterId": "evm-mainnet"
}
JSON