Updated 2024-01-15

    with tab1 as (
    select date_trunc('minute',BLOCK_TIMESTAMP)as time
    ,AMOUNT_IN_USD
    ,ORIGIN_FROM_ADDRESS
    from arbitrum.defi.ez_dex_swaps
    where PLATFORM='uniswap-v3'
    and BLOCK_TIMESTAMP>='2023-10-01'
    and AMOUNT_IN_USD is not null
    and SYMBOL_IN='ARB'
    ),
    tab2 as (
    select date_trunc('day',time)as day
    ,AMOUNT_IN_USD
    ,ORIGIN_FROM_ADDRESS
    ,row_number()over(partition by ORIGIN_FROM_ADDRESS order by day) as time_row
    from tab1
    )
    select day
    ,count(ORIGIN_FROM_ADDRESS) as new_sellers
    ,sum(AMOUNT_IN_USD) as sell_volume
    ,sum(new_sellers)over(order by day) as total_new_sellers
    ,sum(sell_volume)over(order by day) as total_volume
    from tab2
    where time_row=1
    group by 1