Skip to content
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
12 changes: 0 additions & 12 deletions fee_allocator/accounting/chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def __init__(
self.ezkl_pools = requests.get(EZKL_POOLS_URL).json()

pool_overrides_raw = requests.get(POOL_OVERRIDES_URL).json()

self.pool_overrides: Dict[str, PoolOverride] = {
pool_id: PoolOverride(**override_data)
for pool_id, override_data in pool_overrides_raw.items()
Expand All @@ -84,7 +83,6 @@ def __init__(
self.cache_dir.mkdir(exist_ok=True)

self._chains: Union[dict[str, CorePoolChain], None] = None
self.aura_vebal_share: Union[Decimal, None] = None
self.protocol_version = protocol_version


Expand Down Expand Up @@ -118,16 +116,6 @@ def set_core_pool_chains_data(self):

self._chains = _chains

def set_aura_vebal_share(self):
if not self.mainnet:
raise ValueError(
"mainnet must be initialized to calculate aura vebal share"
)

self.aura_vebal_share = self.mainnet.subgraph.calculate_aura_vebal_share(
self.mainnet.web3, self.mainnet.block_range[1]
)

def set_initial_pool_allocation(self) -> None:
"""
sets the intial fee allocation for all pools for all chains
Expand Down
25 changes: 0 additions & 25 deletions fee_allocator/accounting/core_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ def __init__(self, data: PoolFeeData, chain: CorePoolChain):
self.original_earned_fee_share = Decimal(0)
self.earned_fee_share_of_chain_usd = self._earned_fee_share_of_chain_usd()
self.total_to_incentives_usd = self._total_to_incentives_usd()
self.to_aura_incentives_usd = self._to_aura_incentives_usd()
self.to_bal_incentives_usd = self._to_bal_incentives_usd()
self.to_dao_usd = self._to_dao_usd()
self.to_vebal_usd = self._to_vebal_usd()
self.to_partner_usd = self._to_partner_usd()
Expand Down Expand Up @@ -166,29 +164,6 @@ def _total_to_incentives_usd(self) -> Decimal:
to_distribute_to_incentives = core_fees * vote_incentive_pct
return self.earned_fee_share_of_chain_usd * to_distribute_to_incentives

def _calculate_incentive_split(self, platform: str) -> Decimal:
# Alliance core pools get 100% to AURA
if self.is_alliance_core_pool:
return self.total_to_incentives_usd if platform == "aura" else Decimal(0)

if self.voting_pool_override == "split" or self.voting_pool_override is None:
aura_share = self.chain.chains.aura_vebal_share
return self.total_to_incentives_usd * (aura_share if platform == "aura" else (1 - aura_share))

if self.voting_pool_override == platform:
return self.total_to_incentives_usd
elif self.voting_pool_override and self.voting_pool_override != platform:
return Decimal(0)

aura_share = self.chain.chains.aura_vebal_share
return self.total_to_incentives_usd * (aura_share if platform == "aura" else (1 - aura_share))

def _to_aura_incentives_usd(self) -> Decimal:
return self._calculate_incentive_split("aura")

def _to_bal_incentives_usd(self) -> Decimal:
return self._calculate_incentive_split("bal")

def _to_dao_usd(self) -> Decimal:
core_fees = self._core_pool_allocation()
beets_factor = self.chain.get_beets_factor()
Expand Down
27 changes: 5 additions & 22 deletions fee_allocator/accounting/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,33 @@
from decimal import Decimal
from typing import Dict, NewType, Optional

from bal_tools.ecosystem import HiddenHand
from bal_tools import StakeDAO


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


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


class GlobalFeeConfig(BaseModel):
"""
Represents the global fee configuration for the fee allocation process.
Models the data sourced from the FEE_CONSTANTS_URL endpoint.
"""

min_aura_incentive: int
min_existing_aura_incentive: int
min_vote_incentive_amount: int
min_aura_incentive: int = 0

# Core pool fee splits
vebal_share_pct: Decimal
dao_share_pct: Decimal
vote_incentive_pct: Decimal

# Non-core pool fee splits
noncore_vebal_share_pct: Decimal
noncore_dao_share_pct: Decimal

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

# Default bribe platforms (can be overridden per-pool via market_override)
bal_bribe_platform: str = "hh"
aura_bribe_platform: str = "hh"

@model_validator(mode="after")
def set_dynamic_min_aura_incentive(self):
self.min_aura_incentive = int(HiddenHand().get_min_aura_incentive())
self.min_aura_incentive = StakeDAO().calculate_dynamic_min_incentive()
return self


Expand Down
6 changes: 0 additions & 6 deletions fee_allocator/bribe_platforms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
from .base import BribePlatform
from .factory import get_platform
from .hiddenhand import HiddenHandPlatform
from .paladin import PaladinPlatform
from .stakedao import StakeDAOPlatform

__all__ = [
"BribePlatform",
"get_platform",
"HiddenHandPlatform",
"PaladinPlatform",
"StakeDAOPlatform",
]
39 changes: 3 additions & 36 deletions fee_allocator/bribe_platforms/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
from typing import Dict, Optional, Tuple, Any, List
from typing import Dict, Optional, Tuple, Any
import pandas as pd


Expand All @@ -16,24 +16,12 @@ def process_bribes(self, bribes_df: pd.DataFrame, builder: Any, usdc: Any) -> No
Process bribes for this platform

Args:
bribes_df: DataFrame with columns [target, platform, amount, bribe_platform]
bribes_df: DataFrame with columns [target, amount, is_alliance]
builder: SafeTxBuilder instance for building transactions
usdc: SafeContract instance for USDC token
"""
pass

def get_total_approval_amount(self, bribes_df: pd.DataFrame) -> int:
"""
Calculate total USDC amount that needs approval for this platform

Args:
bribes_df: DataFrame with bribe information

Returns:
Total amount in USDC wei that needs approval
"""
return 0

@abstractmethod
def validate_gauge_requirements(self, gauge_address: str) -> Tuple[bool, Optional[str]]:
"""
Expand All @@ -50,26 +38,5 @@ def validate_gauge_requirements(self, gauge_address: str) -> Tuple[bool, Optiona
@property
@abstractmethod
def platform_name(self) -> str:
"""Return platform identifier for CSV/reporting"""
"""Return platform identifier for reporting"""
pass

@property
@abstractmethod
def supported_markets(self) -> List[str]:
"""Return list of supported markets (e.g., ['aura', 'balancer'])"""
pass

@abstractmethod
def get_platform_for_market(self, market: str, voting_pool_override: Optional[str]) -> str:
"""
Get the platform name to use for a specific market.
This handles platform-specific routing logic.

Args:
market: The market ('aura' or 'balancer')
voting_pool_override: The voting pool override setting

Returns:
Platform name to use for this market (e.g., 'hh', 'paladin', 'stakedao')
"""
pass
26 changes: 0 additions & 26 deletions fee_allocator/bribe_platforms/factory.py

This file was deleted.

94 changes: 0 additions & 94 deletions fee_allocator/bribe_platforms/hiddenhand.py

This file was deleted.

Loading
Loading