Query editor
-- 7번 쿼리: 프로토콜별 성과 비교WITH protocol_performance AS (SELECT"to" as protocol_address,COUNT(*) as tx_count,COUNT(DISTINCT "from") as unique_borrowers,SUM(value / 1e18) as total_volume_eth,AVG(value / 1e18) as avg_tx_size_eth,MAX(value / 1e18) as max_tx_size_eth,MIN(block_time) as first_tx,MAX(block_time) as last_txFROM ethereum.transactionsWHERE block_time >= now() - interval '7' dayAND value / 1e18 >= 10AND success = trueGROUP BY "to"HAVING COUNT(*) >= 5 -- 최소 5번 이상 거래)SELECTprotocol_address,tx_count,unique_borrowers,ROUND(total_volume_eth, 2) as total_volume_eth,ROUND(avg_tx_size_eth, 2) as avg_tx_size_eth,ROUND(max_tx_size_eth, 2) as max_tx_size_eth,first_tx,last_tx,ROUND(unique_borrowers * 100.0 / tx_count, 2) as borrower_ratio,ROW_NUMBER() OVER (ORDER BY total_volume_eth DESC) as volume_rankFROM protocol_performanceORDER BY total_volume_eth DESCLIMIT 20;