SocioAnalyticabase price
    Updated 2024-04-18
    -- select DISTINCT order_type
    -- from arbitrum.vertex.ez_perp_trades
    -- with base as (
    -- select
    -- date_trunc('hour', block_timestamp) as date,
    -- median(price_amount) as base_price
    -- from arbitrum.vertex.ez_perp_trades
    -- where is_taker = TRUE
    -- and symbol = 'BTC-PERP'
    -- and block_timestamp::date >= dateadd(day, -7, current_date)
    -- group by 1
    -- )
    -- ,
    -- price as (
    -- select
    -- date_trunc('hour', block_timestamp) as date,
    -- median(price_amount) as price
    -- from arbitrum.vertex.ez_perp_trades
    -- where is_taker != TRUE
    -- and symbol = 'BTC-PERP'
    -- and block_timestamp::date >= dateadd(day, -7, current_date)
    -- group by 1
    -- )

    -- select
    -- a.date,
    -- round(100 * ((base_price - price)) / base_price,2) as delta_price_prcn
    -- from base a
    -- left join price b on a.date = b.date



    with price_base as (
    SELECT date_trunc('hour',block_timestamp) as hour,
    median(PRICE_AMOUNT) as price_base
    FROM blast.blitz.ez_perp_trades
    QueryRunArchived: QueryRun has been archived