select
DATE(BLOCK_TIMESTAMP) AS "DAY",
case
when SUCCEEDED = TRUE then 'Successful Transactions'
when SUCCEEDED = FALSE then 'Failed Transactions'
else null
end as Status,
COUNT(DISTINCT TX_ID) AS "Swaps"
from solana.core.fact_swaps
where ( SWAP_PROGRAM = 'raydium v4')
and BLOCK_TIMESTAMP >= CURRENT_DATE() - interval '6 month'
GROUP BY 1,2