0xHaM-dAll - AVG Success Rate
    Updated 2024-10-22
    -- forked from h4wk / All - AVG Success Rate @ https://flipsidecrypto.xyz/h4wk/q/W2zEYZQ107k0/all---avg-success-rate

    with
    parallel 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 >= '2023-11-01'
    group by 1,2,3
    -- UNION ALL
    -- 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 >= '2023-11-01'
    -- group by 1,2,3
    -- UNION ALL
    -- select date(block_timestamp) as date,
    -- 'Solana' as chain,
    -- case when succeeded = 'true' then 'SUCCESS' else 'FAIL' end as status,
    -- count(DISTINCT tx_id) as total_tx,
    -- total_tx/86400 as tps
    -- from solana.core.fact_transactions
    -- where block_timestamp::date >= '2023-11-01'
    -- group by 1,2,3
    )
    , final_parallel as (
    select
    chain ,
    -- 'Parallel' as chain ,
    status,
    QueryRunArchived: QueryRun has been archived