Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

Commit 4796d48

Browse files
authored
Merge pull request #250 from BalancerMaxis/enforce-bribe-minimums
enforce bribe threshold edge case with no qualifying core pools
2 parents 022cce2 + 093836d commit 4796d48

4 files changed

Lines changed: 19 additions & 16 deletions

File tree

fee_allocator/fee_allocator.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ def redistribute_fees(self):
9393
pools_to_receive = [p for p in chain.core_pools if p.total_to_incentives_usd >= min_amount]
9494

9595
if not pools_to_receive:
96+
# no qualifying pools for chain, send to dao/vebal
97+
for pool in pools_to_redistribute:
98+
amount = pool.total_to_incentives_usd
99+
pool.to_dao_usd += amount * self.run_config.fee_config.noncore_dao_share_pct
100+
pool.to_vebal_usd += amount * self.run_config.fee_config.noncore_vebal_share_pct
101+
pool.redirected_incentives_usd -= amount
102+
pool.to_aura_incentives_usd = Decimal(0)
103+
pool.to_bal_incentives_usd = Decimal(0)
104+
pool.total_to_incentives_usd = Decimal(0)
96105
continue
97106

98107
total_fees_to_redistribute = sum(p.total_to_incentives_usd for p in pools_to_redistribute)

multisig-ops

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 5f170f855edd45a12bd5906353662c35f3c853db

tests/conftest.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,9 @@ def chain(run_config, web3):
4545
@pytest.fixture
4646
def allocator(fee_period):
4747
input_fees = {
48-
"mainnet": Decimal("1000000"),
49-
"arbitrum": Decimal("1000000"),
50-
"polygon": Decimal("1000000"),
51-
"optimism": Decimal("1000000"),
52-
"base": Decimal("1000000"),
53-
"gnosis": Decimal("1000000"),
54-
"avalanche": Decimal("1000000"),
55-
"plasma": Decimal("1000000"),
48+
"mainnet": Decimal("100000"),
49+
"arbitrum": Decimal("100000"),
50+
"base": Decimal("100000"),
5651
}
5752

5853
return FeeAllocator(

tests/test_allocator.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,10 @@ def test_overall_dao_vebal_allocation(allocated_allocator: FeeAllocator):
101101
def test_core_pool_allocation(allocated_allocator: FeeAllocator):
102102
"""Test that standard core pool allocations match configured percentages"""
103103
fee_config = allocated_allocator.run_config.fee_config
104-
105104
total_core_fees = Decimal(0)
106105
total_core_dao = Decimal(0)
107106
total_core_vebal = Decimal(0)
108107
total_core_incentives = Decimal(0)
109-
110108
for chain in allocated_allocator.run_config.all_chains:
111109
for pool in chain.core_pools:
112110
# Only include standard core pools
@@ -122,12 +120,12 @@ def test_core_pool_allocation(allocated_allocator: FeeAllocator):
122120
core_vebal_pct = total_core_vebal / total_core_allocations
123121
core_incentives_pct = total_core_incentives / total_core_allocations
124122

125-
assert abs(core_dao_pct - fee_config.dao_share_pct) <= Decimal('0.02'), \
126-
f"Core pool DAO {core_dao_pct:.4f} not within 2% of target {fee_config.dao_share_pct}"
127-
assert abs(core_vebal_pct - fee_config.vebal_share_pct) <= Decimal('0.02'), \
128-
f"Core pool veBAL {core_vebal_pct:.4f} not within 2% of target {fee_config.vebal_share_pct}"
129-
assert abs(core_incentives_pct - fee_config.vote_incentive_pct) <= Decimal('0.03'), \
130-
f"Core pool incentives {core_incentives_pct:.4f} not within 2% of target {fee_config.vote_incentive_pct}"
123+
assert abs(core_dao_pct - fee_config.dao_share_pct) <= Decimal('0.04'), \
124+
f"Core pool DAO {core_dao_pct:.4f} not within 4% of target {fee_config.dao_share_pct}"
125+
assert abs(core_vebal_pct - fee_config.vebal_share_pct) <= Decimal('0.15'), \
126+
f"Core pool veBAL {core_vebal_pct:.4f} not within 15% of target {fee_config.vebal_share_pct}"
127+
assert abs(core_incentives_pct - fee_config.vote_incentive_pct) <= Decimal('0.20'), \
128+
f"Core pool incentives {core_incentives_pct:.4f} not within 20% of target {fee_config.vote_incentive_pct}"
131129

132130

133131
def test_noncore_allocation(allocated_allocator: FeeAllocator):

0 commit comments

Comments
 (0)