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

Commit 9ff2300

Browse files
authored
Merge pull request #280 from BalancerMaxis/fix/deterministic-bribe-threshold
use end_block for bribe threshold
2 parents 51216de + 6cbc5b2 commit 9ff2300

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

fee_allocator/accounting/chains.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from web3 import Web3
99
import requests
10-
from bal_tools import Subgraph, BalPoolsGauges, Web3RpcByChain
10+
from bal_tools import Subgraph, BalPoolsGauges, Web3RpcByChain, StakeDAO
1111
import joblib
1212
from bal_tools.subgraph import DateRange
1313
from bal_tools.models import PoolSnapshot, Pool
@@ -115,6 +115,14 @@ def set_core_pool_chains_data(self):
115115
_chains[chain_name] = chain
116116

117117
self._chains = _chains
118+
self._set_bribe_threshold()
119+
120+
def _set_bribe_threshold(self) -> None:
121+
end_block = self._chains["mainnet"].block_range[1]
122+
self.fee_config.min_total_bribe_threshold = StakeDAO().calculate_dynamic_min_incentive(
123+
block_number=end_block
124+
)
125+
logger.info(f"min_total_bribe_threshold: ${self.fee_config.min_total_bribe_threshold} (block {end_block})")
118126

119127
def set_initial_pool_allocation(self) -> None:
120128
"""

fee_allocator/accounting/models.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
from pydantic import BaseModel, model_validator, validator
1+
from pydantic import BaseModel, validator
22
from decimal import Decimal
33
from typing import Dict, NewType, Optional
44

5-
from bal_tools import StakeDAO
6-
75

86
Pools = Dict[NewType("PoolId", str), NewType("Symbol", str)]
97
InputFees = Dict[NewType("CorePoolChainName", str), NewType("FeesCollected", int)]
@@ -26,11 +24,6 @@ class GlobalFeeConfig(BaseModel):
2624

2725
beets_share_pct: Decimal
2826

29-
@model_validator(mode="after")
30-
def set_dynamic_min_total_bribe_threshold(self):
31-
self.min_total_bribe_threshold = StakeDAO().calculate_dynamic_min_incentive()
32-
return self
33-
3427

3528
class AlliancePool(BaseModel):
3629
"""

multisig-ops

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)