Moeavprc0
    Updated 2023-02-18
    with prices as (
    select
    date_trunc('day',RECORDED_HOUR) as date,
    avg(close) as "AVAX price"
    from
    crosschain.core.fact_hourly_prices
    where id like 'wrapped-avax'
    and date >= CURRENT_DATE - 60
    group by 1
    order by 1
    )

    select
    "AVAX price" price,
    BLOCK_TIMESTAMP::date date ,
    sum (AMOUNT_IN) as swap_volume ,
    sum (AMOUNT_IN * price ) as swap_volume_usd ,
    count ( distinct SENDER) as swappers ,
    count ( distinct tx_hash) as swaps
    from
    avalanche.sushi.ez_swaps s
    inner join prices on date = BLOCK_TIMESTAMP::date
    where SYMBOL_IN ilike '%avax%'
    group by 1,2
    Run a query to Download Data