SocioAnalyticabase price(Blitz)
    Updated 2024-04-18
    -- forked from base price @ https://flipsidecrypto.xyz/edit/queries/22924c54-984a-4f4d-bfb6-5aed84327e6e

    -- 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
    QueryRunArchived: QueryRun has been archived