Query editor
-- This query finds all the active (i.e. whitelisted) solvers-- First we find the latest settlement for each solver-- Then we fetch the environment and name of the solver for the prod and barn environments-- Finally we display the name of the solver with both of its addresses-- Note: if a solver has x barn address and y prod address, we will display x*y rows for that solver-- Parameters-- {{blockchain}}: string the blockchain to querywith solver_latest_batches as (selectsolver_address,max(block_time) as latest_settlementfrom cow_protocol_{{blockchain}}.batchesgroup by solver_address),solvers as (selectaddress,environment,name,whitelisted as activefrom dune.cowprotocol.solverswhere blockchain = '{{blockchain}}'),active_solvers as (selectaddress,environment,name,coalesce(latest_settlement, timestamp '1970-01-01') as latest_settlementfrom solvers full outer join solver_latest_batches on address = solver_addresswhere environment not in ('test', 'service') and active = true)selectprod.name,prod.address as prod_address,barn.address as barn_address,greatest(prod.latest_settlement, barn.latest_settlement) as latest_settlementfrom active_solvers as prod inner join active_solvers as barnon prod.name = barn.name and prod.environment = 'prod' and barn.environment = 'barn'order by greatest(prod.latest_settlement, barn.latest_settlement) desc