--credit : alik110
select case when contract_address ='0x47029bc8f5cbe3b464004e87ef9c9419a48018cd' then 'Volatile OP/USDC'
when contract_address ='0x85149247691df622eaf1a8bd0cafd40bc45154a9' then 'USDC/WETH'
when contract_address ='0x79c912fef520be002c2b6e57ec4324e260f38e50' then 'Volatile WETH/USDC'
when contract_address ='0xe8537b6ff1039cb9ed0b71713f697ddbadbb717d' then 'Volatile VELO/USDC'
when contract_address ='0xcdd41009e74bd1ae4f7b2eecf892e4bc718b9302' then 'Volatile WETH/OP'
else contract_address end as pool,
count (distinct tx_hash) as TX_Count,
count (distinct origin_from_address)
from optimism.core.fact_event_logs t1 --join optimism.core.dim_labels t2 on contract_address = address
where event_name = 'Swap'
and block_timestamp >= '2022-07-01'
and tx_status = 'SUCCESS'
group by 1
order by 2 desc
limit 5