Query editor
/* Simple Protocol Usage Analysis: Farmers vs Real Users *//* Query 1: Basic User Activity Classification */SELECTCASEWHEN tx_count > 100 AND days_active < 30THEN 'Likely Farmer'WHEN tx_count BETWEEN 20 AND 100 AND days_active > 60THEN 'Genuine User'WHEN tx_count > 50 AND days_active > 90THEN 'Power User'ELSE 'Casual User'END AS user_type,COUNT(*) AS user_count,ROUND(AVG(tx_count), 1) AS avg_transactions,ROUND(AVG(gas_spent_eth), 3) AS avg_gas_spent_eth,ROUND(AVG(days_active), 1) AS avg_active_daysFROM (SELECT"from" AS user_address,COUNT(*) AS tx_count,COUNT(DISTINCT DATE(block_time)) AS days_active,SUM(gas_used * gas_price / 1e18) AS gas_spent_ethFROM ethereum.transactionsWHEREblock_time >= CURRENT_TIMESTAMP - INTERVAL '180' DAYAND "to" IN (0x7a250d5630b4cf539739df2c5dacb4c659f2488d /* Uniswap V2 */, 0xe592427a0aece92de3edee1f18e0157c05861564 /* Uniswap V3 */, 0x881d40237659c251811cec9c364ef91dc08d300c /* MetaMask Swap */)GROUP BY"from"HAVINGCOUNT(*) >= 5) AS user_statsGROUP BY1ORDER BYuser_count DESC