Query editor
SELECT * FROM (-- noqa: TMP-- This query provides data related to rewards/payouts on a per order level-- for all auctions that had at least one winner.-- Parameters:-- : the chain for which we want to retrieve order data-- The output has the following columns:-- environment: varchar-- auction_id: bigint-- block_number: bigint-- order_uid: varbinary-- solver: varbinary-- quote_solver: varbinary-- tx_hash: varbinary-- surplus_fee: decimal(38, 0) | null (this was dropped since June 2025)-- protocol_fee: decimal(38, 0)-- protocol_volume_fee: decimal(38, 0)-- protocol_fee_token: varbinary-- protocol_fee_native_price: double-- quote_sell_amount: decimal(38, 0)-- quote_buy_amount: decimal(38, 0)-- quote_gas_cost: double-- quote_sell_token_price: double-- partner_fee: decimal(38, 0)-- partner_fee_recipient: varbinary-- protocol_fee_kind: varchar-- network_fee: decimal(38, 0) (this was added in June 2025)-- is_eligible_for_quote_reward: boolean (available from 22 Dec 2025, null before that)-- DISCLAIMER: All entries with auction_id = -1000 are invalidwithpast_data_ethereum as (selects.environment,cast(null as bigint) as auction_id,cast(d.block_number as bigint) as block_number,from_hex(d.order_uid) as order_uid,from_hex(d.solver) as solver,from_hex(d.data.quote_solver) as quote_solver, --noqa: RF01from_hex(d.tx_hash) as tx_hash,cast(d.data.surplus_fee as decimal(38, 0)) as surplus_fee, --noqa: RF01cast(cast(d.data.protocol_fee as varchar) as decimal(38, 0)) as protocol_fee,cast(null as decimal(38, 0)) as protocol_volume_fee,from_hex(d.data.protocol_fee_token) as protocol_fee_token, --noqa: RF01cast(d.data.protocol_fee_native_price as double) as protocol_fee_native_price, --noqa: RF01casewhen d.data.quote_sell_amount = 'None' then null --noqa: RF01else cast(d.data.quote_sell_amount as decimal(38, 0)) --noqa: RF01end as quote_sell_amount,casewhen d.data.quote_buy_amount = 'None' then null --noqa: RF01else cast(d.data.quote_buy_amount as decimal(38, 0)) --noqa: RF01end as quote_buy_amount,casewhen cast(d.data.quote_gas_cost as varchar) = 'NaN' then null --noqa: RF01else cast(d.data.quote_gas_cost as double) --noqa: RF01end as quote_gas_cost,case