Query editor
selectaddress,symbol,balance,total_valuefrom query_4520754where address = 'EVM Media'order by total_value desc-- with-- eth_balances as (-- WITH eth_in as (-- SELECT-- tr.to as address-- , SUM(cast(tr.value as double)/1e18) as eth_funded-- FROM evms.traces tr-- WHERE tr.success=true-- AND tr.type='call'-- AND (tr.call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR tr.call_type IS null)-- -- AND tr.to IN (0x29816f59f1c7e1ba69289cf486556929f7743ca2,0x5e85cf8751f2f4f74468eef68688ff9c4b43f9cf,0x33b71b1addd6dbdb45c1848a6d3c6259c735ccdc,0x60e83a5c5c72320763af528244bfd69ad05295e2)-- AND tr.to IN (0x5e85cf8751f2f4f74468eef68688ff9c4b43f9cf)-- AND block_time > cast('2022-04-01' as timestamp)-- and blockchain = 'ethereum'-- GROUP BY 1-- ),-- eth_out as (-- SELECT-- tr."from" as address-- , SUM(cast(tr.value as double)/1e18) as eth_spent-- FROM evms.traces tr-- WHERE tr.success=true-- AND tr.type='call'-- AND (tr.call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR tr.call_type IS null)-- -- AND tr."from" IN (0x29816f59f1c7e1ba69289cf486556929f7743ca2,0x5e85cf8751f2f4f74468eef68688ff9c4b43f9cf,0x33b71b1addd6dbdb45c1848a6d3c6259c735ccdc,0x60e83a5c5c72320763af528244bfd69ad05295e2)-- AND tr."from" IN (0x5e85cf8751f2f4f74468eef68688ff9c4b43f9cf)-- AND block_time > cast('2022-04-01' as timestamp)-- and blockchain = 'ethereum'-- GROUP BY 1-- )-- , fees_spent as (-- SELECT-- CAST(tx_from AS VARBINARY) as address-- , SUM(tx_fee) as eth_fees-- FROM gas_ethereum.fees-- WHERE-- -- tx_sender IN (0x29816f59f1c7e1ba69289cf486556929f7743ca2,0x5e85cf8751f2f4f74468eef68688ff9c4b43f9cf,0x33b71b1addd6dbdb45c1848a6d3c6259c735ccdc,0x60e83a5c5c72320763af528244bfd69ad05295e2)-- tx_from IN (0x5e85cf8751f2f4f74468eef68688ff9c4b43f9cf)-- AND blockchain = 'ethereum'-- AND block_date > cast('2022-04-01' as timestamp)-- GROUP BY 1-- )-- SELECT-- eth_in.address-- , 'ETH' as symbol-- , eth_funded - COALESCE(eth_spent, 0) - COALESCE(eth_fees, 0) as balance-- FROM eth_in-- LEFT JOIN eth_out ON eth_in.address = eth_out.address