nsa2000OPTOP4
    Updated 2023-02-23
    select 'Optimism' as blockchain,
    block_timestamp::date as date,
    count (case when STATUS != 'SUCCESS' then 1 end) as Failed_TX,
    count (case when STATUS = 'SUCCESS' then 1 end) as Success_TX,
    (Failed_TX / (Success_TX + Failed_TX)) * 100 as Failure_Rate
    from optimism.core.fact_transactions
    where date >= '2023-01-01'

    group by 1,2

    union ALL

    select 'Ethereum' as blockchain,
    block_timestamp::date as date,
    count (case when STATUS != 'SUCCESS' then 1 end) as Failed_TX,
    count (case when STATUS = 'SUCCESS' then 1 end) as Success_TX,
    (Failed_TX / (Success_TX + Failed_TX)) * 100 as Failure_Rate
    from ethereum.core.fact_transactions
    where date >= '2023-01-01'

    group by 1,2
    Run a query to Download Data