Query editor
-- Query: USDe transfer volume and DEX volume snapshots by relevant chain-- Built from the DAI transfer/DEX query pattern.-- Shows first-of-month snapshots plus the latest day.-- Output columns for token_data.py: date, chain, token, transfer_volume_usd, dex_volume_usd.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, 'Arbitrum', 'arbitrum', true, true),(4, 'OP Mainnet','optimism', true, true),(5, 'Base', 'base', true, true),(6, 'Mantle', 'mantle', true, true),(7, 'Blast', 'blast', true, true),(8, 'BNB', 'bnb', true, true),(9, 'Linea', 'linea', true, true),(10, 'Manta', 'manta', true, true),(11, 'Scroll', 'scroll', true, true),(12, 'Fraxtal', 'fraxtal', true, true),(13, 'Mode', 'mode', true, true),(14, 'XLayer', 'xlayer', true, true),(15, 'Metis', 'metis', true, true),(16, 'Kava', 'kava', true, true),(17, 'Morph', 'morph', true, true),(18, 'Swell', 'swellchain', true, true),(19, 'Berachain', 'berachain', true, true),(20, 'ZKSync', 'zksync', true, true),(21, 'Zircuit', 'zircuit', true, true)) AS t(sort_order, chain, dune_chain, transfer_supported, dex_supported)),evm_tokens AS (SELECT * FROM (VALUES('ethereum', 'Ethereum', 0x4c9edd5852cd905f086c759e8383e09bff1e68b3),('arbitrum', 'Arbitrum', 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34),('optimism', 'OP Mainnet',0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34),('base', 'Base', 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34),('mantle', 'Mantle', 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34),('blast', 'Blast', 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34),('bnb', 'BNB', 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34),('linea', 'Linea', 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34),('manta', 'Manta', 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34),('scroll', 'Scroll', 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34),('fraxtal', 'Fraxtal', 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34),