Query editor
WITH usdc_flows AS (SELECTDATE_TRUNC('day', evt_block_time) AS flow_hour,evt_tx_hash,'Deposit' AS flow_type,amount / 1e6 AS amount_normalized,amount / 1e6 AS net_flowFROMastherus_ethereum.astherusvault_eth_evt_depositWHEREcontract_address = 0x604DD02d620633Ae427888d41bfd15e38483736EAND currency = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48AND evt_block_time >= CURRENT_TIMESTAMP - INTERVAL '100' dayUNION ALLSELECTDATE_TRUNC('hour', evt_block_time) AS flow_hour,evt_tx_hash,'Withdraw' AS flow_type,amount / 1e6 AS amount_normalized,-(amount / 1e6) AS net_flowFROMastherus_ethereum.astherusvault_eth_evt_withdrawWHEREcontract_address = 0x604DD02d620633Ae427888d41bfd15e38483736EAND currency = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48AND evt_block_time >= CURRENT_TIMESTAMP - INTERVAL '100' day)SELECTflow_hour,SUM(net_flow) AS net_usdc_cash_flow_hourly,SUM(CASE WHEN flow_type = 'Deposit' THEN amount_normalized ELSE 0 END) AS total_usdc_deposits_hourly,SUM(CASE WHEN flow_type = 'Withdraw' THEN amount_normalized ELSE 0 END) AS total_usdc_withdrawals_hourly,COUNT(evt_tx_hash) AS total_transactions_hourlyFROMusdc_flowsGROUP BY1ORDER BYflow_hour DESC