Query editor
WITHfrontend_txs AS (SELECT hash AS tx_hashFROM hyperevm.transactionsWHERE block_date >= current_date - INTERVAL '30' DAYAND "to" = 0x6352a56caadC4F1E25CD6c75970Fa768A3304e64AND strpos(lower(to_hex(data)), '05008c08a20579ca5b9511f4a7b446479863e5e1') > 0),oo_rows AS (SELECTt.tx_hash,date_trunc('day', min(t.block_time)) AS day,CASE WHEN f.tx_hash IS NOT NULL THEN 'HyperSwap frontend' ELSE 'External OpenOcean' END AS channel,CASE WHEN count_if(t.project = 'hyperswap') > 0 THEN 'HyperSwap used' ELSE 'No HyperSwap used' END AS outcome,max(t.amount_usd) AS volume_usdFROM dex.trades tLEFT JOIN frontend_txs f ON f.tx_hash = t.tx_hashWHERE t.blockchain = 'hyperevm'AND t.block_month >= date_trunc('month', current_date - INTERVAL '30' DAY)AND t.block_time >= current_timestamp - INTERVAL '30' DAYAND t.tx_to = 0x6352a56caadC4F1E25CD6c75970Fa768A3304e64GROUP BY t.tx_hash, 3)SELECTday,channel || ' - ' || outcome AS series,sum(volume_usd) AS volume_usd,count(*) AS transactionsFROM oo_rowsGROUP BY 1,2ORDER BY 1,2