Query editor
with token_in as (selectto as address,sum(case when contract_address = 0x539bde0d7dbd336b79148aa742883198bbf60342 then value/1e18 else 0 end) as magic_in,sum(case when contract_address = 0x6daf586b7370b14163171544fca24abcc0862ac5 then value/1e18 else 0 end) as bpet_in,sum(case when contract_address = 0x872bad41cfc8ba731f811fea8b2d0b9fd6369585 then value/1e18 else 0 end) as gfly_in,sum(case when contract_address = 0x11Bf4f05EB28b802ED3aB672594DEcB20ffe2313 then value/1e9 else 0 end) as aury_in,sum(case when contract_address = 0x912ce59144191c1204e64559fe8253a0e49e6548 then value/1e18 else 0 end) as arb_in,sum(case when contract_address = 0x4cb9a7ae498cedcbb5eae9f25736ae7d428c9d66 then value/1e18 else 0 end) as xai_infrom erc20_arbitrum.evt_transferwhere contract_address in (0x539bde0d7dbd336b79148aa742883198bbf60342,0x6daf586b7370b14163171544fca24abcc0862ac5,0x872bad41cfc8ba731f811fea8b2d0b9fd6369585,0x11Bf4f05EB28b802ED3aB672594DEcB20ffe2313,0x912ce59144191c1204e64559fe8253a0e49e6548,0x4cb9a7ae498cedcbb5eae9f25736ae7d428c9d66)group by 1),token_out as (select"from" as address,sum(case when contract_address = 0x539bde0d7dbd336b79148aa742883198bbf60342 then value/1e18 else 0 end) as magic_out,sum(case when contract_address = 0x6daf586b7370b14163171544fca24abcc0862ac5 then value/1e18 else 0 end) as bpet_out,sum(case when contract_address = 0x872bad41cfc8ba731f811fea8b2d0b9fd6369585 then value/1e18 else 0 end) as gfly_out,sum(case when contract_address = 0x11Bf4f05EB28b802ED3aB672594DEcB20ffe2313 then value/1e9 else 0 end) as aury_out,sum(case when contract_address = 0x912ce59144191c1204e64559fe8253a0e49e6548 then value/1e18 else 0 end) as arb_out,sum(case when contract_address = 0x4cb9a7ae498cedcbb5eae9f25736ae7d428c9d66 then value/1e18 else 0 end) as xai_outfrom erc20_arbitrum.evt_transferwhere contract_address in (0x539bde0d7dbd336b79148aa742883198bbf60342,0x6daf586b7370b14163171544fca24abcc0862ac5,0x872bad41cfc8ba731f811fea8b2d0b9fd6369585,0x11Bf4f05EB28b802ED3aB672594DEcB20ffe2313,0x912ce59144191c1204e64559fe8253a0e49e6548,0x4cb9a7ae498cedcbb5eae9f25736ae7d428c9d66)group by 1),summary as (selecti.address,coalesce(magic_in,0) - coalesce(magic_out,0) as magic,coalesce(bpet_in,0) - coalesce(bpet_out,0) as bpet,coalesce(gfly_in,0) - coalesce(gfly_out,0) as gfly,coalesce(aury_in,0) - coalesce(aury_out,0) as aury,coalesce(arb_in,0) - coalesce(arb_out,0) as arb,coalesce(xai_in,0) - coalesce(xai_out,0) as xaifrom token_in iFULL OUTER JOIN token_out o ON i.address = o.addressWHERE (COALESCE(magic_in, 0) - COALESCE(magic_out, 0) +COALESCE(bpet_in, 0) - COALESCE(bpet_out, 0) +COALESCE(gfly_in, 0) - COALESCE(gfly_out, 0) +COALESCE(aury_in, 0) - COALESCE(aury_out, 0) +COALESCE(arb_in, 0) - COALESCE(arb_out, 0) +COALESCE(xai_in, 0) - COALESCE(xai_out, 0)) > 1)