Query editor
withETH_price as (SELECT avg(price) AS price,contract_address AS tokenAddress,date_trunc('day', minute) AS block_dateFROM prices.usdWHERE contract_address = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2AND minute > cast('2024-05-01 00:00' as timestamp)GROUP BY 2, 3order by block_date desclimit 1),total_r as (selectgauge,total_rewards_ETH * price as total_rewardsfrom query_4839788 , ETH_price),total_b as(selectpoolName,sum(bribe_value) as total_bribefrom query_4808931where voter in ('veETH', 'veETH_old')group by 1)selectt1.gauge,t1.total_rewards / t2.total_bribe as Efficiencyfrom total_r t1left join total_b t2 on t1.gauge = t2.poolName