SocioAnalyticavolume of trade over time copy
Updated 2024-07-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
›
⌄
with data as (
select
'perp' as type,
*
from blast.blitz.ez_perp_trades
-- union all
-- select
-- 'spot' as type,
-- *
-- from
)
select
date_trunc('d', block_timestamp) as date,
sum(amount_usd) as volume,
sum(volume) over (order by date) as cum_volume,
count(DISTINCT tx_hash) as n_txns,
sum(n_txns) over ( order by date) as cum_txns,
count(DISTINCT trader) as n_users ,
avg(volume) over (order by date) as daily_avg_volume,
avg(volume) over (order by date ROWS between 6 preceding and current row) as ma_7
from data
where is_taker = 'TRUE'
group by 1
order by 1 desc
QueryRunArchived: QueryRun has been archived