select
date_trunc(month, block_timestamp) as date,
case when TX_SUCCEEDED = 'TRUE' then 'Succeeded'
else 'Failed'
end as status,
count(DISTINCT tx_hash) as N_Transactions
from kaia.core.fact_transactions
where block_timestamp is not null
group by 1, 2