h4wkcomparison
Updated 2023-04-16
999
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
›
⌄
-- FLOW
with flow_total_avg_for_minute as (
select
count(*)/datediff(day, '2022-01-01'::date, CURRENT_DATE())/1440 as tx_per_min
from flow.core.fact_transactions
where block_timestamp::date < CURRENT_DATE and block_timestamp::date >= '2022-01-01'
)
, flow_success_per_min as (select
count(*)/datediff(day, '2022-01-01'::date, CURRENT_DATE())/1440 as tx_per_min
from flow.core.fact_transactions
where block_timestamp::date < CURRENT_DATE and block_timestamp::date >= '2022-01-01'
and tx_succeeded = True
)
, base_flow as (
select * from (
select tx_per_min, 'Total' as type from (select * from flow_total_avg_for_minute)
UNION
select tx_per_min, 'Success' as type from (select * from flow_success_per_min)
) order by type
)
, final_flow as (
select 'Flow' as chain,
sum(case when type = 'Total' then tx_per_min end) as tpm,
sum(case when type = 'Success' then tx_per_min end) as stpm,
stpm/tpm*100 as percentage
from base_flow
)
-- ETH
, eth_total_avg_for_minute as (
select
count(*)/datediff(day, '2022-01-01'::date, CURRENT_DATE())/1440 as tx_per_min
from ethereum.core.fact_transactions
where block_timestamp::date < CURRENT_DATE and block_timestamp::date >= '2022-01-01'
)
Run a query to Download Data