Query editor
WITHLatestUpdates AS (SELECTselector,newImpl,evt_block_number,ROW_NUMBER() OVER (PARTITION BY selector ORDER BY evt_block_number DESC) as rnFROMzeroex_ethereum.ExchangeProxy_evt_ProxyFunctionUpdated),AggregatedData AS (SELECTselector,COUNT(*) AS update_count,MIN(evt_block_number) AS first_updated,MAX(evt_block_number) AS last_updated,ARRAY_AGG(DISTINCT newImpl) AS all_newImpls,(SELECT newImpl FROM LatestUpdates WHERE selector = p.selector AND rn = 1) AS latest_newImplFROMzeroex_ethereum.ExchangeProxy_evt_ProxyFunctionUpdated pGROUP BYselector),CallCounts AS (SELECTcontract_name,function_name,signature,COUNT(*) AS tx_count,MIN(tx_hash) AS tx_hashFROMethereum.traces_decodedWHEREnamespace = 'zeroex'AND cardinality(trace_address) = 0GROUP BYcontract_name,function_name,signatureHAVINGcontract_name = 'ExchangeProxy'ORDER BYtx_count DESC)SELECTselector,latest_newImpl,function_name,first_updated,tx_hash,update_count,last_updated,tx_count,all_newImplsFROMAggregatedData aJOIN CallCounts c ON a.selector = c.signatureORDER BYtx_count DESC