ashpeezeyGetting Started
Updated 2023-04-11Copy Reference Fork
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
›
⌄
select
t5.dt,
t5.pair,
t5.buy_total as buy_total,
t5.sell_total as sell_total,
t5.cvd_sol as net_sol,
t5.buy_notional_total as buy_notional_total,
t5.sell_notional_total as sell_notional_total,
t5.cvd_notional as net_notional,
sum(t5.buy_total) over (order by t5.dt asc) as buy_cumulative,
sum(t5.sell_total) over (order by t5.dt asc) as sell_cumulative,
sum(t5.cvd_sol) over (order by t5.dt asc) as cvd_sol,
sum(t5.buy_notional_total) over (order by t5.dt asc) as buy_notional_cumulative,
sum(t5.sell_notional_total) over (order by t5.dt asc) as sell_notional_cumulative,
sum(t5.cvd_notional) over (order by t5.dt asc) as cvd_notional
from (
select
t2.dt,
t2.pair,
t2.buy_total,
t4.sell_total,
t2.buy_total + t4.sell_total as cvd_sol,
t2.buy_notional_total,
t4.sell_notional_total,
t2.buy_notional_total + t4.sell_notional_total as cvd_notional
from (
select
date_trunc('day', t1.block_timestamp) as dt,
t1.type,
t1.pair,
sum(t1.quantity) as buy_total,
sum(t1.notional) as buy_notional_total,
count(*) as buy_txs
from (
select
block_timestamp,
Run a query to Download Data