0xHaM-dCosmos_tx
    Updated 2022-12-13
    WITH cos_tx as (
    SELECT
    block_timestamp::date as date,
    count(*) as tx_cnt,
    TX_SUCCEEDED,
    count(CASE WHEN TX_SUCCEEDED != TRUE THEN 1 END) as fail_tx_cnt
    from cosmos.core.fact_transactions
    where block_timestamp >= '2022-01-01'
    AND block_timestamp <= CURRENT_DATE - 1
    GROUP BY 1,3
    )

    SELECT
    date,
    sum(tx_cnt-fail_tx_cnt)/(1440) as "Succeed Tx/Minute",
    sum(fail_tx_cnt)/sum(tx_cnt)*100 as "Failed Tx Rate"
    FROM cos_tx
    group by 1
    order by 1


    Run a query to Download Data