adam10ETH Volatility
    Updated 2021-08-02
    with new_eth_prices as (
    SELECT
    date_trunc('hour', hour) as date
    FROM ethereum.token_prices_hourly
    where symbol = 'ETH' AND date >= CURRENT_DATE - 14
    group by date),

    eth_prices as (
    SELECT
    date_trunc('hour', hour) as date,
    avg(price) as eth_hourly_price
    FROM ethereum.token_prices_hourly
    where symbol = 'ETH' AND date >= CURRENT_DATE - 14
    group by date
    ),

    actual_eth_prices as (
    SELECT
    date_trunc('hour', hour) as date
    FROM ethereum.token_prices_hourly
    where symbol = 'ETH' AND date >= CURRENT_DATE - 14
    group by date)

    SELECT
    u.date,
    l.eth_hourly_price
    from new_eth_prices u
    inner join eth_prices l
    on u.date = l.date
    inner join actual_eth_prices a
    on u.date = a.date
    Run a query to Download Data