SalehBlast_tx_true_false_daily
    Updated 2024-11-11
    with lst_tx_s as (
    select
    date_trunc(hour,block_timestamp) as date
    ,count(DISTINCT tx_hash) as TXn_S
    from blast.core.fact_transactions
    where STATUS='SUCCESS'
    group by 1

    )
    , lst_tx_f as (
    select
    date_trunc(hour,block_timestamp) as date
    ,count(DISTINCT tx_hash) as TXn_F
    from blast.core.fact_transactions
    where STATUS!='SUCCESS'
    group by 1

    )
    select
    date
    ,TXn_S
    ,TXn_F
    ,ZEROIFNULL(TXn_S) + ZEROIFNULL(TXn_F) as "all"
    ,round(100/"all"*ZEROIFNULL(TXn_S)) as "Success Ratio"
    ,round(100/"all"*ZEROIFNULL(TXn_F)) as "Failure Rate"
    from lst_tx_s
    left join lst_tx_f using(date)

    QueryRunArchived: QueryRun has been archived