Query editor
-- TOKEN-ONLY Umbra margin panel (matched benchmark for tornado_margin_token.csv).-- Umbra contract: 0xFb2dc580Eed955B528407b4d36FfaFe3da685401-- Announcement(address,uint256,address,bytes32,bytes32)-- topic0 = 0x29877766fa2bfe3b90008d6d92f965eca91cbc5757ed775740e460799fb92219-- receiver and token are indexed: token address = last 20 bytes of topic2.-- ETH sends carry the sentinel token 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE-- and are excluded here, so deposits are token deposits only.-- TokenWithdrawal(address,address,uint256,address)-- topic0 = 0x30eb3583ad09933b693a45452ab07512244cdbc5868701aa004c27b7b267c249-- (token withdrawals only by construction; Umbra ETH withdrawals emit no event.)-- Output: umbra_margin_token.csv (day, deposit_count, unique_depositors,-- withdraw_count, unique_withdrawers)WITH 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_hashWHERE l.contract_address = 0xfb2dc580eed955b528407b4d36ffafe3da685401AND l.topic0 = 0x29877766fa2bfe3b90008d6d92f965eca91cbc5757ed775740e460799fb92219AND lower(to_hex(l.topic2)) NOT LIKE '%eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'AND 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 withdraw_count,count(distinct tx."from") AS unique_withdrawersFROM ethereum.logs lJOIN ethereum.transactions tx ON tx.hash = l.tx_hashWHERE l.contract_address = 0xfb2dc580eed955b528407b4d36ffafe3da685401AND l.topic0 = 0x30eb3583ad09933b693a45452ab07512244cdbc5868701aa004c27b7b267c249AND l.block_time >= timestamp '2022-01-01'AND l.block_time < timestamp '2026-04-15'GROUP BY 1)SELECT s.day,coalesce(d.deposit_count, 0) AS deposit_count,coalesce(d.unique_depositors, 0) AS unique_depositors,coalesce(w.withdraw_count, 0) AS withdraw_count,coalesce(w.unique_withdrawers, 0) AS unique_withdrawersFROM spine sLEFT JOIN dep d ON d.day = s.dayLEFT JOIN wd w ON w.day = s.dayORDER BY 1