Query editor
WITHethereum_wallets AS (SELECT'ethereum' as blockchain,case typewhen 'create' then 'CONTRACT'else 'NON-CONTRACT'end as type,count(nonzero_accounts.address) as countofFROM(SELECT DISTINCT address FROM tokens_ethereum.balances WHERE balance > 0) nonzero_accounts LEFT JOIN(SELECT address, type FROM ethereum.traces WHERE type = 'create') contracts on nonzero_accounts.address = contracts.addressGROUP BY type)--,--base_wallets AS (--SELECT-- 'base' as blockchain,-- case type-- when 'create' then 'CONTRACT'-- else 'NON-CONTRACT'-- end as type,-- count(nonzero_accounts.address) as countof--FROM--(SELECT DISTINCT address FROM tokens_base.balances WHERE balance > 0) nonzero_accounts LEFT JOIN--(SELECT address, type FROM base.traces WHERE type = 'create') contracts on nonzero_accounts.address = contracts.address--GROUP BY type--),--polygon_wallets AS (--SELECT-- 'polygon' as blockchain,-- case type-- when 'create' then 'CONTRACT'-- else 'NON-CONTRACT'-- end as type,-- count(nonzero_accounts.address) as countof--FROM--(SELECT DISTINCT address FROM tokens_polygon.balances WHERE balance > 0) nonzero_accounts LEFT JOIN--(SELECT address, type FROM polygon.traces WHERE type = 'create') contracts on nonzero_accounts.address = contracts.address--GROUP BY type--),--arbitrum_wallets AS (--SELECT-- 'arbitrum' as blockchain,-- case type-- when 'create' then 'CONTRACT'-- else 'NON-CONTRACT'-- end as type,-- count(nonzero_accounts.address) as countof--FROM--(SELECT DISTINCT address FROM tokens_arbitrum.balances WHERE balance > 0) nonzero_accounts LEFT JOIN--(SELECT address, type FROM arbitrum.traces WHERE type = 'create') contracts on nonzero_accounts.address = contracts.address--GROUP BY type--),--optimism_wallets AS (--SELECT-- 'optimism' as blockchain,-- case type-- when 'create' then 'CONTRACT'-- else 'NON-CONTRACT'-- end as type,