Query editor
WITH proxy_events AS (SELECT tx_hash, index, contract_address, bytearray_substring(data,1,32) AS versionFROM ethereum.logs WHERE topic0=0xaaaa7ee6b0c2f4ee1fa7312c7d5b3623a434da5a1a9ce3cb6e629caa23454ab6), factory_events AS (SELECT DISTINCT tx_hash, bytearray_substring(topic1,13,20) AS proxy, topic3 AS versionFROM ethereum.logs WHERE topic0=0xfbb4f36b70dba8ecedc8b38361f44f1b0c61e04ec4e0ccf620649dc558573f5f)SELECT count(*) AS proxy_events, count_if(f.tx_hash IS NOT NULL) AS factory_matched,count_if(f.tx_hash IS NULL) AS unmatchedFROM proxy_events p LEFT JOIN factory_events f ON p.tx_hash=f.tx_hash AND p.contract_address=f.proxy AND p.version=f.version