From 9839d5326f0d4be16103f3d5092df14ba4e32889 Mon Sep 17 00:00:00 2001 From: jalbrekt85 Date: Tue, 28 Oct 2025 14:42:04 -0500 Subject: [PATCH 1/4] read in ezkl pool list, account for ezkl fee split --- fee_allocator/accounting/chains.py | 12 +++++++++--- fee_allocator/constants.py | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fee_allocator/accounting/chains.py b/fee_allocator/accounting/chains.py index 6051434c..95c6df6d 100644 --- a/fee_allocator/accounting/chains.py +++ b/fee_allocator/accounting/chains.py @@ -31,6 +31,7 @@ FEE_CONSTANTS_URL, ALLIANCE_CONFIG_URL, PARTNER_CONFIG_URL, + EZKL_POOLS_URL, POOL_OVERRIDES_URL ) from fee_allocator.accounting.decorators import round, require_pool_fee_data @@ -69,6 +70,7 @@ def __init__( self.fee_config = GlobalFeeConfig(**requests.get(FEE_CONSTANTS_URL).json()) self.alliance_config = AllianceConfig(**requests.get(ALLIANCE_CONFIG_URL).json()) self.partner_config = PartnerConfig(**requests.get(PARTNER_CONFIG_URL).json()) + self.ezkl_pools = requests.get(EZKL_POOLS_URL).json() pool_overrides_raw = requests.get(POOL_OVERRIDES_URL).json() @@ -288,8 +290,13 @@ def _fetch_partner_pools(self) -> Dict[str, Partner]: if partner.pool_types: for pool_type in partner.pool_types: - pool_ids = self.subgraph.fetch_pools_by_type(pool_type) - logger.info(f"Found {len(pool_ids)} {pool_type} pools for {partner.name} on {self.name}") + if pool_type == "EZKL": + chain_ezkl_data = self.chains.ezkl_pools.get(self.name, {}) + pool_ids = chain_ezkl_data.get(self.chains.protocol_version, []) + logger.info(f"Found {len(pool_ids)} EZKL {self.chains.protocol_version} pools for {partner.name} on {self.name}") + else: + pool_ids = self.subgraph.fetch_pools_by_type(pool_type) + logger.info(f"Found {len(pool_ids)} {pool_type} pools for {partner.name} on {self.name}") for pool_id in pool_ids: # Skip if already added from explicit list @@ -319,7 +326,6 @@ def _get_pool_category(self, has_gauge: bool, is_core: bool) -> Optional[str]: elif not is_core and not has_gauge: return "non_core_without_gauge" elif is_core and not has_gauge: - logger.error("Invalid state: Core pool must have gauge") return None return None diff --git a/fee_allocator/constants.py b/fee_allocator/constants.py index 4747b21c..a8db5c46 100644 --- a/fee_allocator/constants.py +++ b/fee_allocator/constants.py @@ -1,6 +1,7 @@ FEE_CONSTANTS_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/protocol_fees_constants.json" ALLIANCE_CONFIG_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/alliance_fee_share.json" -PARTNER_CONFIG_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/partner_fee_share.json" +PARTNER_CONFIG_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/28129b052bd5f81b849279f6752d2abf9e14416c/config/partner_fee_share.json" +EZKL_POOLS_URL = "https://raw.githubusercontent.com/BalancerMaxis/bal_addresses/e8c3a61d95158a01c139570fcb8943ebd110ee22/outputs/ezkl_pools.json" POOL_OVERRIDES_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/pool_incentives_overrides.json" SNAPSHOT_URL = "https://hub.snapshot.org/graphql?" HH_API_URL = "https://api.hiddenhand.finance/proposal" From f2b5708713da748f3f5eb807c0eff38daac07c59 Mon Sep 17 00:00:00 2001 From: jalbrekt85 Date: Mon, 3 Nov 2025 09:50:57 -0600 Subject: [PATCH 2/4] update config urls --- fee_allocator/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fee_allocator/constants.py b/fee_allocator/constants.py index a8db5c46..894b1489 100644 --- a/fee_allocator/constants.py +++ b/fee_allocator/constants.py @@ -1,7 +1,7 @@ FEE_CONSTANTS_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/protocol_fees_constants.json" ALLIANCE_CONFIG_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/alliance_fee_share.json" -PARTNER_CONFIG_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/28129b052bd5f81b849279f6752d2abf9e14416c/config/partner_fee_share.json" -EZKL_POOLS_URL = "https://raw.githubusercontent.com/BalancerMaxis/bal_addresses/e8c3a61d95158a01c139570fcb8943ebd110ee22/outputs/ezkl_pools.json" +PARTNER_CONFIG_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/partner_fee_share.json" +EZKL_POOLS_URL = "https://raw.githubusercontent.com/BalancerMaxis/bal_addresses/main/outputs/ezkl_pools.json" POOL_OVERRIDES_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/pool_incentives_overrides.json" SNAPSHOT_URL = "https://hub.snapshot.org/graphql?" HH_API_URL = "https://api.hiddenhand.finance/proposal" From d6841c6fdbf6e5a35ad411372a60c27ece217988 Mon Sep 17 00:00:00 2001 From: jalbrekt85 Date: Mon, 3 Nov 2025 11:29:11 -0600 Subject: [PATCH 3/4] use larger test fee amounts, improve chain coverage --- tests/conftest.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index da60412f..41effd66 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -44,11 +44,20 @@ def chain(run_config, web3): @pytest.fixture def allocator(fee_period): - input_fees = {"mainnet": Decimal("10000000.0"), "optimism": Decimal("10000.0")} + input_fees = { + "mainnet": Decimal("1000000"), + "arbitrum": Decimal("1000000"), + "polygon": Decimal("1000000"), + "optimism": Decimal("1000000"), + "base": Decimal("1000000"), + "gnosis": Decimal("1000000"), + "avalanche": Decimal("1000000"), + "plasma": Decimal("1000000"), + } return FeeAllocator( - input_fees, - fee_period, - cache_dir=Path("tests/cache"), + input_fees, + fee_period, + cache_dir=Path("tests/cache"), use_cache=True ) From fc1c8a449ee8f9ee0c9bf49e3be288662d2d221b Mon Sep 17 00:00:00 2001 From: jalbrekt85 Date: Wed, 5 Nov 2025 19:40:16 -0600 Subject: [PATCH 4/4] test fees --- .../fees_collected/v2_fees_2025-10-20_2025-11-03.json | 9 +++++++++ .../fees_collected/v3_fees_2025-10-20_2025-11-03.json | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 fee_allocator/fees_collected/v2_fees_2025-10-20_2025-11-03.json create mode 100644 fee_allocator/fees_collected/v3_fees_2025-10-20_2025-11-03.json diff --git a/fee_allocator/fees_collected/v2_fees_2025-10-20_2025-11-03.json b/fee_allocator/fees_collected/v2_fees_2025-10-20_2025-11-03.json new file mode 100644 index 00000000..7b0cdc89 --- /dev/null +++ b/fee_allocator/fees_collected/v2_fees_2025-10-20_2025-11-03.json @@ -0,0 +1,9 @@ +{ + "avalanche": 370149388, + "base": 4726164967, + "arbitrum": 24475711886, + "polygon": 12284347826, + "optimism": 2014172038, + "gnosis": 19296737423, + "mainnet": 190640914196 +} \ No newline at end of file diff --git a/fee_allocator/fees_collected/v3_fees_2025-10-20_2025-11-03.json b/fee_allocator/fees_collected/v3_fees_2025-10-20_2025-11-03.json new file mode 100644 index 00000000..0619529e --- /dev/null +++ b/fee_allocator/fees_collected/v3_fees_2025-10-20_2025-11-03.json @@ -0,0 +1,9 @@ +{ + "avalanche": 17037904970, + "base": 127943496102, + "gnosis": 4869862296, + "arbitrum": 8701144463, + "optimism": 528740192, + "plasma": 74462862951, + "mainnet": 33661436626 +} \ No newline at end of file