shaunoffSol CUs - Transactions by status
Updated 2023-12-01Copy 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
activity as (
select
block_timestamp
, succeeded
from solana.core.fact_transactions
left join solana.price.ez_token_prices_hourly
on date_trunc('hour', fact_transactions.block_timestamp) = ez_token_prices_hourly.recorded_hour
and ez_token_prices_hourly.symbol = 'sol'
and ez_token_prices_hourly.recorded_hour >= current_timestamp() - interval '{{hours}} hours'
where date_trunc('minute', fact_transactions.block_timestamp) > current_timestamp() - interval '{{hours}} hours'
)
select
date_trunc('{{date_trunc}}', block_timestamp) as date
, count(case when succeeded then 1 end) as "Succeeded"
, count(case when not succeeded then 1 end) as "Failed"
, count(case when not succeeded then 1 end) / count(1) * 100 as "Failed %"
, count(1) as "Transactions"
, case
when '{{date_trunc}}' = 'minute' then count(1) / 60
when '{{date_trunc}}' = 'hour' then count(1) / 3600
when '{{date_trunc}}' = 'day' then count(1) / 86400
end as "Avg. TPS"
from activity
group by 1
Run a query to Download Data