DigitalDanSushi Price vs Market
    Updated 2022-02-01
    with sushi as (
    select date_trunc('day', hour) as sdays, avg(price) as sushi_price
    from ethereum.token_prices_hourly
    where token_address = lower('0x6b3595068778dd592e39a122f4f5a5cf09c90fe2') -- sushiswap
    and sdays > current_date - interval '1 year'
    group by 1
    -- order by sdays desc
    ),

    weth as (
    select date_trunc('day', hour) as wdays, avg(price) as weth_price
    from ethereum.token_prices_hourly
    where token_address = lower('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2') -- weth
    and wdays > current_date - interval '1 year'
    group by 1
    -- order by wdays desc
    ),

    wbtc as (
    select date_trunc('day', hour) as bdays, avg(price) as wbtc_price
    from ethereum.token_prices_hourly
    where token_address = lower('0x2260fac5e5542a773aa44fbcfedf7c193bc2c599') -- wbtc
    and bdays > current_date - interval '1 year'
    group by 1
    -- order by bdays desc
    ),

    defi as (
    select date_trunc('day', hour) as beddays, avg(price) as defi_pulse_price
    from ethereum.token_prices_hourly
    where token_address = lower('0x1494ca1f11d487c2bbe4543e90080aeba4ba3c2b') -- defi pulse
    and beddays > current_date - interval '1 year'
    group by 1
    --order by beddays desc
    )
    Run a query to Download Data