pouya_22ETH Derivatives - Compare hours
    Updated 2022-09-13
    with eth_price as (select
    hour as eth_date,
    avg(price) as eth_usd
    from ethereum.core.fact_hourly_token_prices
    where token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' -- WETH
    and hour > current_date - 7
    group by 1),

    aeth_price as (select
    hour as aeth_date,
    avg(price) as aeth_usd
    from ethereum.core.fact_hourly_token_prices
    where token_address = '0x3a3a65aab0dd2a17e3f1947ba16138cd37d08c04' -- aETH
    and hour > current_date - 7
    group by 1),

    reth_price as (select
    hour as reth_date,
    avg(price) as reth_usd
    from ethereum.core.fact_hourly_token_prices
    where token_address = '0x9559aaa82d9649c7a7b220e7c461d2e74c9a3593' -- rETH
    and hour > current_date - 7
    group by 1),

    steth_price as (select
    hour as steth_date,
    avg(price) as steth_usd
    from ethereum.core.fact_hourly_token_prices
    where token_address = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' -- stETH
    and hour > current_date - 7
    group by 1)

    select
    'aETH' as token,
    eth_date as date,
    (aeth_usd - eth_usd) as diff_with_eth
    Run a query to Download Data