Query editor
-- All Jupiter-routed swaps for {{base_token_mint}}/USDC within [start_time, end_time),-- built on Jupiter's own per-hop swap events instead of dex_solana.trades, so every-- route hop is visible regardless of whether Dune decodes the venue it executed on.-- * jupiter_solana.aggregator_swaps: v4/v5/v6 SwapEvent self-CPI logs (one row per hop)-- * jupiter_v6_solana.swapsevent_aggregator_swaps: batched SwapsEvent emitted by the-- v6 *_route_v2 instructions since 2025-09-17 (not yet part of the view above)-- Only returns transactions where the swapper actually sent or received the BASE token:-- net base-token flow per tx — across all Jupiter hops plus any non-Jupiter dex legs —-- must differ from zero by >1% of the larger side. Routes that merely pass through the-- base token (e.g. USDC -> base -> SOL -> USDC arbs) net to ~0 and are excluded.-- No such requirement applies to the quote asset (USDC).-- Quote (fixed): USDC EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v-- base_token_mint default: ORCA orcaEKTdK7LKz57vaAYr9QeNsVEPfiu6QeMU1kektZE-- Caveat: both spells keep only hops on AMMs tracked in spellbook's jupiter_solana_amms-- list, and for keeper-executed flows (DCA / limit orders) tx_signer is the keeper.WITH params AS (SELECTcast('{{start_time}}' AS timestamp) AS start_time,cast('{{end_time}}' AS timestamp) AS end_time,'{{base_token_mint}}' AS base_mint,'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' AS quote_mint -- USDC),-- Every Jupiter route hop in the window, as logged by the Jupiter program itself.-- Raw integer amounts are converted to display units via token decimals.jup_hops AS (SELECTs.block_time,s.block_slot,s.tx_id,s.tx_signer,s.amm,s.amm_name,s.log_index,s.jup_version,s.input_mint,cast(s.input_amount AS double) / pow(10, s.input_decimals) AS input_qty,s.input_usd,s.output_mint,cast(s.output_amount AS double) / pow(10, s.output_decimals) AS output_qty,s.output_usdFROM jupiter_solana.aggregator_swaps sCROSS JOIN params pWHERE s.block_month >= cast(date_trunc('month', p.start_time) AS date) -- partition pruningAND s.block_month <= cast(date_trunc('month', p.end_time) AS date)AND s.block_time >= p.start_timeAND s.block_time < p.end_timeUNION ALLSELECTs.block_time,s.block_slot,s.tx_id,s.tx_signer,s.amm,s.amm_name,s.log_index,s.jup_version,s.input_mint,cast(s.input_amount AS double) / pow(10, s.input_decimals) AS input_qty,