Query editor
WITH dates AS (WITH day_seq AS (SELECT (sequence(cast('2023-01-27' AS DATE),cast(now() AS DATE),interval '1' day)) day)SELECT days.dayFROM day_seqCROSS JOIN unnest(day) AS days(day)),all_reserves AS (SELECT DISTINCT reserveFROM aave_v3_ethereum.Pool_evt_SupplyUNIONSELECT DISTINCT reserveFROM aave_v3_ethereum.Pool_evt_WithdrawUNIONSELECT DISTINCT reserveFROM aave_v3_ethereum.Pool_evt_BorrowUNIONSELECT DISTINCT reserveFROM aave_v3_ethereum.Pool_evt_Repay),selected_reserves AS (SELECT * FROM (VALUES(0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0, 'wstETH'),(0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee, 'weETH'),(0xae78736Cd615f374D3085123A210448E74Fc6393, 'rETH'),(0xBe9895146f7AF43049ca1c1AE358B0541Ea49704, 'cbETH'),(0xA35b1B31Ce002FBF2058D22F30f95D405200A15b, 'ETHx'),(0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38, 'osETH'),(0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf, 'cbBTC'),(0x18084fbA666a33d37592fA2633fD49a74DD93a88, 'tBTC')) AS t(reserve, reserve_name)),deposit_evt AS (SELECTdate_trunc('day', evt_block_time) AS time,reserve,sum(amount)/1e18 AS amountFROM aave_v3_ethereum.Pool_evt_SupplyGROUP BY 1, 2),withdraw_evt AS (SELECTdate_trunc('day', evt_block_time) AS time,reserve,sum(amount)/1e18 AS amountFROM aave_v3_ethereum.Pool_evt_WithdrawGROUP BY 1, 2),