Query editor
-- Query that fetches the list of solver addresses that are active-- and are properly vouched for by a full bonding pool-- Parameters:-- {{end_time}} - the end date timestamp for the accounting period (exclusively)-- {{blockchain}} - network the query is run on-- {{vouch_cte_name}} - valid_vouches for the vouches only or named_results for additional information on solver and pool namewith last_block_before_timestamp as (select end_block from "query_3333356(blockchain='{{blockchain}}',start_time='2018-01-01 00:00:00',end_time='{{end_time}}')"),full_bonding_pools as (selectpool_address,pool_name,casewhen pool_name ='Gnosis DAO' and '{{blockchain}}' = 'lens' then 0x010af2e55f0539282c2601915c98a5cd276862aawhen pool_name = 'CoW DAO' and '{{blockchain}}' = 'lens' then 0xe1ab179644b841e22bf036e467a3c64882a1b7c6else creatorend as creatorfrom query_4056263),-- Query Logic Begins here!vouches as (selectevt_block_number,evt_index,solver,cowrewardtarget as reward_target,pool_address,creator,True as activefrom "query_5143848(blockchain='{{blockchain}}')" inner join full_bonding_poolson pool_address = bondingpool and sender = creatorwhere evt_block_number <= (select * from last_block_before_timestamp)),invalidations as (selectevt_block_number,evt_index,solver,Null as reward_target, -- This is just to align with vouches to take a unionpool_address,creator,False as activefrom "query_5143758(blockchain='{{blockchain}}')" inner join full_bonding_poolson pool_address = bondingpool and sender = creatorwhere evt_block_number <= (select * from last_block_before_timestamp)),-- Intermediate helper tablevouches_and_invalidations as (select * from vouchesunion distinctselect * from invalidations),-- At this point we have excluded all arbitrary vouches (i.e., those not from initial funders of recognized pools)