Elprognerd7 - chart of top dapp with most txn fee volume copy
Updated 2023-03-29Copy Reference Fork
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
›
⌄
with t1 as (
select
project_name as "dApp",
sum(tx_fee) as "Total fees"
from avalanche.core.fact_transactions x join avalanche.core.fact_event_logs y on x.tx_hash = y.tx_hash
join avalanche.core.dim_labels z on y.origin_to_address = z.address
where x.block_timestamp >= '{{From_Date}}'
and x.block_timestamp <= '{{To_Date}}'
and label_type ilike 'dapp'
GROUP BY 1
ORDER BY 2 DESC
LIMIT 8
)
select
date_trunc('{{Time_Unit}}',x.block_timestamp) as date,
project_name as "dApp",
sum(tx_fee) as "Total fees"
from avalanche.core.fact_transactions x join avalanche.core.fact_event_logs y on x.tx_hash = y.tx_hash
join avalanche.core.dim_labels z on y.origin_to_address = z.address
where x.block_timestamp >= '{{From_Date}}'
and x.block_timestamp <= '{{To_Date}}'
and label_type ilike 'dapp'
and project_name in (SELECT "dApp" from t1)
GROUP BY 1, 2
ORDER BY 1
Run a query to Download Data