Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new full bonding pools #95

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename this to deprecated? Having Gnosis vs Gnosis DAO seems a bit awkwardly implicit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean, have the name of the pool being "Deprecated"?

The slight change from Gnosis to Gnosis DAO was just to make it uniform with the CoW DAO pool naming, and was not meant to differentiate the old with the new.

(E.g., Project Blanc is still Project Blanc)

'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
Loading