h4wk(%) STPM Comparison copy
    Updated 2023-12-30
    -- forked from (%) STPM Comparison @ https://flipsidecrypto.xyz/edit/queries/3b26605b-a876-4888-88d3-5b74e836fbdc

    -- forked from (%) STPM Comparison @ https://flipsidecrypto.xyz/edit/queries/f94dd258-3d66-4de2-bf71-a7a21f16dd57

    -- ETH
    with eth_total_avg_for_minute as (
    select
    count(*)/count(DISTINCT block_timestamp::date)/1440 as tx_per_min
    from ethereum.core.fact_transactions
    where block_timestamp::date < CURRENT_DATE and block_timestamp::date >= '2023-08-01'
    )

    , eth_success_per_min as (select
    count(*)/count(DISTINCT block_timestamp::date)/1440 as tx_per_min
    from ethereum.core.fact_transactions
    where block_timestamp::date < CURRENT_DATE and block_timestamp::date >= '2023-08-01'
    and status = 'SUCCESS'
    )
    , base_eth as (
    select * from (
    select tx_per_min, 'Total' as type from (select * from eth_total_avg_for_minute)
    UNION
    select tx_per_min, 'Success' as type from (select * from eth_success_per_min)
    ) order by type
    )
    , final_eth as (
    select 'Ethereum' as chain,
    round(sum(case when type = 'Total' then tx_per_min end), 2) as tpm,
    round(sum(case when type = 'Success' then tx_per_min end), 2) as stpm,
    stpm/tpm*100 as percentage
    from base_eth
    )

    -- SOLANA
    , sol_total_avg_for_minute as (
    select
    QueryRunArchived: QueryRun has been archived