Query editor
withauction_range as (select'prod' as environment,min(auction_id) as min_auction_id,max(auction_id) as max_auction_idfrom "query_5270914(blockchain='{{blockchain}}',start_time='{{start_time}}',end_time='{{end_time}}')"where environment = 'prod'),named_results as (select * from "query_1541516(blockchain='{{blockchain}}',end_time='{{end_time}}',vouch_cte_name='named_results')"),quote_cap_mapping as (select *from(values-- Pre CIP 72(timestamp '2010-01-01 00:00', timestamp '2025-08-12 00:00', 0.0006, 6, 'ethereum'),(timestamp '2010-01-01 00:00', timestamp '2025-08-12 00:00', 0.15, 6, 'gnosis'),(timestamp '2010-01-01 00:00', timestamp '2025-08-12 00:00', 0.0002, 6, 'base'),(timestamp '2010-01-01 00:00', timestamp '2025-08-12 00:00', 0.0002, 6, 'arbitrum'),(timestamp '2010-01-01 00:00', timestamp '2025-08-12 00:00', 0.0005, 6, 'avalanche_c'),(timestamp '2010-01-01 00:00', timestamp '2025-08-12 00:00', 0.5, 6, 'polygon'),-- Post CIP 72(timestamp '2025-08-12 00:00', timestamp '2099-01-01 00:00', 0.0007, 6, 'ethereum'),(timestamp '2025-08-12 00:00', timestamp '2099-01-01 00:00', 0.15, 6, 'gnosis'),(timestamp '2025-08-12 00:00', timestamp '2099-01-01 00:00', 0.00024, 6, 'base'),(timestamp '2025-08-12 00:00', timestamp '2099-01-01 00:00', 0.00024, 6, 'arbitrum'),(timestamp '2025-08-12 00:00', timestamp '2099-01-01 00:00', 0.0006, 6, 'avalanche_c'),(timestamp '2025-08-12 00:00', timestamp '2099-01-01 00:00', 0.6, 6, 'polygon'),(timestamp '2025-08-12 00:00', timestamp '2099-01-01 00:00', 0.15, 6, 'lens'),(timestamp '2025-08-12 00:00', timestamp '2099-01-01 00:00', 0.001, 6, 'bnb'),(timestamp '2025-08-12 00:00', timestamp '2099-01-01 00:00', 0.00003, 6, 'linea')) as t(from_ts, until_ts, quote_cap_native, quote_cap_cow, blockchain)),conversion_prices as (selectcow_price,native_token_pricefrom dune.cowprotocol.result_accounting_cow_and_native_prices_per_chainwhereblockchain = '{{blockchain}}'and end_time > date_add('day', -1, cast('{{end_time}}' as timestamp))and end_time < date_add('day', +1, cast('{{end_time}}' as timestamp))),-- BEGIN QUOTE REWARDSorder_quotes as (selectod.order_uid,casewhen coalesce(is_eligible_for_quote_reward, true) then od.quote_solverelse nullend as quote_solverfrom "query_4364122(blockchain='{{blockchain}}')" as od