Query editor
WITH deposits AS (SELECT evt_tx_hash, evt_block_time, date_trunc('day', evt_block_time) AS day, amount / pow(10, 6) AS deposits, 0 AS withdrawnFROM aave_v3_arbitrum.L2Pool_evt_SupplyWHERE reserve = 0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8),withdrawals AS (SELECT evt_tx_hash, evt_block_time, date_trunc('day', evt_block_time) AS day, 0 AS deposits, amount / pow(10, 6) * -1 AS withdrawnFROM aave_v3_arbitrum.L2Pool_evt_WithdrawWHERE reserve = 0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8)SELECT day, sum(deposits) AS deposited, sum(withdrawn) AS withdrawn, SUM(deposits) + sum(withdrawn) AS deltaFROM (SELECT * FROM depositsUNION ALLSELECT * FROM withdrawals)WHERE day >= date('2024-01-01')GROUP BY 1