Updated 2022-10-16
    with tb1 as (select
    distinct ORIGIN_FROM_ADDRESS as users,
    case
    when PROJECT_NAME ilike '%sushiswap%' then 'Sushiswap'
    when PROJECT_NAME ilike '%uniswap%' then 'Uniswap'
    end as DEX,
    count(distinct tx_hash) as no_swaps
    from Arbitrum.core.fact_event_logs s left join Arbitrum.core.dim_labels b on s.CONTRACT_ADDRESS=b.address
    group by 1,2 having DEX is not null)


    select
    DEX,
    case
    when no_swaps=1 then '1 time user'
    when no_swaps>1 and no_swaps<=5 then '1-5 times use'
    when no_swaps>5 and no_swaps<=20 then '5-20 times use'
    when no_swaps>20 then 'Over 20 times use'
    end as gp,
    count(distinct users) as no_users
    from tb1
    group by 1,2
    Run a query to Download Data