with meta as (
SELECT distinct tx_hash
FROM ethereum.core.fact_transactions
WHERE to_address = lower('0x881D40237659C251811CEC9c364ef91dC08D300C')
and block_timestamp >= CURRENT_DATE - 180),
sush as ( SELECT tx_hash
from ethereum.core.ez_dex_swaps
where tx_hash not in (select tx_hash from meta)
and platform = 'sushiswap'
and block_timestamp >= CURRENT_DATE - 180)
SELECT sum(a.FEE_USD) as fees, a.BLOCK_TIMESTAMp::date as date
from flipside_prod_db.ethereum.transactions a
join sush b
on a.TX_ID=b.tx_hash
group by 2