Skip to content
Dune Analytics

@poma / Eth gas spent by tx type

Eth gas spent by tx type

Loading
 

About queries and results

Dune Analytics lets you explore, create, and share Ethereum analytics. You can find an endless amount of great queries and dashboards on Dune.

We have decoded Ethereum smart contract data so you can do powerful analysis with simple SQL queries and visualise the query results into beautiful graphs.

Dune Analytics is free for everyone forever. If you want extra features like private queries, export your results and more check out our Pro plan.

SQL query

1SELECT
2    date_trunc('month', block_time) as time,
3    SUM(CASE WHEN data IS NULL THEN gas_used/1000 ELSE 0 END) as eth_transfers,
4    SUM(CASE WHEN substring(data from 1 for 4) = '\xa9059cbb' THEN gas_used/1000 ELSE 0 END) as token_transfers,
5    SUM(CASE WHEN data IS NOT NULL AND "to" IS NULL THEN gas_used/1000 ELSE 0 END) as deploy_operations,
6    SUM(CASE WHEN NOT(data IS NULL) AND NOT(substring(data from 1 for 4) = '\xa9059cbb') AND NOT(data IS NULL AND "to" IS NULL) THEN gas_used/1000 ELSE 0 END) as other_operations
7FROM ethereum."transactions"
8GROUP BY 1
9ORDER BY 1 DESC;

SQL query results

Loading