Ariotime series trader joe
    Updated 2023-10-13

    select
    *,
    sum(Volume) over(partition by POOL_NAME order by Month) as Total
    from (
    select
    Date_trunc(month, block_timestamp)::date as Month,
    POOL_NAME,
    sum(AMOUNT_IN * price) as Volume
    --sum(Volume) over(partition by POOL_NAME order by Month) as Total_Vol
    from avalanche.defi.ez_dex_swaps a join avalanche.price.ez_hourly_token_prices b
    on a.TOKEN_IN = b.TOKEN_ADDRESS and date_trunc(hour, BLOCK_TIMESTAMP) = date_trunc(hour, HOUR)
    where POOL_NAME is not NULL
    and AMOUNT_IN > 0
    and PLATFORM in ('trader-joe-v1', 'trader-joe-v2')
    group by 1,2
    having sum(AMOUNT_IN * price) between 1 and 5e7

    order by 1 asc
    )
    --qualify Total > 10e4

    Run a query to Download Data