Query editor
with fusion_trade as (select distinct block_time, tx_hash, solver, trade_usd, trade_pair, makerfrom dune.flashbots.result_1inch_fusion_txs_7d), dedup_fusion_lop_from_base_dex as (select t.*from query_3099960 tleft join dune.flashbots.result_1inch_fusion_txs_7d tt on t.tx_hash = tt.tx_hashand tt.taker_token_address = t.taker_tokenand tt.maker_token_address = t.maker_tokenand tt.taker_token_amount_raw = t.taker_token_amount_rawand tt.maker_token_amount_raw = t.maker_token_amount_rawand t.project = '1inch Limit Order Protocol'where tt.tx_hash is null)selectf.tx_hash as hash,f.block_time,b."number" as block_number,'1inch Website: Default' as frontend,'1inch Fusion' as metaaggregator,solver,trade_usd, -- user side from fusion trade total'' as aggregator,coalesce(t.token_pair, f.trade_pair) as token_pair,coalesce(amount_usd, trade_usd) as amount_usd,case when t.project ='uniswap' then concat('Uniswap V', t.version)when t.project LIKE '%1inch%' then(case when lower(t.version) LIKE '%rfq%' then '1inch RFQ'else '1inch Limit Orders' end)when t.project = '0x API' then 'Other RFQ'else CONCAT(UPPER(SUBSTRING(t.project, 1, 1)),SUBSTRING(t.projectFROM2))end as liquidity_src,-- else 'Other DEXes' end as liquidity_src,case when t.project = 'Hashflow' then pmmwhen t.project LIKE '%1inch%' and lower(t.version) LIKE '%rfq%' then coalesce(mm.name || ' PMM', '1inch PMM')-- makerwhen t.project is null then coalesce(mm.name || ' PMM', mm2.name || ' PMM', concat(solver, ' PMM')) else null end as pmm, f.maker -- temp for qafrom fusion_trade fjoin ethereum.blocks b on f.block_time = b."time"left join dedup_fusion_lop_from_base_dex t on f.tx_hash = t.tx_hashleft join query_2812729 mm on mm.address = t.makerleft join query_2812729 mm2 on mm2.address = f.maker