Query editor
-- Metric / 04: Aggregator attribution (weekly volume by routing source)-- Joins every Metric swap to its transaction and maps transactions."to" against-- known DEX-aggregator router addresses. Metric ran in stealth as an-- aggregator-only venue, so this is the core "where does the flow come from" view.---- CAVEATS:-- * Aggregators often execute through executor/settler sub-contracts rather-- than the public router as tx.to, so matched volume is a LOWER BOUND per-- aggregator. Extend the mapping by inspecting the top unmatched tx.to-- addresses (filter aggregator = 'direct/other', group by tx_to).-- * 0x Settler uses rotating per-chain addresses not listed here.WITH pools AS (SELECT blockchain, pool, token0, token1FROM query_8021466 -- Metric PropAMM - 01 Pool Registry),-- chain = NULL means the address is the same on every chainagg_routers (aggregator, chain, address) AS (VALUES('KyberSwap', CAST(NULL AS VARCHAR), 0x6131B5fae19EA4f9D964eAc0408E4408b66337b5),('Velora (Paraswap)', NULL, 0x6A000F20005980200259B80c5102003040001068),('OpenOcean', NULL, 0x6352a56caadC4F1E25CD6c75970Fa768A3304e64),('1inch', NULL, 0x111111125421cA6dc452d289314280a0f8842A65),('0x', NULL, 0xDef1C0ded9bec7F1a1670819833240f027b25EfF),('0x', NULL, 0x0000000000001fF3684f28c67538d4D072C22734),('Odos', 'ethereum', 0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559),('Odos', 'base', 0x19cEeAd7105607Cd444F5ad10dd51356436095a1),('Odos', 'arbitrum', 0xa669e7A0d4b3e4Fa48af2dE86BD4CD7126Be4e13),('Odos', 'polygon', 0x4E3288c9ca110bCC82bf38F09A7b425c095d92Bf),('Odos', 'avalanche_c', 0x88de50B233052e4Fb783d4F6db78Cc34fEa3e9FC),('Odos', 'bnb', 0x89b8AA89FDd0507a99d334CBe3C808fAFC7d850E)),swaps AS (SELECTl.blockchain,l.block_time,l.tx_hash,p.token0,p.token1,varbinary_to_int256(varbinary_substring(l.data, 97, 32)) AS amount0_delta,varbinary_to_int256(varbinary_substring(l.data, 129, 32)) AS amount1_deltaFROM evms.logs lJOIN pools pON p.blockchain = l.blockchainAND p.pool = l.contract_addressWHERE l.topic0 = 0xcd8b75a7fb6cb82ab3acded68ac53af5c43d19b51a91b9d5640bb73622dbdf57AND l.block_time >= TIMESTAMP '2026-02-01'),swaps_in AS (SELECTblockchain,block_time,tx_hash,CASE WHEN amount0_delta > 0 THEN token0 ELSE token1 END AS token_in,CASE WHEN amount0_delta > 0 THEN amount0_delta ELSE amount1_delta END AS amount_in_rawFROM swapsWHERE amount0_delta > 0 OR amount1_delta > 0