Query editor
WITH approved_contracts (contract_address, name, category) AS (SELECT * FROM query_5145294 WHERE category = 'Retail Wallets'),auth_history AS (SELECTauthority_address,delegated_address,block_number,date_parse(block_time, '%Y-%m-%d %H:%i:%s.%f UTC') AS block_time_ts,tx_hash,block_index,auth_index,LEAD(block_number) OVER (PARTITION BY authority_addressORDER BY block_number ASC,block_index ASC,auth_index ASC) AS next_block_numberFROM dune.wintermute_research.dataset_pectra_authorizationsWHERE validity = TRUE),authorized_wallets AS (SELECTah.authority_address,ah.delegated_address,ah.block_number AS start_block,ah.next_block_number AS end_block,ah.block_time_ts AS delegation_time,ah.tx_hash AS delegation_txFROM auth_history AS ahWHERE ah.delegated_address <> 0x0000000000000000000000000000000000000000),daily_by_delegated AS (SELECTdate(t.block_time) AS day,aw.delegated_address AS delegated_address,COUNT(*) AS auth_tx_countFROM ethereum.transactions AS tJOIN authorized_wallets AS awON t."from" = aw.authority_addressAND t."to" = aw.authority_addressAND t.block_number > aw.start_blockAND ( aw.end_block IS NULL OR t.block_number < aw.end_block )JOIN approved_contracts AS acON aw.delegated_address = from_hex(ac.contract_address)WHEREt.block_number >= 22431086AND t.success = TRUEGROUP BY1, 2),avg AS (SELECTdate(t.block_time) AS day,COUNT(*) AS auth_tx_countFROM ethereum.transactions AS t