mattkstewAvalanche Uniswap Users 1
    Updated 2023-07-30
    with tab1 as (
    SELECT
    origin_from_address,
    count(distinct tx_hash) as swaps,
    sum(case when amount_in_usd is null then amount_out_usd else amount_in_usd end) as Swap_Volume_USD
    FROM avalanche.core.ez_dex_swaps
    WHERE platform = 'uniswap-v3'
    AND (AMOUNT_IN_USD between AMOUNT_OUT_USD - 5000 and AMOUNT_OUT_USD + 5000) -- I got this from Masi's Dashboard (https://flipsidecrypto.xyz/Masi/uniswap-s-role-in-avalanche-s-defi-growth-m6D9n6) who Credited it to "Abbas from old Dashboards"
    GROUP BY 1
    order by 3 desc
    )

    select
    case
    when Swap_Volume_USD between 0 and 100 then 'a 0-100 USD'
    when Swap_Volume_USD between 100 and 1000 then 'b 100-1k USD'
    when Swap_Volume_USD between 1000 and 10000 then 'c 1k-10k USD'
    when Swap_Volume_USD between 10000 and 100000 then 'd 10k-100k USD'
    else 'e > 100k USD' end as Swap_Volume_Distribution,
    count(*) as Total_users

    from tab1
    group by 1
    Run a query to Download Data