Query editor
WITH MonthlyCounts AS (SELECTDATE_TRUNC('month', day) AS month, -- Groups data by month'Ethereum' AS chain,COUNT(DISTINCT address) AS number_of_wallets -- Counts unique addresses with a balance greater than zeroFROM tokens_ethereum.balances_dailyWHEREtoken_address = 0x6b0b3a982b4634ac68dd83a4dbf02311ce324181 -- Ethereum ALI addressAND token_standard = 'erc20'AND balance > 0GROUP BY DATE_TRUNC('month', day)UNION ALLSELECTDATE_TRUNC('month', day) AS month,'Polygon' AS chain,COUNT(DISTINCT address) AS number_of_walletsFROM tokens_polygon.balances_dailyWHEREtoken_address = 0xbfc70507384047aa74c29cdc8c5cb88d0f7213ac -- Polygon AddressAND token_standard = 'erc20'AND balance > 0GROUP BY DATE_TRUNC('month', day)UNION ALLSELECTDATE_TRUNC('month', day) AS month,'Base' AS chain,COUNT(DISTINCT address) AS number_of_walletsFROM tokens_base.balances_dailyWHEREtoken_address = 0x97c806e7665d3afd84a8fe1837921403d59f3dcc -- Base AddressAND token_standard = 'erc20'AND balance > 0GROUP BY DATE_TRUNC('month', day))SELECTmonth,SUM(number_of_wallets) AS number_of_wallets -- Aggregates total number of wallets across all chainsFROM MonthlyCountsGROUP BY monthORDER BY month DESC;