Query editor
WITH sandwich_trades AS (SELECTproject,COUNT(*) AS sandwich_countFROM dex.sandwichesWHERE blockchain = 'ethereum'GROUP BY project),total_trades AS (SELECTproject,COUNT(*) AS total_countFROM dex.tradesWHERE blockchain = 'ethereum'GROUP BY project)SELECTt.project,s.sandwich_count,t.total_count,ROUND(100.0 * s.sandwich_count / t.total_count, 4) AS sandwich_ratio_percentFROM total_trades tINNER JOIN sandwich_trades sON t.project = s.projectWHERE (100.0 * s.sandwich_count / t.total_count) > 0ORDER BY sandwich_ratio_percent DESC;