SalehAllstake_total
    Updated 2024-12-15
    with lst_price_raw as (
    select top 1
    date_trunc(hour,HOUR) as price_date
    ,avg(CLOSE) as avg_price
    from near.price.fact_prices_ohlc_hourly
    where ASSET_ID='wrapped-near'
    and price_date is not null
    and hour::date >= '2024-06-16'
    group by 1
    order by price_date desc
    )
    ,lst_stNEAR_price as (
    select top 1
    date_trunc(hour,HOUR) as stNEAR_price_date
    ,avg(CLOSE) as stNEAR_price
    from near.price.fact_prices_ohlc_hourly
    where ASSET_ID='staked-near'
    and stNEAR_price_date is not null
    and hour::date >= '2024-06-16'
    group by 1
    order by stNEAR_price_date desc
    )
    ,lst_LiNEAR_price as (
    select top 1
    date_trunc(hour,HOUR) as LiNEAR_price_date
    ,avg(CLOSE) as LiNEAR_price
    from near.price.fact_prices_ohlc_hourly
    where ASSET_ID='linear-protocol'
    and LiNEAR_price_date is not null
    and hour::date >= '2024-06-16'
    group by 1
    order by LiNEAR_price_date desc
    )
    ,lst_Aurora_price as (
    select top 1
    date_trunc(hour,HOUR) as Aurora_price_date
    QueryRunArchived: QueryRun has been archived