KaskoazulTerra Failure days
    Updated 2022-03-20
    with SUCCESS as (
    select block_timestamp::date as fecha,
    tx_status,
    count(distinct tx_id) as successful_txs
    from terra.transactions
    where fecha >= '2021-11-01'
    and fecha < '2022-03-20'
    and tx_status = 'SUCCEEDED'
    group by 1,2
    ),

    FAIL as (
    select block_timestamp::date as fecha,
    count(distinct tx_id) as failed_txs
    from terra.transactions
    where block_timestamp >= '2021-11-01'
    and fecha < '2022-03-20'
    and tx_status = 'FAILED'
    group by 1
    )

    select s.fecha,
    s.successful_txs,
    f.failed_txs,
    s.successful_txs + f.failed_txs as total_txs,
    f.failed_txs/total_txs*100 as perc_failed,
    2 as limit
    from SUCCESS s
    left join FAIL f
    on s.fecha = f.fecha
    Run a query to Download Data