arbitrum_internArbitrum Lending Total Breakdown
Updated 2024-12-24
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
-- month,
event,
sum(occurrences) as occurrences,
sum(vol) as vol
-- sum(vol) over (partition by event order by month) as total_vol
from (
SELECT
date_trunc('month', block_timestamp) as month,
platform,
'borrow' as event,
'loan' as asset_type,
count(distinct borrower) as wallets,
sum(amount) as token,
sum(amount_usd) as vol,
count(*) as occurrences
from arbitrum.defi.ez_lending_borrows
where block_timestamp >= '2024-01-01'
-- and event_name = 'Borrow'
group by 1,2,3,4
union all
SELECT
date_trunc('month', block_timestamp) as month,
platform,
'deposit' as event,
'collateral' as asset_type,
count(distinct depositor) as wallets,
sum(amount) as token,
sum(amount_usd) as vol,
count(*) as occurrences
QueryRunArchived: QueryRun has been archived