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.
1WITH 2 deposits as ( 3 SELECT * FROM ethereum.traces trs 4 WHERE "to" IN (SELECT DISTINCT contract_address from tornado_cash."eth_call_deposit") AND value > 0 AND tx_success 5 ), 6 withdrawals as ( 7 SELECT * FROM ethereum.traces trs 8 WHERE "from" IN (SELECT DISTINCT contract_address from tornado_cash."eth_call_deposit") AND value > 0 AND tx_success AND "to" <> '\x83584f83f26af4edda9cbe8c730bc87c364b28fe' 9 ), 10 taxes as ( 11 SELECT * FROM tornado_cash."eth_call_withdraw" wth 12 INNER JOIN ethereum.traces trs ON trs.trace_address = wth.call_trace_address AND trs.tx_hash = wth.call_tx_hash 13 ) 14SELECT 15 date_trunc('week', block_time) as time, 16 SUM(d_value * p.price)/1e18 as deposits, 17 SUM(w_value * p.price)/1e18 as withdrawals, 18 SUM(fee * p.price)/1e18 as taxed 19FROM ( 20 SELECT block_time, value as d_value, 0 as w_value, 0 as fee FROM deposits UNION ALL 21 SELECT block_time, 0 as d_value, value as w_value, 0 as fee FROM withdrawals UNION ALL 22 SELECT block_time, 0 as d_value, 0 as w_value, _fee as fee FROM taxes 23) t 24LEFT JOIN prices.layer1_usd_eth p ON p.minute = date_trunc('minute', block_time) 25GROUP BY 1...