Query editor
-- ============================================================================-- Weekly INCOME decomposition for our solver(s), all in native ETH.-- Adapted from the unified metrics query: kept the income components, dropped-- the unsettle block, USD/per-tx noise, and quote reward (COW, breaks 1-unit).-- ------------------------------------------------------------------------------ Components (one unit = ETH native):-- performance_eth = capped_payment (performance reward)-- consistency_eth = consistency_budget_contribution (see caveat below)-- slippage_eth = realized token slippage (own pipeline)-- gas_reimbursed_eth = network_fee (= reimbursement - slippage, pure gas refund)-- gas_spent_eth = on-chain gas_used * gas_price (gas we actually paid;-- query_4351957.execution_cost came back empty for us)-- net_revenue_eth = perf + consistency + slippage + gas_reimbursed - gas_spent---- Window driven by {{start_time}} / {{end_time}} (set to Jan 1 -> now for YTD).-- Granularity = week, anchored Tuesday->Tuesday to match CoW accounting periods-- (date_trunc gives Monday, so we shift -1d, truncate, +1d). For daily, replace-- the week expression with date_trunc('day', <ts>).---- CAVEATS:-- * performance is GROSS capped_payment -- no 0.85 service-fee factor or rare-- per-auction multiplier from the official payout query.-- * consistency uses the per-auction `consistency_budget_contribution` so it-- can be bucketed by week. The FINAL consistency reward is allocated from a-- capped budget at period end (query_7352571); this is the pre-cap building-- block, i.e. a decomposition proxy, not the exact paid amount.-- * quote reward (COW) intentionally excluded -- ask to add it converted to ETH.-- ============================================================================WITHsolver_filter AS (SELECT address FROM (VALUES(0x1921E0ff550c09066eDD4Df05d304151C45E77DE), -- ...77de(0xC7899Ff6A3aC2FF59261bD960A8C880DF06E1041)) AS t(address)),-- single scan of the per-auction reward feed, all components in one placebase_auction_data AS (SELECT DISTINCTdune.auction_id,dune.solver,date_trunc('week', tr.time - interval '1' day) + interval '1' day AS week, -- Tue->Tuedune.capped_payment,dune.network_fee,dune.consistency_budget_contributionFROM "query_4351957(blockchain='ethereum')" AS duneLEFT JOIN ethereum.blocks AS tr ON tr.number = dune.block_deadlineWHERE tr.time >= cast('{{start_time}}' AS timestamp)AND tr.time <= cast('{{end_time}}' AS timestamp)AND dune.solver IN (SELECT address FROM solver_filter)),auction_components_weekly AS (SELECTweek,sum(cast(capped_payment AS decimal(38, 0))) / pow(10, 18) AS performance_eth,coalesce(sum(cast(consistency_budget_contribution AS decimal(38, 0))), 0) / pow(10, 18) AS consistency_eth, -- 0 before consistency reward existedsum(cast(network_fee AS decimal(38, 0))) / pow(10, 18) AS gas_reimbursed_ethFROM base_auction_data