sepehrmhz82023-06-10 06:09 PM
Updated 2024-06-08
999
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
date_trunc(month, block_timestamp) as date,
'Borrow' as
type,
count(DISTINCT (tx_hash)) as Txs,
count(DISTINCT (borrower)) as Users,
sum(loan_amount_usd) as Volume,
avg(loan_amount_usd) as avg_volume,
median(loan_amount_usd) as median_volume,
max(loan_amount_usd) as max_volume,
min(loan_amount_usd) as min_volume,
sum(Txs) over (
partition by
type
order by
date
) as cum_tx,
sum(Users) over (
partition by
type
order by
date
) as cum_user,
sum(Volume) over (
partition by
type
order by
date
) as cum_volume
from
ethereum.compound.ez_borrows
where loan_amount_usd is not null
group by
1,
2
UNION
QueryRunArchived: QueryRun has been archived