Query editor
with cfg as (selectdate '2024-02-01' as start_date,0x38913051e01d4f6910cb66bb9ac3cb77d746ad81 as migrator,0xb528edbef013aff855ac3c50b381f253af13b997 as token,0xa59785389b00cbd19745afbe8d59b28e3161395c6b1e3525861a2b0dede0b90d as topic0_claim),transfers as (selecterc20.evt_block_time as block_time,erc20.evt_tx_hash as tx_hash,erc20.evt_index as ord,erc20."from" as from_addr,erc20.to as to_addr,cast(erc20.value as double) / 1e18 as amtfrom erc20_ethereum.evt_transfer erc20join cfg on erc20.contract_address = cfg.tokenand (erc20."from" = cfg.migrator or erc20.to = cfg.migrator)where cast(erc20.evt_block_time as date) >= (select start_date from cfg)),claim_tx as (select distinct logs.tx_hashfrom ethereum.logs logsjoin cfg on logs.contract_address = cfg.migratorwhere cast(logs.block_time as date) >= (select start_date from cfg)and logs.topic0 = (select topic0_claim from cfg)),excluded_tx as (select distinct logs.tx_hashfrom ethereum.logs logsjoin cfg on logs.contract_address = cfg.migratorwhere cast(logs.block_time as date) >= (select start_date from cfg)and logs.topic0 in ((select topic0_claim from cfg),0xcce627e2c2d449f785b95ad057ce521f52992c4a79973e2a6f580c9d4855fa45,0x5464cfcfbfe4df8b5921df805eda7849bc1fc09d9dc0f621c43074680de3aa09)),total_in as (select coalesce(sum(amt), 0) as total_in_amtfrom transferswhere to_addr = (select migrator from cfg)and tx_hash not in (select tx_hash from excluded_tx)),total_out as (select coalesce(sum(amt), 0) as total_out_amtfrom transferswhere from_addr = (select migrator from cfg)and tx_hash not in (select tx_hash from excluded_tx)),pool as (select(select total_in_amt from total_in) as total_in_amt,(select total_out_amt from total_out) as total_out_amt,(select total_in_amt from total_in) - (select total_out_amt from total_out) as effective_pool_amt),hourly as (selectdate_trunc('hour', block_time) as hour,sum(amt) as hourly_aevo