Query editor
WITH creditAccounts as (select distinctaccount as addressfrom gearbox_ethereum.AccountFactory_evt_NewCreditAccount),CA_transfers as (-- Tokens FROM Credit Accountsselect-value as amount,contract_address as token,evt_block_time,evt_tx_hash,c.address,NULL as poolidFROM erc20_ethereum.evt_Transfer t, creditAccounts cwhere t."from" = c.addressand evt_block_time > date( '2023-12-01' )UNION ALLselectvalue as amount,contract_address as token,evt_block_time,evt_tx_hash,address,NULL as poolidFROM erc20_ethereum.evt_Transfer t, creditAccounts cwhere t."to" = c.addressand evt_block_time > date( '2023-12-01' )UNION ALLselectamount,NULL,evt_block_time,evt_tx_hash,address,poolidfrom convex_ethereum.Booster_evt_Deposited t, creditAccounts cwheret.user = c.addressand evt_block_time > date( '2023-12-01' )UNION ALLselect-amount,NULL,evt_block_time,evt_tx_hash,address,poolidfrom convex_ethereum.Booster_evt_Withdrawn t, creditAccounts cwheret.user = c.addressand evt_block_time > date( '2023-12-01' )),days as (select distinctDATE_TRUNC('day',time) as dayfrom evms.blockswhere blockchain = 'ethereum'and time > date( '2023-12-20')