select
date(closed_at) as date,
count(*) as total_transactions,
sum(case when successful then 1 else 0 end) as successful_transactions,
sum(case when not successful then 1 else 0 end) as failed_transactions,
sum(operation_count) as total_operations
from stellar.core.fact_transactions
where closed_at >= date_trunc('month', current_date) - interval '12 months'
group by date
order by date desc;