Ali3NMinimum, Average, Maximum Optimism TPM Over Time
Updated 2023-02-24Copy 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
36
›
⌄
with timetable as (
select case when '{{Time_Frame}}' = 'Last 30 Days' then 30
when '{{Time_Frame}}' = 'Last 60 Days' then 60
when '{{Time_Frame}}' = 'Last 90 Days' then 90
when '{{Time_Frame}}' = 'Last 180 Days' then 180
when '{{Time_Frame}}' = 'Last 365 Days' then 365
when '{{Time_Frame}}' = 'All Time' then 2000
else 2000 end as timeFrame),
table1 as (
select 'Arbitrum' as chain,
date_trunc ({{Date_Trunc}},block_timestamp) as date,
minute(block_timestamp) as minute,
count (distinct tx_hash) as Tx_Count,
count (distinct from_address) as Users_Count
from arbitrum.core.fact_transactions join timetable
where STATUS = 'SUCCESS'
and date >= current_date - timeFrame
group by 1,2,3
union ALL
select 'Optimism' as chain,
date_trunc ({{Date_Trunc}},block_timestamp) as date,
minute(block_timestamp) as minute,
count (distinct tx_hash) as Tx_Count,
count (distinct from_address) as Users_Count
from optimism.core.fact_transactions join timetable
where STATUS = 'SUCCESS'
and date >= current_date - timeFrame
group by 1,2,3)
select date,
avg (Tx_Count) as Average_TPM,
min (tx_count) as minimum_TPM,
max (tx_count) as Maximum_TPM
Run a query to Download Data