mucrypto2023-12-11 10:05 PM
    Updated 2023-12-11
    with wbtc as (
    select
    date_trunc('month', hour) as month,
    avg(price) as avg_wbtc_price_per_month,
    row_number() over (order by month desc) as rn
    from ethereum.price.ez_hourly_token_prices
    where symbol in ('WBTC')
    group by 1),

    wbtc_mom as (
    select
    c1.month,
    c1.avg_wbtc_price_per_month,
    (c1.avg_wbtc_price_per_month - c2.avg_wbtc_price_per_month) / c2.avg_wbtc_price_per_month * 100 as "WBTC Month-on-Month Change in Average Price"
    from wbtc as c1
    left join wbtc as c2
    on c1.rn = c2.rn - 1
    where c1.month >= '2015-01-01'),

    weth as (
    select
    date_trunc('month', hour) as month,
    avg(price) as avg_weth_price_per_month,
    row_number() over (order by month desc) as rn
    from ethereum.price.ez_hourly_token_prices
    where symbol in ('WETH')
    group by 1),

    weth_mom as (
    select
    c1.month,
    c1.avg_weth_price_per_month,
    (c1.avg_weth_price_per_month - c2.avg_weth_price_per_month) / c2.avg_weth_price_per_month * 100 as "WETH Month-on-Month Change in Average Price"
    from weth as c1
    left join weth as c2
    on c1.rn = c2.rn - 1
    Run a query to Download Data