Query editor
-- Query: USDC transfer volume and DEX volume snapshots by relevant chain-- Shows first-of-month snapshots plus the latest day.-- Unsupported Dune chain/table combinations return NULL, not zero.WITHsnapshot_dates AS (SELECT d AS dateFROM UNNEST(SEQUENCE(DATE '2024-01-01',CAST(DATE_TRUNC('month', CURRENT_DATE) AS DATE),INTERVAL '1' MONTH)) AS t(d)UNIONSELECT CURRENT_DATE AS date),chains AS (SELECT * FROM (VALUES(1, 'Ethereum', 'ethereum', true, true),(2, 'Solana', 'solana', true, true),(3, 'Hyperliquid L1', 'hyperliquid', false, false),(4, 'Base', 'base', true, true),(5, 'Arbitrum', 'arbitrum', true, true),(6, 'Polygon', 'polygon', true, true),(7, 'BSC', 'bnb', true, true),(8, 'Avalanche', 'avalanche_c', true, true),(9, 'Sui', 'sui', false, false),(10, 'Stellar', 'stellar', false, false),(11, 'Monad', 'monad', false, false),(12, 'OP Mainnet', 'optimism', true, true),(13, 'Fantom', 'fantom', true, true),(14, 'Starknet', 'starknet', false, false),(15, 'Cronos', 'cronos', false, false),(16, 'Sonic', 'sonic', true, true),(17, 'Aptos', 'aptos', false, false)) AS t(sort_order, chain, dune_chain, transfer_supported, dex_supported)),evm_tokens AS (SELECT * FROM (VALUES('ethereum', 'Ethereum', 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48),('base', 'Base', 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913),('arbitrum', 'Arbitrum', 0xaf88d065e77c8cC2239327C5EDb3A432268e5831),('polygon', 'Polygon', 0x3c499c542cef5e3811e1192ce70d8cc03d5c3359),('bnb', 'BSC', 0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d),('avalanche_c', 'Avalanche', 0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E),('optimism', 'OP Mainnet', 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85),('fantom', 'Fantom', 0x04068DA6C83AFCFA0e13ba15A6696662335D5B75),('sonic', 'Sonic', 0x29219dd400f2Bf60E5a23d13Be72B486d4038894)) AS t(blockchain, chain, contract_address)),transfer_volume AS (SELECT date, chain, SUM(transfer_volume) AS transfer_volumeFROM (SELECT