Updated 2023-08-30
    with lst_price as (
    select
    hour::date as day
    ,avg(price) as avg_price
    from ethereum.core.fact_hourly_token_prices
    where hour::date>='2023-08-01'
    and symbol ='frxETH'
    group by 1
    order by 1 desc
    limit 30
    )
    select
    date_trunc(day,block_timestamp)::date as date
    ,count(DISTINCT tx_hash) as tx_count
    ,count(DISTINCT sender) as swaper
    ,avg(amount_in_usd) as avg_swap_usd
    ,avg(avg_swap_usd) over (ORDER BY date rows BETWEEN 7 PRECEDING AND CURRENT ROW) as avg_7_Days_volume
    from ethereum.core.ez_dex_swaps
    join ethereum.core.dim_labels on address = CONTRACT_ADDRESS
    where block_timestamp::date>='2023-08-01'
    and label in('curve')
    and amount_in_usd>0
    group by 1





    Run a query to Download Data