mucrypto2023-09-01 07:42 AM
Updated 2023-09-02
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
with resps as
(select defillama.get('/protocols', {}) as resp),
m_list as (
select
value:parentProtocol::string as multiple_projects,
value:description::string as description,
value:category::string as category,
value:name::string as name,
value:tvl as tvl
from resps,
lateral flatten (input => resp:data)
where category = 'Lending'
and multiple_projects is not null)
select
name,
sum(tvl) as total_tvl
from m_list
where name in (select distinct(name) from m_list)
group by 1
Run a query to Download Data