adriaparcerisasAptos Dex 3.4
    Updated 2024-12-13
    with
    news as (
    select distinct swapper, min(trunc(block_timestamp,'day')) as debut
    FROM
    aptos.defi.ez_dex_swaps
    where AMOUNT_IN_USD<1e6 and amount_in_usd is not null
    GROUP BY
    1
    )
    SELECT
    debut as day, case when trunc(debut,'year') ilike '%2024%' then 2024 when trunc(debut,'year') ilike '%2023%' then 2023 else 2022 end as year, count(distinct swapper) as new_swapper, sum(new_swapper) over (partition by year order by day) as total_swappers
    FROM
    news
    GROUP BY
    year, day
    ORDER BY
    day DESC, year





    QueryRunArchived: QueryRun has been archived