Query editor
WITH raw_uni_v3 AS (SELECT call_tx_hash, trim(BOTH '"' FROM trim(BOTH '"' FROM json_query(params, 'strict $.recipient'))) AS to FROM uniswap_v3_ethereum.SwapRouter_call_exactInputWHERE call_success = trueUNIONSELECT call_tx_hash, trim(BOTH '"' FROM json_query(params, 'strict $.recipient')) AS to FROM uniswap_v3_ethereum.SwapRouter_call_exactInputSingleWHERE call_success = trueUNIONSELECT call_tx_hash, trim(BOTH '"' FROM json_query(params, 'strict $.recipient')) AS to FROM uniswap_v3_ethereum.SwapRouter_call_exactOutputWHERE call_success = trueUNIONSELECT call_tx_hash, trim(BOTH '"' FROM json_query(params, 'strict $.recipient')) AS to FROM uniswap_v3_ethereum.SwapRouter_call_exactOutputSingleWHERE call_success = trueUNIONSELECT call_tx_hash, trim(BOTH '"' FROM json_query(params, 'strict $.recipient')) AS to FROM uniswap_v3_ethereum.SwapRouter02_call_exactInputWHERE call_success = trueUNIONSELECT call_tx_hash, trim(BOTH '"' FROM json_query(params, 'strict $.recipient')) AS to FROM uniswap_v3_ethereum.SwapRouter02_call_exactInputSingleWHERE call_success = trueUNIONSELECT call_tx_hash, trim(BOTH '"' FROM json_query(params, 'strict $.recipient')) AS to FROM uniswap_v3_ethereum.SwapRouter02_call_exactOutputWHERE call_success = trueUNIONSELECT call_tx_hash, trim(BOTH '"' FROM json_query(params, 'strict $.recipient')) AS to FROM uniswap_v3_ethereum.SwapRouter02_call_exactOutputSingleWHERE call_success = true)SELECT CASEWHEN CAST(txs."from" AS VARCHAR) = trades.to OR trades.to IN ('0x0000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000002') THEN 'Swap'ELSE 'Swap and send'END AS swap_type,DATE_TRUNC('month', block_time) AS month,COUNT() AS number_txs FROM raw_uni_v3 tradesLEFT JOIN ethereum.transactions txs ON call_tx_hash=hashWHERE txs.to IN (0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45, 0xE592427A0AEce92De3Edee1F18E0157C05861564)GROUP BY 1, 2