0xHaM-dAverage Daily Success Rate
    Updated 2024-10-28
    -- forked from https://flipsidecrypto.xyz/hess/q/KxzDIIGvccRt/average-daily-success-rate
    with
    chains as (
    select date(block_timestamp) as date,
    'Aptos' as chain,
    case when SUCCESS = 'true' then 'SUCCESS' else 'FAIL' end as status,
    count(DISTINCT TX_HASH) as total_tx,
    total_tx/86400 as tps
    from aptos.core.fact_transactions
    where block_timestamp::date >= '2024-09-01'
    group by 1,2,3
    UNION
    select date(block_timestamp) as date,
    'Sei' as chain,
    case when TX_SUCCEEDED = 'true' then 'SUCCESS' else 'FAIL' end as status,
    count(DISTINCT tx_id) as total_tx,
    total_tx/86400 as tps
    from sei.core.fact_transactions
    where block_timestamp::date >= '2024-09-01'
    group by 1,2,3
    UNION
    select date(block_timestamp) as date,
    'Arbitrum' as chain,
    status,
    count(DISTINCT tx_hash) as total_tx,
    total_tx/86400 as tps
    from arbitrum.core.fact_transactions
    where block_timestamp::date >= '2024-09-01'
    group by 1,2,3
    UNION
    select date(block_timestamp) as date,
    'Optimism' as chain,
    status,
    count(DISTINCT tx_hash) as total_tx,
    total_tx/86400 as tps
    from optimism.core.fact_transactions
    QueryRunArchived: QueryRun has been archived