Query editor
WITH monthly_data AS (SELECTDATE_TRUNC('month', (TRY_CAST(block_date AS TIMESTAMP))) AS month_end, -- Get the month for each block dateSUM(TRY_CAST(amount AS DOUBLE) / 1000000) AS total_top_ups -- Sum of top-upsFROM public.solana_core.fact_transfersWHEREblock_date >= TRY_CAST('2024-3-13 00:00:00' AS TIMESTAMP)AND (token_mint_address = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' -- USDTOR token_mint_address = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' -- USDC)AND to_owner = 'Af5qhcKbUaXBvWNycRUjNEKKSR3Msssz8V67MUs5ThL6'GROUP BY1)SELECTCONCAT(DATE_FORMAT(month_end, '%b-01(%a) - '), DATE_FORMAT(month_end + INTERVAL '1' MONTH - INTERVAL '1' day, '%b-%d(%a)')) AS Month, -- Format the month as start and end dateCONCAT('$ ', FORMAT('%,.2f', total_top_ups)) AS total_sum -- Use total_top_ups directlyFROM monthly_dataORDER BYmonth_end DESC;