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 = 0xaf88d065e77c8cc2239327c5edb3a432268e5831),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 = 0xaf88d065e77c8cc2239327c5edb3a432268e5831)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