select
case
when b.event_name ilike '%withdraw%' then 'Withdraw'
when b.event_name ilike '%transfer%' then 'Transfer'
when b.event_name ilike '%swap%' then 'Swap'
when b.event_name ilike '%approval%' then 'Approval'
when b.event_name ilike '%deposit%' then 'Deposit'
when b.event_name ilike '%sync%' then 'Sync'
when b.event_name ilike '%mint%' then 'Mint'
when b.event_name ilike '%burn%' then 'Burn'
when b.event_name ilike 'stake%' then 'Stake'
when b.event_name ilike 'unstake%' then 'UnStake'
when b.event_name ilike 'claim%' then 'Claim'
else null
end "Event",
count (distinct b.tx_hash) "TX Count"
from ethereum.uniswapv3.ez_swaps a
join ethereum.core.fact_event_logs b
on b.block_timestamp = (
select min(block_timestamp) from ethereum.core.fact_event_logs c
where 1 = 1
and c.origin_from_address = a.recipient
and c.block_timestamp > a.block_timestamp
)
where 1 = 1
and a.block_timestamp >= current_date - interval '2 weeks'
group by 1
having "Event" is not null
order by 2 desc