Query editor
-- Solana-only daily estimated volume with additional router coverage.-- Fixed start: January 1, 2026. Automatic exclusive end: current_date.-- Includes completed UTC days through yesterday; no Dune parameters needed.-- Preserves existing source volume where captured; fills missing transactions-- from Dune DEX trades executed under an instruction invoking the router.-- Final DEX leg per outer instruction avoids counting ordinary sequential hops.-- Complex split routes/multiple swaps within one outer instruction need review.-- Transaction-level source precedence cannot repair partially captured trades.-- No wallet balance proxy or separate SOL price scan. Not executed on Dune.WITH router_calls AS (SELECT DISTINCT block_date, tx_id, outer_instruction_indexFROM solana.instruction_callsWHERE block_date >= DATE '2026-01-01'AND block_date < current_dateAND tx_success = TRUEAND executing_account ='BANANAjs7FJiPQqJTGFzkZJndT9o7UmKiYYGaJz6frGu'),router_legs AS (SELECTd.block_date, d.tx_id, d.amount_usd,ROW_NUMBER() OVER (PARTITION BY d.tx_id, d.outer_instruction_indexORDER BY d.inner_instruction_index DESC NULLS LAST,d.project, d.project_main_id,d.token_bought_mint_address,d.token_sold_mint_address,d.amount_usd DESC NULLS LAST) AS leg_rank,COUNT(*) OVER (PARTITION BY d.tx_id, d.outer_instruction_index) AS leg_countFROM dex_solana.trades dINNER JOIN router_calls rON d.tx_id = r.tx_idAND d.block_date = r.block_dateAND d.outer_instruction_index = r.outer_instruction_indexWHERE d.block_month >= date_trunc('month', DATE '2026-01-01')AND d.block_month <= date_trunc('month', current_date - INTERVAL '1' DAY)AND d.block_date >= DATE '2026-01-01'AND d.block_date < current_date),all_rows AS (SELECTCAST(block_time AS DATE) AS block_date,tx_id, amount_usd, 1 AS source_priority,0 AS multi_leg_routeFROM banana_gun_solana.bot_tradesWHERE block_time >= CAST(DATE '2026-01-01' AS TIMESTAMP)AND block_time < CAST(current_date AS TIMESTAMP)AND is_last_trade_in_transaction = TRUEUNION ALLSELECTCAST(block_time AS DATE),tx_id, amount_usd, 2 AS source_priority,0 AS multi_leg_routeFROM dune.banana_gun.result_banana_gun_usdc_fee_trades