Abbas_ra21Top Borrowers 2
Updated 2024-05-10
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
›
⌄
with tb AS (select
BORROWER AS "Borrower Address",
sum(
case
when Amount_USD is not null then Amount_USD
else Amount * Price
end
) AS Volume,
Count(*) AS "Borrow Count"
from
base.defi.ez_lending_borrows A
inner join base.price.ez_hourly_token_prices B on B.TOKEN_ADDRESS = A.TOKEN_ADDRESS
and HOUR = date_trunc('hour', BLOCK_TIMESTAMP)
where
PLATFORM = 'Seamless'
group by
1 order by 2 desc limit 200)
select
PROJECT_NAME AS Project,
count(*) AS TX
from base.core.fact_transactions
inner join base.core.dim_labels on to_address=Address
where FROM_ADDRESS in (select "Borrower Address" from tb)
and label_type not in ('operator','token','chadmin')
group by 1 order by 2 desc limit 10