shaunoffSol CUs - Transactions by status
    Updated 2023-12-01
    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