mucrypto2023-11-16 08:03 PM
Updated 2023-11-16
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
32
33
34
35
36
›
⌄
with resps as
(select defillama.get('/protocols', {}) as resp),
positive as (
select
value:category as category,
value:name as name,
cast(value:change_1d as decimal(38,2)) as one_day_change,
value:description::string as description
from resps,
lateral flatten (input => resp:data)
where category = 'Synthetics'
and one_day_change > 0
order by 3 desc
limit 10),
negative as (
select
value:category as category,
value:name as name,
cast(value:change_1d as decimal(38,2)) as one_day_change,
value:description as description
from resps,
lateral flatten (input => resp:data)
where category = 'Synthetics'
and one_day_change < 0
order by 3
limit 10)
select
name,
concat(one_day_change, '%') as one_day_change,
description,
'Positive' as category
from positive
Run a query to Download Data