select
CONTRACT_ADDRESS ,
ADDRESS_NAME,
count(distinct tx_hash) swap_count
-- TX_JSON:receipt:logs[1]:address to_asset
from optimism.core.fact_event_logs t,optimism.core.dim_labels l
where
EVENT_NAME ilike '%swap%'
and t.CONTRACT_ADDRESS = l.address
GROUP BY 1,2 order by 3 desc