Query editor
WITHarb_labels AS (SELECTaddressFROMlabels.allWHEREcategory = 'arbitrage_traders'AND CONTAINS(blockchain, 'ethereum')),sandwich_labels AS (SELECTaddressFROMlabels.allWHEREcategory = 'sandwich_attackers'AND CONTAINS(blockchain, 'ethereum')),daily_data AS (WITHarb_data AS (SELECTblock_date AS day,COUNT(*) AS arb_txs,SUM(amount_usd) AS arb_volume,AVG(amount_usd) AS arb_tx_size,COUNT(DISTINCT u.taker) AS arb_bots_unique,TRUE AS is_arb,FALSE AS is_sandwichFROMuniswap_v3_ethereum.trades AS uWHEREu.taker IN (SELECTaddressFROMarb_labels)AND u.token_bought_symbol <> 'CAW' /* this token contains erroneous data */AND u.token_sold_symbol <> 'CAW'AND u.block_date > NOW() - INTERVAL '{{trailing_months}}' monthGROUP BY1),sandwich_data AS (SELECTblock_date AS day,COUNT(*) AS sand_txs,SUM(amount_usd) AS sand_volume,AVG(amount_usd) AS sand_tx_size,COUNT(DISTINCT u.taker) AS sand_bots_uniqueFROMuniswap_v3_ethereum.trades AS uWHEREu.taker IN (SELECTaddressFROMsandwich_labels