Query editor
-- Dune query 8174770 contract v3: dSolver Base settlement/revert volume plus-- all-solver Base CoW Protocol settlement volume.---- Parameters:-- solver_address 0x-prefixed solver EOA-- blockchain must be "base" (guard for the Base-only first version)-- from_datetime inclusive ISO-8601 timestamp-- to_datetime exclusive ISO-8601 timestamp-- contract_version 2 for the legacy canonical-only denominator, 3 to opt in-- to the guarded missing-value hierarchy below---- Successful volume preserves the curated CoW trade usd_value when present.-- Missing successful-trade values use Base contract-address-keyed historical-- prices at the execution UTC hour: prices_external.hour first, then the-- filtered prices_dex.hour feed. Aave aTokens use their decoded underlying-- asset for price lookup and native ETH uses canonical Base WETH. If a-- two-sided DEX-hour candidate diverges by more than 2x, or neither side has-- an hourly price, an exact-transaction underlying DEX leg may anchor the-- token to an externally priced counterparty; per-leg anchors must also agree-- within 2x. Reverted volume is the gross attempted notional of every failed-- direct settle call,-- including attempts later retried successfully. GPv2Trade calldata is-- decoded with ABI offsets because Dune's generic decoder does not support-- this nested tuple shape. Missing prices remain explicit instead of being-- fabricated.WITHparams AS (SELECTfrom_hex(replace(lower('{{solver_address}}'), '0x', '')) AS solver,from_iso8601_timestamp('{{from_datetime}}') AS from_time,from_iso8601_timestamp('{{to_datetime}}') AS to_time,CAST('{{contract_version}}' AS integer) AS contract_versionWHERE lower('{{blockchain}}') = 'base'AND CAST('{{contract_version}}' AS integer) IN (2, 3)),aave_atokens AS (SELECTaToken AS atoken_address,max_by(asset, evt_block_number) AS underlying_addressFROM aave_v3_base.poolconfigurator_evt_reserveinitializedWHERE CAST('{{contract_version}}' AS integer) = 3GROUP BY aToken),external_hour_prices AS (SELECT timestamp, contract_address, CAST(price AS double) AS priceFROM prices_external.hourCROSS JOIN params pWHERE CAST('{{contract_version}}' AS integer) = 3AND blockchain = 'base'AND timestamp >= date_trunc('hour', p.from_time)AND timestamp < p.to_time),dex_hour_prices AS (SELECTtimestamp,contract_address,CAST(price AS double) AS price,CAST(volume AS double) AS volumeFROM prices_dex.hourCROSS JOIN params p