Query editor
-- =============================================================================-- Query: Global CowSwap Activity of Tycho-Using Solvers — ETH + Base, chain-emitting-- Purpose: Metrix diagnostic ingestion variant of Dune 6528107 (decision D-172).---- This is q6528107 with ONE behavioral change: it emits a `chain` column and-- returns Ethereum AND Base in a single execution instead of filtering to a-- single `{{chain}}` parameter. Every other CTE is unchanged. The chain column-- lets `collect dune-results --query-id <id> --mapping-- dune_6528107_cowswap_cohort.json` store one raw fact per (period, chain,-- solver) with no cross-chain unique-key collision, matching how q7974308-- already emits chain.---- Coordinator: upload as a NEW private Dune query (do not overwrite 6528107 if-- any tile still depends on its single-chain shape), execute once with-- {{timeframe}}=weekly, then ingest. The only parameter is {{timeframe}};-- {{chain}} is removed.---- total_tycho_volume / total_tycho_batches are the Tycho-using solver cohort's-- GLOBAL CowSwap batch activity, NOT volume routed through Tycho router-- contracts. Shares are derived at read time and never stored.-- =============================================================================WITHbatches_all AS (SELECT block_date, block_time, num_trades, batch_value, solver_address, 'ethereum' as chainFROM cow_protocol_ethereum.batchesUNION ALLSELECT block_date, block_time, num_trades, batch_value, solver_address, 'base' as chainFROM cow_protocol_base.batches),solvers_unique AS (SELECTaddress,chain,CASEWHEN address = 0x5c3593481cba011737e36ded62f1797c9f6afce1AND chain IN ('ethereum', 'base')THEN 'Sector_Finance'ELSE MAX(name)END as nameFROM (SELECT address, name, 'ethereum' as chain, environment FROM cow_protocol_ethereum.solversUNION ALLSELECT address, name, 'base' as chain, environment FROM cow_protocol_base.solvers)WHERE environment = 'prod'OR (address = 0x5c3593481cba011737e36ded62f1797c9f6afce1)GROUP BY 1, 2),tycho_solver_config AS (SELECT name, chain, start_date FROM (VALUES('Tsolver', 'ethereum', DATE '2020-01-01'),('Sector_Finance', 'ethereum', DATE '2020-01-01'),('Fractal', 'ethereum', DATE '2020-01-01'),('Horadrim', 'ethereum', DATE '2020-01-01'),('Portus', 'ethereum', DATE '2025-06-09'),('Wraxyn', 'ethereum', DATE '2025-07-20'),('Prycto', 'ethereum', DATE '2025-11-25'),