Query editor
WITH raw_sushi AS (SELECT call_tx_hash, to FROM sushi_ethereum.Router02_call_swapETHForExactTokensWHERE call_success = trueUNIONSELECT call_tx_hash, to FROM sushi_ethereum.Router02_call_swapExactETHForTokensWHERE call_success = trueUNIONSELECT call_tx_hash, to FROM sushi_ethereum.Router02_call_swapExactETHForTokensSupportingFeeOnTransferTokensWHERE call_success = trueUNIONSELECT call_tx_hash, to FROM sushi_ethereum.Router02_call_swapExactTokensForETHWHERE call_success = trueUNIONSELECT call_tx_hash, to FROM sushi_ethereum.Router02_call_swapExactTokensForETHSupportingFeeOnTransferTokensWHERE call_success = trueUNIONSELECT call_tx_hash, to FROM sushi_ethereum.Router02_call_swapExactTokensForTokensWHERE call_success = trueUNIONSELECT call_tx_hash, to FROM sushi_ethereum.Router02_call_swapExactTokensForTokensSupportingFeeOnTransferTokensWHERE call_success = trueUNIONSELECT call_tx_hash, to FROM sushi_ethereum.Router02_call_swapTokensForExactETHWHERE call_success = trueUNIONSELECT call_tx_hash, to FROM sushi_ethereum.Router02_call_swapTokensForExactTokensWHERE call_success = trueUNIONSELECT call_tx_hash, to FROM sushiswap_router_processor2_ethereum.RouteProcessor2_call_processRouteWHERE call_success = true)SELECT CASEWHEN txs."from"=trades.to THEN 'Swap'ELSE 'Swap and send'END AS swap_type,DATE_TRUNC('month', block_time) AS month,COUNT() AS number_txs FROM raw_sushi tradesLEFT JOIN ethereum.transactions txs ON call_tx_hash=hashWHERE txs.to = 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9FGROUP BY 1, 2