Query editor
with transfers as (select"from" as wallet,-sum(cast(value as double) / pow(10, 18)) as amountfrom apecoin_ethereum.APE_evt_Transferwhere evt_block_time < timestamp '2023-08-16 08:00 UTC'group by 1unionselect"to" as wallet,sum(cast(value as double) / pow(10, 18)) as amountfrom apecoin_ethereum.APE_evt_Transferwhere evt_block_time < timestamp '2023-08-16 08:00 UTC'group by 1),transfer_sum as (select "wallet",sum(amount) as balancefrom transfersgroup by "wallet")selectwallet as "APEHolder",balance as "APEAmount"from transfer_sumwhere balance > 0