jackguysushi_l2_1
    with tab1 as (
    SELECT
    date_trunc('day', hour) as day1,
    symbol as s1,
    avg(price) as price1
    FROM ethereum.core.fact_hourly_token_prices
    GROUP BY 1,2
    ), tab2 as (
    SELECT
    date_trunc('day', hour) as day2,
    symbol as s2,
    avg(price) as price2
    FROM ethereum.core.fact_hourly_token_prices
    GROUP BY 1,2
    )

    SELECT
    date_trunc('day', block_timestamp) as day,
    count(DISTINCT tx_hash) as transaction,
    count(DISTINCT ORIGIN_FROM_ADDRESS) as active_users,
    sum(CASE when not amount_in_usd is NULL then AMOUNT_IN_USD
    when not amount_out_usd is NULL then AMOUNT_OUT_USD
    else 0 end) as swap_volume_USD

    FROM polygon.sushi.ez_swaps
    GROUP BY 1
    HAVING day > '2022-01-01'
    --LIMIT 500
    Run a query to Download Data