Query editor
WITH-- 1. This CTE remains the same, defining ERC-5313.ercs AS (SELECT *FROM (VALUES(25,'ERC5313','Contract Management','Simple Owner',0x8da5cb5b,'traces', null)) as v(erc_order,erc_id, erc_type, erc_summary, filter_id, filter_source, special_instructions)),-- 2. The standard_check CTE is modified for a one-year interval.standard_check AS (SELECTdistincttr.to as contract_address,'ethereum' as blockchain, -- Manually set blockchainercs.erc_order,ercs.erc_id,ercs.erc_summaryFROM ethereum.traces tr -- Scoped to ethereum.tracesJOIN ercs ON ercs.filter_id = bytearray_substring(input,1,4) AND ercs.filter_source = 'traces'WHERE call_type != 'delegatecall'AND successAND tr.block_time > now() - interval '1' year -- Changed to one year),-- 3. The aggregation logic is also modified for a one-year interval.agg_base AS (SELECTsc.blockchain,sc.erc_id,count(distinct sc.contract_address) as contracts_deployedFROM standard_check scJOIN ethereum.creation_traces tr ON tr.address = sc.contract_address -- Scoped to ethereum.creation_tracesWHERE tr.block_time > now() - interval '1' year -- Changed to one yearGROUP BY 1, 2)-- 4. The final select remains the same.SELECTblockchain,erc_id,contracts_deployedFROM agg_base;