Moeavg failure rate per chain
    Updated 2024-03-03
    with base as (SELECT
    date_trunc(hour,block_timestamp) as hours,
    'Blast' as chain ,
    COUNT(distinct case when status ilike 'fail' then TX_HASH end)
    /COUNT(distinct TX_HASH) as failure_rate
    FROM blast.core.fact_transactions
    GROUP BY hours
    union all
    SELECT
    date_trunc(hour,block_timestamp) as hours,
    'Arbitrum' as chain ,
    COUNT(distinct case when status ilike 'fail' then TX_HASH end)
    /COUNT(distinct TX_HASH) as failure_rate
    FROM Arbitrum.core.fact_transactions
    where block_timestamp > current_date - 6

    GROUP BY hours
    union all
    SELECT
    date_trunc(hour,block_timestamp) as hours,
    'Polygon' as chain ,
    COUNT(distinct case when status ilike 'fail' then TX_HASH end)
    /COUNT(distinct TX_HASH) as failure_rate
    FROM Polygon.core.fact_transactions
    where block_timestamp > current_date - 6

    GROUP BY hours
    union all
    SELECT
    date_trunc(hour,block_timestamp) as hours,
    'Optimism' as chain ,
    COUNT(distinct case when status ilike 'fail' then TX_HASH end)
    /COUNT(distinct TX_HASH) as failure_rate
    FROM Optimism.core.fact_transactions
    where block_timestamp > current_date - 6

    QueryRunArchived: QueryRun has been archived