drone-mostafacross total
    Updated 2023-05-16
    with base as (SELECT
    TRADER,
    CASE
    when PLATFORM LIKE '%uniswap%' then 'Uniswap-v2&3'
    when PLATFORM LIKE '%quickswap%' then 'quickswap-v2&3'
    when PLATFORM LIKE '%kyberswap%' then 'kyberswap-v1&2'
    when PLATFORM LIKE '%trader-joe%' then 'trader-joe-v1&2'
    else PLATFORM end as PLATFORM, min (BLOCK_TIMESTAMP) as BLOCK_TIMESTAMP
    FROM crosschain.core.ez_dex_swaps
    WHERE PLATFORM in ('uniswap-v3','sushiswap','uniswap-v2','quickswap-v2','quickswap-v3','velodrome','kyberswap-v2','kyberswap-v1','trader-joe-v1','trader-joe-v2')
    GROUP by 1,2)

    SELECT
    --date_trunc ('month',BLOCK_TIMESTAMP) as date,
    PLATFORM,
    count (DISTINCT TRADER) as New_Users
    --sum (New_Users) over (order by date) as Cumulative
    FROM base WHERE BLOCK_TIMESTAMP >= current_date -365
    GROUP BY 1


    Run a query to Download Data