Query editor
-- Ethereum QueryWITH holder_counts AS (-- Ethereum QuerySELECT'ethereum' AS network,contract_address,COUNT(DISTINCT topic2) AS holder_count -- topic2 contains recipient address for ERC-20 transfersFROM ethereum.logsWHERE contract_address IN (0x7b66E84Be78772a3afAF5ba8c1993a1B5D05F9C2,0x6034e0d6999741f07cb6Fb1162cBAA46a1D33d36,0x3c426812F39337679265Ea407f744cdaC672d9d3)AND topic0 = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef -- ERC-20 Transfer event signatureGROUP BY contract_addressUNION ALL-- Base QuerySELECT'base' AS network,contract_address,COUNT(DISTINCT topic2) AS holder_count -- topic2 contains recipient address for ERC-20 transfersFROM base.logsWHERE contract_address IN (0xe18c07D858fB1bbF8c06fD78c13b86AfD3d04e28,0x418D5E096225729001Bb54e62EF7aD6873550146,0x57414656AC535680367f519eeC9f0D7Ffe99e2D0,0x93757336dE76f24f7eEE15e6150e4ec42fbDaA21,0xfbaD5BE3A505889df2Aa189580E3bD36118Bf4D8,0xA7aCd41B1cA7cbD85C7359CAaaa8b0Ca2C74688E)AND topic0 = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef -- ERC-20 Transfer event signatureGROUP BY contract_address)-- Final Query to include total holder countSELECT *, SUM(holder_count) OVER () AS total_holdersFROM holder_countsORDER BY network, holder_count DESC;