From 562ec491de7506b9fdb127d2fc6f089ebb9de28a Mon Sep 17 00:00:00 2001 From: Haris Angelidakis <64154020+harisang@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:03:03 +0200 Subject: [PATCH] Add new full bonding pools (#95) * add new full bonding pools * remove unecessary spaces --- .../full_bonding_pools_query_4056263.sql | 20 ++++++++++++++----- .../mainnet/vouch_registry_query_1541516.sql | 12 +++++------ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/cowprotocol/accounting/rewards/mainnet/full_bonding_pools_query_4056263.sql b/cowprotocol/accounting/rewards/mainnet/full_bonding_pools_query_4056263.sql index eab91261..d1d6863a 100644 --- a/cowprotocol/accounting/rewards/mainnet/full_bonding_pools_query_4056263.sql +++ b/cowprotocol/accounting/rewards/mainnet/full_bonding_pools_query_4056263.sql @@ -3,19 +3,29 @@ with full_bonding_pools as ( select - from_hex('0x8353713b6D2F728Ed763a04B886B16aAD2b16eBD') as pool_address, + from_hex('0x8353713b6D2F728Ed763a04B886B16aAD2b16eBD') as pool_address, -- deprecated 'Gnosis' as pool_name, - from_hex('0x6c642cafcbd9d8383250bb25f67ae409147f78b2') as initial_funder + from_hex('0x6c642cafcbd9d8383250bb25f67ae409147f78b2') as creator union distinct select from_hex('0x5d4020b9261F01B6f8a45db929704b0Ad6F5e9E6') as pool_address, 'CoW DAO' as pool_name, - from_hex('0x423cec87f19f0778f549846e0801ee267a917935') as initial_funder + from_hex('0x423cec87f19f0778f549846e0801ee267a917935') as creator union distinct select - from_hex('0xC96569Dc132ebB6694A5f0b781B33f202Da8AcE8') as pool_address, + from_hex('0xC96569Dc132ebB6694A5f0b781B33f202Da8AcE8') as pool_address, -- deprecated 'Project Blanc' as pool_name, - from_hex('0xCa99e3Fc7B51167eaC363a3Af8C9A185852D1622') as initial_funder + from_hex('0xCa99e3Fc7B51167eaC363a3Af8C9A185852D1622') as creator + union distinct + select + from_hex('0x7489f267C3b43dc76e4cb190F7B55ab3297706AF') as pool_address, + 'Gnosis DAO' as pool_name, + from_hex('0x717e745040b9a486f2254659E8EA7Dc7d9a72A1e') as creator + union distinct + select + from_hex('0xe78d5F3aba2B31C980bF5E35E05B3A55b8365b48') as pool_address, + 'Project Blanc' as pool_name, + from_hex('0xCa99e3Fc7B51167eaC363a3Af8C9A185852D1622') as creator ) select * diff --git a/cowprotocol/accounting/rewards/mainnet/vouch_registry_query_1541516.sql b/cowprotocol/accounting/rewards/mainnet/vouch_registry_query_1541516.sql index 754f29a8..73a393c9 100644 --- a/cowprotocol/accounting/rewards/mainnet/vouch_registry_query_1541516.sql +++ b/cowprotocol/accounting/rewards/mainnet/vouch_registry_query_1541516.sql @@ -18,13 +18,13 @@ vouches as ( solver, cowRewardTarget as reward_target, pool_address, - initial_funder, + creator, True as active from cow_protocol_{{blockchain}}.VouchRegister_evt_Vouch inner join query_4056263 on pool_address = bondingPool - and sender = initial_funder + and sender = creator where evt_block_number <= (select * from last_block_before_timestamp) ), @@ -35,13 +35,13 @@ invalidations as ( solver, Null as reward_target, -- This is just to align with vouches to take a union pool_address, - initial_funder, + creator, False as active from cow_protocol_{{blockchain}}.VouchRegister_evt_InvalidateVouch inner join query_4056263 on pool_address = bondingPool - and sender = initial_funder + and sender = creator where evt_block_number <= (select * from last_block_before_timestamp) ), @@ -53,13 +53,13 @@ vouches_and_invalidations as ( ), -- At this point we have excluded all arbitrary vouches (i.e., those not from initial funders of recognized pools) --- The next query ranks (solver, pool_address, initial_funder) by most recent (vouch or invalidation) +-- The next query ranks (solver, pool_address, creator) by most recent (vouch or invalidation) -- and yields as rank 1, the current "active" status of the triplet. ranked_vouches as ( select *, rank() over ( - partition by solver, pool_address, initial_funder + partition by solver, pool_address, creator order by evt_block_number desc, evt_index desc ) as rk from vouches_and_invalidations