SocioAnalyticabase price(Blitz)
Updated 2024-04-18
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- 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