Query editor
with CEX as (with days AS (select day from unnest(sequence(cast('2020-08-01' as timestamp(3)), cast(current_timestamp as timestamp(3)), interval '1' day)) as days(day)),CEX as (select 0xe93381fb4c4f14bda253907b18fad305d799241a as holderunion allselect 0x6cc5f688a315f3dc28a7781717a9a798a59fda7b as holderunion allselect 0x2faf487a4414fe77e2327f0bf4ae2a264a776ad2 as holderunion allselect 0x1c4b70a3968436b9a0a9cf5205c787eb81bb558c as holderunion allselect 0x0211f3cedbef3143223d3acf0e589747933e8527 as holderunion allselect 0xf977814e90da44bfa03b6295a0616a897441acec as holderunion allselect 0x21a31ee1afc51d94c2efccaa2092ad1028285549 as holderunion allselect 0xb9ee1e551f538a464e8f8c41e9904498505b49b0 as holderunion allselect 0x28c6c06298d514db089934071355e5743bf21d60 as holderunion allselect 0x0d0707963952f2fba59dd06f2b425ace40b492fe as holderunion allselect 0xa910f92acdaf488fa6ef02174fb86208ad7722ba as holderunion allselect 0x75e89d5979e4f6fba9f97c104c2f0afb3f1dcb88 as holderunion allselect 0xdfd5293d8e347dfe59e90efd55b2956a1343963d as holderunion allselect 0x562680a4dc50ed2f14d75bf31f494cfe0b8d10a1 as holderunion allselect 0x5a52e96bacdabb82fd05763e25335261b270efcb as holder)select day, holderfrom daysfull join CEX on 1=1),deposits as (selectDATE_TRUNC('day', evt_block_time) as day,"to" as holder,sum(amount)/1e18 as depositfrom powerpool_ethereum.CVP_evt_TransferWHERE "to" in (select holder from CEX)and "from" not in (select holder from CEX)group by 1,2),withdrawals as (selectDATE_TRUNC('day', evt_block_time) as day,"from" as holder,0-sum(amount)/1e18 as withdrawalfrom powerpool_ethereum.CVP_evt_TransferWHERE "from" in (select holder from CEX)