Query editor
WITH recent_trades AS (SELECTTRY_CAST(call_block_time AS DATE) AS date,call_block_time, /* Added missing column to CTE output */call_tx_id,account_inputVaultMint,account_outputVaultMint,amount AS input_amount,otherAmountThreshold AS output_amount,CASEWHEN account_inputVaultMint = 'So11111111111111111111111111111111111111112'THEN amount / 1e9WHEN account_outputVaultMint = 'So11111111111111111111111111111111111111112'THEN otherAmountThreshold / 1e9ELSE 0END AS sol_volume,CASEWHEN account_inputVaultMint = 'So11111111111111111111111111111111111111112'THEN amount / 1e9ELSE amount / 1e6END AS corrected_input_amount,CASEWHEN account_outputVaultMint = 'So11111111111111111111111111111111111111112'THEN otherAmountThreshold / 1e9ELSE otherAmountThreshold / 1e6END AS corrected_output_amountFROM raydium_clmm_solana.amm_v3_call_swapV2WHERE(account_inputVaultMint IN ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 'So11111111111111111111111111111111111111112')AND account_outputVaultMint IN ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', 'So11111111111111111111111111111111111111112'))AND call_block_date = CURRENT_DATE - INTERVAL '1' day)SELECTdate,call_block_time,call_tx_id,account_inputVaultMint,account_outputVaultMint,corrected_input_amount AS amount,corrected_output_amount AS otherAmountThreshold,SUM(sol_volume) OVER (ORDER BY call_block_time ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_sol_tradedFROM recent_tradesORDER BYcall_block_time