Query editor
with usdc_transfers as ( --USDC transfers on selected blockchainsselectevt_block_time,casewhen blockchain = 'arbitrum' and contract_address = 0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8 then 'arbitrum (bridged)'when blockchain = 'arbitrum' and contract_address = 0xaf88d065e77c8cC2239327C5EDb3A432268e5831 then 'arbitrum (native)'else blockchainend as blockchain,"from","to",evt_tx_hash,valuefrom evms.erc20_transferswhere(blockchain = 'avalanche_c' and contract_address = 0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E)or (blockchain = 'polygon' and contract_address = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174)or (blockchain = 'optimism' and contract_address = 0x7F5c764cBc14f9669B88837ca1490cCa17c31607)or (blockchain = 'arbitrum' and contract_address in (0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8, --bridged0xaf88d065e77c8cC2239327C5EDb3A432268e5831) --native)),mint as (selectdate_trunc('day', evt_block_time) as date,blockchain,sum(value/1e6) as mint_dailyfrom usdc_transferswhere "from" = 0x0000000000000000000000000000000000000000group by 1, 2),burn as (selectdate_trunc('day', evt_block_time) as date,blockchain,sum(value/1e6) as burn_dailyfrom usdc_transferswhere "to" = 0x0000000000000000000000000000000000000000group by 1, 2),full_timeseries as (--reference table with all 5 USDC contracts for all dates--needed to get cumulative total supply for all dates, even when no mint or burn tx on a specific dateselectdistinct date_trunc('day', tr.evt_block_time) as date,b.blockchainfrom usdc_transfers trcross join (select distinct blockchainfrom usdc_transfers) b),all as (selectft.date,ft.blockchain,