Elprognerd5 categorized number of contracts base on total fees
Updated 2023-03-27
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
›
⌄
select case when "Total fees" < 0.01 then 'Less Than 0.01 AVAX'
when "Total fees" between 0.01 and 0.1 then 'Between 0.01 and 0.1 AVAX'
when "Total fees" between 0.1 and 1 then 'Between 0.1 and 1 AVAX'
when "Total fees" between 1 and 10 then 'Between 1 and 10 AVAX'
when "Total fees" between 10 and 100 then 'Between 10 and 100 AVAX'
when "Total fees" between 100 and 1000 then 'Between 100 and 1000 AVAX'
else 'More Than 1000 AVAX' end as type,
count (DISTINCT contract_address) as "Number of contracts"
from (select contract_address,
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_contracts z on y.contract_address = z.address
where x.block_timestamp >= '{{From_Date}}'
and x.block_timestamp <= '{{To_Date}}'
group by 1)
group by 1
order by 2 desc
Run a query to Download Data