MLDZMNder_3
    Updated 2022-09-13
    with tb1 as (select
    date_trunc('week',HOUR) as weeks,
    avg(PRICE) as rETH_USD
    from ethereum.core.fact_hourly_token_prices
    where SYMBOL='rETH'
    and HOUR>=CURRENT_DATE-365
    group by 1
    ),

    tb2 as (select
    date_trunc('week',hour) as weeks,
    avg(price) as ETH_USD
    from ethereum.core.fact_hourly_token_prices
    where weeks>=CURRENT_DATE-365
    and SYMBOL='WETH'
    group by 1)

    select tb1.weeks as week,
    rETH_USD,
    ETH_USD,
    ETH_USD/rETH_USD,
    ETH_USD-rETH_USD
    from tb1 join tb2 on tb1.weeks=tb2.weeks
    Run a query to Download Data