kasadeghUntitled Query
Updated 2022-10-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 sol_defi_tx_stats_before as (
select label as name,
count(distinct tx_id) as tx_count ,
count(distinct instruction:accounts[0]) as users_count
from solana.core.fact_events inner join solana.core.dim_labels
on program_id = address
where SUCCEEDED='TRUE' and
label_type in( 'dex', 'defi', 'dapp') and
label_type != 'pyth' and
block_timestamp::date >='2022-10-7' and block_timestamp::date< '2022-10-10'
group by 1
order by 1
)
, sol_defi_tx_stats_after as (
select label as name,
count(distinct tx_id) as tx_count ,
count(distinct instruction:accounts[0]) as users_count
from solana.core.fact_events inner join solana.core.dim_labels
on program_id = address
where SUCCEEDED='TRUE' and
label_type in( 'dex', 'defi') and
label_type != 'pyth' and
block_timestamp::date >='2022-10-12' and block_timestamp::date< '2022-10-16'
group by 1
order by 1
)
select a.name,
((a.tx_count-b.tx_count)/b.tx_count)*100 as change_percentage
from sol_defi_tx_stats_before as b join sol_defi_tx_stats_after as a
on b.name=a.name
where change_percentage>0
order by change_percentage desc
limit 15
Run a query to Download Data