diff --git a/cowamm/cow_amm_cow_with_users_surplus_query_4031724.sql b/cowamm/cow_amm_cow_with_users_surplus_query_4031724.sql index 861d00dd..f8b34f16 100644 --- a/cowamm/cow_amm_cow_with_users_surplus_query_4031724.sql +++ b/cowamm/cow_amm_cow_with_users_surplus_query_4031724.sql @@ -92,7 +92,7 @@ reward_addresses as ( when solver_name = 'new-Uncatalogued' then cast(solver as varchar) else substring(solver_name, 6, 100) end as solver_name - from "query_1541516(end_time='{{end_time}}',vouch_cte_name='named_results')" + from "query_1541516(blockchain='ethereum',end_time='{{end_time}}',vouch_cte_name='named_results')" ), final_results_per_solver as ( diff --git a/cowprotocol/accounting/rewards/mainnet/mainnet_dashboard_query_2510345.sql b/cowprotocol/accounting/rewards/mainnet/mainnet_dashboard_query_2510345.sql index ce6e3516..295c4389 100644 --- a/cowprotocol/accounting/rewards/mainnet/mainnet_dashboard_query_2510345.sql +++ b/cowprotocol/accounting/rewards/mainnet/mainnet_dashboard_query_2510345.sql @@ -12,7 +12,7 @@ solver_slippage as ( ), named_results as ( - select * from "query_1541516(end_time='{{end_time}}',vouch_cte_name='named_results')" + select * from "query_1541516(blockchain='ethereum',end_time='{{end_time}}',vouch_cte_name='named_results')" ), -- BEGIN SOLVER REWARDS diff --git a/cowprotocol/accounting/rewards/mainnet/service_fee_query_4298142.sql b/cowprotocol/accounting/rewards/mainnet/service_fee_query_4298142.sql index 999c52c6..7cfd3902 100644 --- a/cowprotocol/accounting/rewards/mainnet/service_fee_query_4298142.sql +++ b/cowprotocol/accounting/rewards/mainnet/service_fee_query_4298142.sql @@ -23,7 +23,7 @@ active_cow_dao_solver_names as ( solver as solver_address, pool_name from - "query_1541516(vouch_cte_name='named_results',end_time='{{end_time}}')" + "query_1541516(blockchain='ethereum',vouch_cte_name='named_results',end_time='{{end_time}}')" where pool_address = 0x5d4020b9261f01b6f8a45db929704b0ad6f5e9e6 -- CoW DAO bonding pool address ), diff --git a/cowprotocol/accounting/rewards/mainnet/vouch_registry_query_1541516.sql b/cowprotocol/accounting/rewards/mainnet/vouch_registry_query_1541516.sql index c8cbc3ce..754f29a8 100644 --- a/cowprotocol/accounting/rewards/mainnet/vouch_registry_query_1541516.sql +++ b/cowprotocol/accounting/rewards/mainnet/vouch_registry_query_1541516.sql @@ -2,9 +2,12 @@ -- 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 name + with last_block_before_timestamp as ( - select end_block from "query_3333356(blockchain='ethereum',start_time='2018-01-01 00:00:00',end_time='{{end_time}}')" + select end_block from "query_3333356(blockchain='{{blockchain}}',start_time='2018-01-01 00:00:00',end_time='{{end_time}}')" ), -- Query Logic Begins here! @@ -17,7 +20,7 @@ vouches as ( pool_address, initial_funder, True as active - from cow_protocol_ethereum.VouchRegister_evt_Vouch + from cow_protocol_{{blockchain}}.VouchRegister_evt_Vouch inner join query_4056263 on pool_address = bondingPool @@ -34,7 +37,7 @@ invalidations as ( pool_address, initial_funder, False as active - from cow_protocol_ethereum.VouchRegister_evt_InvalidateVouch + from cow_protocol_{{blockchain}}.VouchRegister_evt_InvalidateVouch inner join query_4056263 on pool_address = bondingPool @@ -97,7 +100,7 @@ named_results as ( bp.pool_name, concat(environment, '-', s.name) as solver_name from valid_vouches as vv - inner join cow_protocol_ethereum.solvers as s + inner join cow_protocol_{{blockchain}}.solvers as s on vv.solver = s.address inner join query_4056263 as bp on vv.pool_address = bp.pool_address