Query editor
-- TOKEN-ONLY variant of the event-based Tornado margin panel.-- Restricts the universe to the 15 ERC-20 pools (DAI, cDAI, USDC, USDT, WBTC),-- excluding the 4 ETH pools, so that the Tornado margins measure the same-- activity universe as the Umbra token-only benchmark (Umbra's ETH withdrawals-- emit no contract event and are unobservable; see dune_umbra_margin_token.sql).-- Output: tornado_margin_token.csv-- Deposits and withdrawals are classified by the pool contracts' own events,-- NOT by transaction value:-- Deposit(bytes32,uint32,uint256) topic0 = 0xa945e51eec50ab98c161376f0db4cf2aeba3ec92755fe2fcd388bdbbb80ff196-- Withdrawal(address,bytes32,address,uint256) topic0 = 0xe9e508bad6d4c3227e881ca19068f099da81b5164dd6d62b2eaf1e8bc6c34931-- This correctly captures ERC-20 pool deposits (msg.value = 0) and withdrawals-- routed through the proxy/router (the event is emitted by the pool itself),-- and it excludes router/proxy/governance/auxiliary calls from the margins.-- Universe: the 19 classic fixed-denomination pools only (addresses 1-19 in the-- appendix table). Unique actors are transaction senders, matching the Umbra-- margin definition in dune_privacy_donor_queries.sql.-- Output columns: day, deposit_count, unique_depositors, withdrawal_count, unique_withdrawersWITH pools(address) AS (SELECT address FROM (VALUES(0xD4B88Df4D29F5CedD6857912842cff3b20C8Cfa3), -- DAI 100(0xFD8610d20aA15b7B2E3Be39B396a1bC3516c7144), -- DAI 1,000(0x07687e702b410Fa43f4cB4Af7FA097918ffD2730), -- DAI 10,000(0x23773E65ed146A459791799d01336DB287f25334), -- DAI 100,000(0x22aaA7720ddd5388A3c0A3333430953C68f1849b), -- cDAI 5K(0x03893a7c7463AE47D46bc7f091665f1893656003), -- cDAI 50K(0x2717c5e28cf931547B621a5dddb772Ab6A35B701), -- cDAI 500K(0xD21be7248e0197Ee08E0c20D4a96DEBdaC3D20Af), -- cDAI 5M(0xd96f2B1c14Db8458374d9Aca76E26c3D18364307), -- USDC 100(0x4736dCf1b7A3d580672CcE6E7c65cd5cc9cFBa9D), -- USDC 1,000(0x169AD27A470D064DEDE56a2D3ff727986b15D52B), -- USDT 100(0x0836222F2B2B24A3F36f98668Ed8F0B38D1a872f), -- USDT 1,000(0x178169B423a011fff22B9e3F3abeA13414dDD0F1), -- WBTC 0.1(0x610B717796ad172B316836AC95a2ffad065CeaB4), -- WBTC 1(0xbB93e510BbCD0B7beb5A853875f9eC60275CF498) -- WBTC 10) AS t(address)),spine AS (SELECT d AS dayFROM unnest(sequence(date '2022-01-01', date '2026-04-14', interval '1' day)) AS t(d)),dep AS (SELECT cast(l.block_time AS date) AS day,count(*) AS deposit_count,count(distinct tx."from") AS unique_depositorsFROM ethereum.logs lJOIN ethereum.transactions tx ON tx.hash = l.tx_hashJOIN pools p ON l.contract_address = p.addressWHERE l.topic0 = 0xa945e51eec50ab98c161376f0db4cf2aeba3ec92755fe2fcd388bdbbb80ff196AND l.block_time >= timestamp '2022-01-01'AND l.block_time < timestamp '2026-04-15'GROUP BY 1),wd AS (SELECT cast(l.block_time AS date) AS day,count(*) AS withdrawal_count,count(distinct tx."from") AS unique_withdrawersFROM ethereum.logs lJOIN ethereum.transactions tx ON tx.hash = l.tx_hashJOIN pools p ON l.contract_address = p.addressWHERE l.topic0 = 0xe9e508bad6d4c3227e881ca19068f099da81b5164dd6d62b2eaf1e8bc6c34931