select
case
when platform = 'uniswap-v2' or platform = 'uniswap-v3' then 'uniswap'
when platform = 'pancakeswap-v2' or platform = 'pancakeswap-v3' then 'pancakeswap'
when platform = 'kyberswap-v1' or platform = 'kyberswap-v2' then 'kyberswap'
when platform = 'dodo-v1' or platform = 'dodo-v2' then 'dodo'
else platform
end as dex,
count(distinct origin_from_address) as users,
count(distinct tx_hash) as transactions
from ethereum.defi.ez_dex_swaps
where
block_timestamp::date >='2023-01-01'
and block_timestamp::date < '2024-01-01'
group by 1
order by 2 desc, 3 desc