Afonso_Diaz2023-04-21 03:36 PM
    Updated 2023-04-21
    with
    t as (
    select
    recorded_hour::date as date,
    symbol,
    avg(price) as price_usd
    from osmosis.core.ez_prices
    where symbol = 'OSMO'
    and date >= '2021-06-01'
    group by 1, 2

    union all

    select
    recorded_hour::date as date,
    'FLOW' as symbol,
    avg((open + close) / 2) as price_usd
    from flow.core.fact_hourly_prices
    where token = 'Flow'
    and date >= '2021-06-01'
    group by 1, 2

    union all

    select
    timestamp::date as date,
    'NEAR' as symbol,
    avg(price_usd) as price_usd
    from near.core.fact_prices
    where symbol = 'wNEAR'
    and date >= '2021-06-01'
    group by 1, 2

    union all

    select recorded_hour::date as date,
    Run a query to Download Data