NuveveCryptoArchivedVelodrome Deposits vs. Withdraws
Updated 2022-11-07Copy 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
›
⌄
with deposits as (
select
date_trunc('month', block_timestamp) as month,
sum(token0_amount_usd + token1_amount_usd) as total_usd
from optimism.velodrome.ez_lp_actions
where lp_action = 'deposit'
group by month
),
withdraws as (
select
date_trunc('month', block_timestamp) as month,
sum(token0_amount_usd + token1_amount_usd) as total_usd
from optimism.velodrome.ez_lp_actions
where lp_action = 'withdraw'
group by month
),
cum_d as (
select
month,
sum(total_usd) over(order by month) as total_usd
from deposits
),
cum_w as (
select
month,
sum(total_usd) over(order by month) as total_usd
from withdraws
)
select
cum_d.month as month,
cum_d.total_usd as deposits,
cum_w.total_usd as withdraws
Run a query to Download Data