WITH txn_summary AS (
SELECT
tx_succeeded,
COUNT(tx_hash) AS total_txns
FROM MONAD.testnet.fact_transactions
WHERE block_timestamp >= '2025-02-19 15:00:00.000'
GROUP BY tx_succeeded
),
txn_24h AS (
SELECT
tx_succeeded,
COUNT(tx_hash) AS txns_24h
FROM MONAD.testnet.fact_transactions
WHERE block_timestamp >= CURRENT_TIMESTAMP - INTERVAL '24 hours'
GROUP BY tx_succeeded
)
SELECT
t1.tx_succeeded AS success_status,
COALESCE(t1.total_txns, 0) AS total_txns,
COALESCE(t2.txns_24h, 0) AS txns_24h
FROM txn_summary t1
LEFT JOIN txn_24h t2
ON t1.tx_succeeded = t2.tx_succeeded
ORDER BY success_status DESC