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 tornado_cash."eth_call_withdraw" w 8 LEFT JOIN ethereum.traces trs ON trs.trace_address = w.call_trace_address AND trs.tx_hash = w.call_tx_hash 9 ) 10SELECT 11 date_trunc('week', block_time) as time, 12 COUNT(DISTINCT CASE WHEN depositor IS NOT NULL THEN depositor ELSE withdrawer END) as users, 13 COUNT(DISTINCT depositor) as deposits, 14 COUNT(DISTINCT withdrawer) as withdrawals 15FROM ( 16 SELECT block_time, "from" as user, "from" as depositor, null as withdrawer FROM deposits UNION ALL 17 SELECT block_time, "to" as user, null as depositor, _recipient as withdrawer FROM withdrawals 18) t 19GROUP BY 1 20ORDER BY 1 DESC 21