Skip to content

Commit

Permalink
Add new full bonding pools (#95)
Browse files Browse the repository at this point in the history
* add new full bonding pools

* remove unecessary spaces
  • Loading branch information
harisang authored Dec 16, 2024
1 parent 0c744f5 commit 562ec49
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
),

Expand All @@ -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)
),

Expand All @@ -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
Expand Down

0 comments on commit 562ec49

Please sign in to comment.