ArioBase-Distribution of DEXs' Users based on # of Swaps. copy
    Updated 2024-04-09
    -- forked from Base-Distribution of DEXs' Users based on # of Swaps. @ https://flipsidecrypto.xyz/edit/queries/9c4a77c6-9c32-493c-84ec-f5a287ee8e9b

    with tab1 as (
    select
    ORIGIN_FROM_ADDRESS,
    count(distinct tx_hash) as "# of Swaps"
    from base.defi.ez_dex_swaps
    where platform = '{{DEX}}'
    group by 1
    )
    select
    case when "# of Swaps" < 2 then 'A: 1 Swap'
    when "# of Swaps" >=2 and "# of Swaps" < 5 then 'B: 2-5 Swaps'
    when "# of Swaps" >=5 and "# of Swaps" < 10 then 'C: 5-10 Swaps'
    when "# of Swaps" >=10 and "# of Swaps" < 20 then 'D: 10-20 Swaps'
    when "# of Swaps" >=20 and "# of Swaps" < 50 then 'E: 20-50 Swaps'
    when "# of Swaps" >=50 and "# of Swaps" < 100 then 'F: 50-100 Swaps'
    else 'G: >= 100'
    end as status,
    count(distinct ORIGIN_FROM_ADDRESS) as "# of Users"
    from tab1
    group by 1


    QueryRunArchived: QueryRun has been archived