kiichisushi lending
Updated 2022-06-26
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
›
⌄
with pa1 as (
SELECT
date_trunc(day,block_timestamp) as date,
sum (amount_usd) as deposit_volume
from ethereum.sushi.ez_lending
where date between '2022-01-1' and '2022-06-20'
and action='Deposit'
group by date
),
pa2 as (
SELECT
date_trunc(day,block_timestamp) as date,
sum (amount_usd) as withdraw_volume
from ethereum.sushi.ez_lending
where date between '2022-01-1' and '2022-06-20'
and action='Withdraw'
group by date
)
SELECT
a.deposit_volume,
a.date,
b.withdraw_volume
from pa1 a
LEFT JOIN pa2 b
on a.date=b.date