boomer77failed tx percentage
    Updated 2022-03-29
    with total as (select date_trunc('day', block_timestamp) as dt, count(distinct tx_id) as tx_count
    from terra.msgs
    where date(block_timestamp) >= CURRENT_DATE - 90
    group by 1),

    fail as (select date_trunc('day', block_timestamp) as dt, count(distinct tx_id) as tx_count
    from terra.msgs
    where date(block_timestamp) >= CURRENT_DATE - 90 and tx_status = 'FAILED'
    group by 1)

    select a.dt, a.tx_count as total_tx, b.tx_count as failed_tx, (failed_tx/total_tx)*100 as failed_percentage
    from total a
    left join fail b on a.dt = b.dt
    Run a query to Download Data