CryptoIcicleUniswap - 1. Active AMM Users
    Updated 2022-03-18
    -- Show the number of active users (wallets) on Uniswap and Sushiswap over the past year.
    -- Describe how they compare using at least two metrics (such as unique users per month,
    -- transactions per user per month, or anyhting you find interesting).
    -- Give insights on the differences or changes between the two platforms.
    -- Choose either Polygon, Ethereum, or both for your analysis.

    -- with uni_users as (
    -- s
    -- )


    select
    date_trunc('month',block_timestamp) as date,
    platform,
    count(tx_id) as transction_frequency,
    count(distinct(from_address)) as no_of_unique_user,
    sum(IFF(amount_usd > pow(10,9), amount_usd/pow(10,18), amount_usd)) as swap_volume,
    sum(swap_volume) over (partition by platform order by date asc rows between unbounded preceding and current row) as cum_swap_volume,
    sum(transction_frequency) over (partition by platform order by date asc rows between unbounded preceding and current row) as cum_transction_frequency
    from ethereum.dex_swaps
    where block_timestamp >= CURRENT_DATE - 365
    and platform in ('uniswap-v2', 'uniswap-v3','sushiswap')
    group by date, platform
    Run a query to Download Data