princefarzamOp price
    Updated 2022-12-22
    With
    OP_price AS (
    SELECT
    date_trunc('day', HOUR)::date AS day,
    avg(PRICE) AS OP_price
    FROM
    optimism.core.fact_hourly_token_prices
    WHERE
    SYMBOL = 'OP'
    AND day >= '2022-11-01'
    group by
    day
    ORDER BY
    day ASC
    ),
    WBTC_price AS (
    SELECT
    date_trunc('day', HOUR)::date AS day,
    avg(PRICE) AS WBTC_price
    FROM
    optimism.core.fact_hourly_token_prices
    WHERE
    SYMBOL = 'WBTC'
    AND day >= '2022-11-01'
    group by
    day
    ORDER BY
    day ASC
    )
    SELECT
    FROM OP_price O left join WBTC_price B ON O.day=B.day