From 792ee5b9f81127eed3cde041ca5d86e0625795de Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Thu, 15 Jan 2026 18:03:25 +0700 Subject: [PATCH] fix: bring back aura vebal share calc --- fee_allocator/accounting/chains.py | 10 ++++++++++ fee_allocator/fee_allocator.py | 15 ++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/fee_allocator/accounting/chains.py b/fee_allocator/accounting/chains.py index 5637f99..adb97c8 100644 --- a/fee_allocator/accounting/chains.py +++ b/fee_allocator/accounting/chains.py @@ -83,6 +83,7 @@ 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 @@ -116,6 +117,15 @@ 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 diff --git a/fee_allocator/fee_allocator.py b/fee_allocator/fee_allocator.py index b0247fc..77da265 100644 --- a/fee_allocator/fee_allocator.py +++ b/fee_allocator/fee_allocator.py @@ -70,6 +70,7 @@ def allocate(self, redistribute=True): Non-core pools: 82.5% veBAL, 17.5% DAO """ self.run_config.set_core_pool_chains_data() + self.run_config.set_aura_vebal_share() self.run_config.set_initial_pool_allocation() if redistribute: self.redistribute_fees() @@ -79,11 +80,13 @@ def redistribute_fees(self): Redistributes fees among pools based on minimum incentive amounts. Pools with total incentives below the minimum threshold get their incentives - redistributed to eligible pools above the threshold. - + redistributed to eligible pools above the threshold. The threshold is scaled + by Aura's veBAL share to ensure the effective Aura incentive meets the minimum. """ - min_amount = self.run_config.fee_config.min_aura_incentive - logger.info(f"Redistribution threshold: ${min_amount}") + min_aura = Decimal(self.run_config.fee_config.min_aura_incentive) + aura_share = self.run_config.aura_vebal_share + min_amount = min_aura / aura_share + logger.info(f"Redistribution threshold: ${min_amount:.0f} (${min_aura:.0f} min Aura / {aura_share:.2%} veBAL share)") for chain in self.run_config.all_chains: pools_to_redistribute = [p for p in chain.core_pools if p.total_to_incentives_usd < min_amount] @@ -514,7 +517,9 @@ def recon(self) -> None: "createdAt": int(datetime.datetime.now().timestamp()), "periodStart": self.date_range[0], "periodEnd": self.date_range[1], - "bribeThreshold": self.run_config.fee_config.min_aura_incentive + "minAuraIncentive": self.run_config.fee_config.min_aura_incentive, + "auraVebalShare": float(round(self.run_config.aura_vebal_share, 4)), + "bribeThreshold": int(self.run_config.fee_config.min_aura_incentive / self.run_config.aura_vebal_share) } recon_file = Path(PROJECT_ROOT) / "fee_allocator/summaries" / f"{self.run_config.protocol_version}_recon.json"