Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/SELECTdate_trunc('week', tr.block_time) as week, COALESCE(c.name, cast(tr."from" as varchar)) as integration_type, approx_distinct(tr.tx_hash) as times_calledFROM optimism.traces trLEFT JOIN labels.contracts c ON c.blockchain = 'optimism' AND c.address = tr."from"LEFT JOIN optimism.signatures sig_fx ON bytearray_substring(tr.input, 1,5) = sig_fx.idWHERE tr.to = 0x484c2d6e3cdd945a8b2df735e079178c1036578cAND cardinality(trace_address) != 0 --must be a contract calling not a walletAND successAND tr.block_time >= now() - interval '{{months ago}}' monthAND lower(c.name) NOT LIKE '%gnosis%' AND lower(c.name) NOT LIKE '%argent%' --filter safes out, they're not protocols.AND ('{{modify_only}}' = 'false' OR (json_value(sig_fx.abi,'strict $.stateMutability') NOT IN ('pure', 'view') OR sig_fx.abi is null))GROUP BY 1,2