Moefailure
    Updated 2024-03-03
    SELECT
    date_trunc(hour,block_timestamp) as hours,
    'Blast' as chain ,
    100 * (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 ,
    100 * (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 ,
    100 * (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 ,
    100 * (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