with protocol_list as ( select distinct protocol
from external.defillama.fact_dex_volume
where chain ilike 'optimism')
select date, protocol, sum(fees) as daily_fees
from external.defillama.fact_protocol_fees_revenue
where chain ilike 'optimism'
and (lower(protocol) in (select * from protocol_list)
or lower(protocol) ilike 'uniswap%')
group by 1,2