Query editor
with auction_range as (selectenvironment,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}}')"group by environment),named_results as (select * from "query_1541516(blockchain='{{blockchain}}',end_time='{{end_time}}',vouch_cte_name='named_results')"),auction_data as (selectad.environment,ad.auction_id,ad.solver,ad.total_network_fee,ad.total_execution_cost,ad.capped_payment,ad.total_protocol_fee,ad.observed_scorefrom "query_5270914(blockchain='{{blockchain}}',start_time='{{start_time}}',end_time='{{end_time}}')" as adinner join auction_range on ad.environment = auction_range.environmentwhere ad.auction_id >= auction_range.min_auction_id and ad.auction_id <= auction_range.max_auction_id),auction_data_filtered as (selectad.environment,ad.auction_id,ad.solver,ad.total_network_fee,ad.total_execution_cost,ad.capped_payment * coalesce(ea.multiplier, 1) as capped_payment,ad.total_protocol_fee,ad.observed_scorefrom auction_data as ad left outer join "query_4842868(blockchain='{{blockchain}}')" as ea on ad.environment = ea.environment and ad.auction_id = ea.auction_id),conversion_prices as (select(select avg(price) from prices.usdwhereblockchain = 'ethereum' -- use cow price from mainnetand contract_address = 0xdef1ca1fb7fbcdc777520aa7f396b4e015f497aband date(minute) = cast('{{end_time}}' as timestamp) - interval '1' day) as cow_price,(select avg(price) from prices.usdwhereblockchain = '{{blockchain}}' -- use native prices from respective chainsand contract_address = (selectcasewhen '{{blockchain}}' = 'ethereum' then 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2when '{{blockchain}}' = 'gnosis' then 0xe91d153e0b41518a2ce8dd3d7944fa863463a97dwhen '{{blockchain}}' = 'arbitrum' then 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1when '{{blockchain}}' = 'base' then 0x4200000000000000000000000000000000000006