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

Commit 8445453

Browse files
Merge branch 'biweekly-runs' into dependabot/pip/joblib-1.5.3
2 parents aa1d15a + b5ec5d6 commit 8445453

17 files changed

Lines changed: 185 additions & 984 deletions

fee_allocator/accounting/chains.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def __init__(
7373
self.ezkl_pools = requests.get(EZKL_POOLS_URL).json()
7474

7575
pool_overrides_raw = requests.get(POOL_OVERRIDES_URL).json()
76-
7776
self.pool_overrides: Dict[str, PoolOverride] = {
7877
pool_id: PoolOverride(**override_data)
7978
for pool_id, override_data in pool_overrides_raw.items()
@@ -84,7 +83,6 @@ def __init__(
8483
self.cache_dir.mkdir(exist_ok=True)
8584

8685
self._chains: Union[dict[str, CorePoolChain], None] = None
87-
self.aura_vebal_share: Union[Decimal, None] = None
8886
self.protocol_version = protocol_version
8987

9088

@@ -118,16 +116,6 @@ def set_core_pool_chains_data(self):
118116

119117
self._chains = _chains
120118

121-
def set_aura_vebal_share(self):
122-
if not self.mainnet:
123-
raise ValueError(
124-
"mainnet must be initialized to calculate aura vebal share"
125-
)
126-
127-
self.aura_vebal_share = self.mainnet.subgraph.calculate_aura_vebal_share(
128-
self.mainnet.web3, self.mainnet.block_range[1]
129-
)
130-
131119
def set_initial_pool_allocation(self) -> None:
132120
"""
133121
sets the intial fee allocation for all pools for all chains

fee_allocator/accounting/core_pools.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ def __init__(self, data: PoolFeeData, chain: CorePoolChain):
100100
self.original_earned_fee_share = Decimal(0)
101101
self.earned_fee_share_of_chain_usd = self._earned_fee_share_of_chain_usd()
102102
self.total_to_incentives_usd = self._total_to_incentives_usd()
103-
self.to_aura_incentives_usd = self._to_aura_incentives_usd()
104-
self.to_bal_incentives_usd = self._to_bal_incentives_usd()
105103
self.to_dao_usd = self._to_dao_usd()
106104
self.to_vebal_usd = self._to_vebal_usd()
107105
self.to_partner_usd = self._to_partner_usd()
@@ -166,29 +164,6 @@ def _total_to_incentives_usd(self) -> Decimal:
166164
to_distribute_to_incentives = core_fees * vote_incentive_pct
167165
return self.earned_fee_share_of_chain_usd * to_distribute_to_incentives
168166

169-
def _calculate_incentive_split(self, platform: str) -> Decimal:
170-
# Alliance core pools get 100% to AURA
171-
if self.is_alliance_core_pool:
172-
return self.total_to_incentives_usd if platform == "aura" else Decimal(0)
173-
174-
if self.voting_pool_override == "split" or self.voting_pool_override is None:
175-
aura_share = self.chain.chains.aura_vebal_share
176-
return self.total_to_incentives_usd * (aura_share if platform == "aura" else (1 - aura_share))
177-
178-
if self.voting_pool_override == platform:
179-
return self.total_to_incentives_usd
180-
elif self.voting_pool_override and self.voting_pool_override != platform:
181-
return Decimal(0)
182-
183-
aura_share = self.chain.chains.aura_vebal_share
184-
return self.total_to_incentives_usd * (aura_share if platform == "aura" else (1 - aura_share))
185-
186-
def _to_aura_incentives_usd(self) -> Decimal:
187-
return self._calculate_incentive_split("aura")
188-
189-
def _to_bal_incentives_usd(self) -> Decimal:
190-
return self._calculate_incentive_split("bal")
191-
192167
def _to_dao_usd(self) -> Decimal:
193168
core_fees = self._core_pool_allocation()
194169
beets_factor = self.chain.get_beets_factor()

fee_allocator/accounting/models.py

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,33 @@
22
from decimal import Decimal
33
from typing import Dict, NewType, Optional
44

5-
from bal_tools.ecosystem import HiddenHand
5+
from bal_tools import StakeDAO
66

77

88
Pools = Dict[NewType("PoolId", str), NewType("Symbol", str)]
99
InputFees = Dict[NewType("CorePoolChainName", str), NewType("FeesCollected", int)]
1010

1111

1212
class PoolOverride(BaseModel):
13-
"""
14-
Represents pool-specific overrides for voting pool allocation and bribe platform.
15-
"""
16-
voting_pool_override: Optional[str] = None # "bal", "aura", or "split"
17-
market_override: Optional[str] = None # "stakedao" or "paladin" to override default routing
13+
voting_pool_override: Optional[str] = None
14+
market_override: Optional[str] = None
1815

1916

2017
class GlobalFeeConfig(BaseModel):
21-
"""
22-
Represents the global fee configuration for the fee allocation process.
23-
Models the data sourced from the FEE_CONSTANTS_URL endpoint.
24-
"""
25-
26-
min_aura_incentive: int
27-
min_existing_aura_incentive: int
28-
min_vote_incentive_amount: int
18+
min_aura_incentive: int = 0
2919

30-
# Core pool fee splits
3120
vebal_share_pct: Decimal
3221
dao_share_pct: Decimal
3322
vote_incentive_pct: Decimal
3423

35-
# Non-core pool fee splits
3624
noncore_vebal_share_pct: Decimal
3725
noncore_dao_share_pct: Decimal
3826

39-
# Beets fee split (https://forum.balancer.fi/t/bip-800-deploy-balancer-v3-on-op-mainnet)
4027
beets_share_pct: Decimal
4128

42-
# Default bribe platforms (can be overridden per-pool via market_override)
43-
bal_bribe_platform: str = "hh"
44-
aura_bribe_platform: str = "hh"
45-
4629
@model_validator(mode="after")
4730
def set_dynamic_min_aura_incentive(self):
48-
self.min_aura_incentive = int(HiddenHand().get_min_aura_incentive())
31+
self.min_aura_incentive = StakeDAO().calculate_dynamic_min_incentive()
4932
return self
5033

5134

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
from .base import BribePlatform
2-
from .factory import get_platform
3-
from .hiddenhand import HiddenHandPlatform
4-
from .paladin import PaladinPlatform
52
from .stakedao import StakeDAOPlatform
63

74
__all__ = [
85
"BribePlatform",
9-
"get_platform",
10-
"HiddenHandPlatform",
11-
"PaladinPlatform",
126
"StakeDAOPlatform",
137
]
Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from abc import ABC, abstractmethod
2-
from typing import Dict, Optional, Tuple, Any, List
2+
from typing import Dict, Optional, Tuple, Any
33
import pandas as pd
44

55

@@ -16,24 +16,12 @@ def process_bribes(self, bribes_df: pd.DataFrame, builder: Any, usdc: Any) -> No
1616
Process bribes for this platform
1717
1818
Args:
19-
bribes_df: DataFrame with columns [target, platform, amount, bribe_platform]
19+
bribes_df: DataFrame with columns [target, amount, is_alliance]
2020
builder: SafeTxBuilder instance for building transactions
2121
usdc: SafeContract instance for USDC token
2222
"""
2323
pass
2424

25-
def get_total_approval_amount(self, bribes_df: pd.DataFrame) -> int:
26-
"""
27-
Calculate total USDC amount that needs approval for this platform
28-
29-
Args:
30-
bribes_df: DataFrame with bribe information
31-
32-
Returns:
33-
Total amount in USDC wei that needs approval
34-
"""
35-
return 0
36-
3725
@abstractmethod
3826
def validate_gauge_requirements(self, gauge_address: str) -> Tuple[bool, Optional[str]]:
3927
"""
@@ -50,26 +38,5 @@ def validate_gauge_requirements(self, gauge_address: str) -> Tuple[bool, Optiona
5038
@property
5139
@abstractmethod
5240
def platform_name(self) -> str:
53-
"""Return platform identifier for CSV/reporting"""
41+
"""Return platform identifier for reporting"""
5442
pass
55-
56-
@property
57-
@abstractmethod
58-
def supported_markets(self) -> List[str]:
59-
"""Return list of supported markets (e.g., ['aura', 'balancer'])"""
60-
pass
61-
62-
@abstractmethod
63-
def get_platform_for_market(self, market: str, voting_pool_override: Optional[str]) -> str:
64-
"""
65-
Get the platform name to use for a specific market.
66-
This handles platform-specific routing logic.
67-
68-
Args:
69-
market: The market ('aura' or 'balancer')
70-
voting_pool_override: The voting pool override setting
71-
72-
Returns:
73-
Platform name to use for this market (e.g., 'hh', 'paladin', 'stakedao')
74-
"""
75-
pass

fee_allocator/bribe_platforms/factory.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

fee_allocator/bribe_platforms/hiddenhand.py

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)