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: 9 additions & 3 deletions fee_allocator/accounting/chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
FEE_CONSTANTS_URL,
ALLIANCE_CONFIG_URL,
PARTNER_CONFIG_URL,
EZKL_POOLS_URL,
POOL_OVERRIDES_URL
)
from fee_allocator.accounting.decorators import round, require_pool_fee_data
Expand Down Expand Up @@ -69,6 +70,7 @@ def __init__(
self.fee_config = GlobalFeeConfig(**requests.get(FEE_CONSTANTS_URL).json())
self.alliance_config = AllianceConfig(**requests.get(ALLIANCE_CONFIG_URL).json())
self.partner_config = PartnerConfig(**requests.get(PARTNER_CONFIG_URL).json())
self.ezkl_pools = requests.get(EZKL_POOLS_URL).json()

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

Expand Down Expand Up @@ -288,8 +290,13 @@ def _fetch_partner_pools(self) -> Dict[str, Partner]:

if partner.pool_types:
for pool_type in partner.pool_types:
pool_ids = self.subgraph.fetch_pools_by_type(pool_type)
logger.info(f"Found {len(pool_ids)} {pool_type} pools for {partner.name} on {self.name}")
if pool_type == "EZKL":
chain_ezkl_data = self.chains.ezkl_pools.get(self.name, {})
pool_ids = chain_ezkl_data.get(self.chains.protocol_version, [])
logger.info(f"Found {len(pool_ids)} EZKL {self.chains.protocol_version} pools for {partner.name} on {self.name}")
else:
pool_ids = self.subgraph.fetch_pools_by_type(pool_type)
logger.info(f"Found {len(pool_ids)} {pool_type} pools for {partner.name} on {self.name}")

for pool_id in pool_ids:
# Skip if already added from explicit list
Expand Down Expand Up @@ -319,7 +326,6 @@ def _get_pool_category(self, has_gauge: bool, is_core: bool) -> Optional[str]:
elif not is_core and not has_gauge:
return "non_core_without_gauge"
elif is_core and not has_gauge:
logger.error("Invalid state: Core pool must have gauge")
return None
return None

Expand Down
1 change: 1 addition & 0 deletions fee_allocator/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FEE_CONSTANTS_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/protocol_fees_constants.json"
ALLIANCE_CONFIG_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/alliance_fee_share.json"
PARTNER_CONFIG_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/partner_fee_share.json"
EZKL_POOLS_URL = "https://raw.githubusercontent.com/BalancerMaxis/bal_addresses/main/outputs/ezkl_pools.json"
POOL_OVERRIDES_URL = "https://raw.githubusercontent.com/BalancerMaxis/multisig-ops/main/config/pool_incentives_overrides.json"
SNAPSHOT_URL = "https://hub.snapshot.org/graphql?"
HH_API_URL = "https://api.hiddenhand.finance/proposal"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"avalanche": 370149388,
"base": 4726164967,
"arbitrum": 24475711886,
"polygon": 12284347826,
"optimism": 2014172038,
"gnosis": 19296737423,
"mainnet": 190640914196
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"avalanche": 17037904970,
"base": 127943496102,
"gnosis": 4869862296,
"arbitrum": 8701144463,
"optimism": 528740192,
"plasma": 74462862951,
"mainnet": 33661436626
}
17 changes: 13 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,20 @@ def chain(run_config, web3):

@pytest.fixture
def allocator(fee_period):
input_fees = {"mainnet": Decimal("10000000.0"), "optimism": Decimal("10000.0")}
input_fees = {
"mainnet": Decimal("1000000"),
"arbitrum": Decimal("1000000"),
"polygon": Decimal("1000000"),
"optimism": Decimal("1000000"),
"base": Decimal("1000000"),
"gnosis": Decimal("1000000"),
"avalanche": Decimal("1000000"),
"plasma": Decimal("1000000"),
}

return FeeAllocator(
input_fees,
fee_period,
cache_dir=Path("tests/cache"),
input_fees,
fee_period,
cache_dir=Path("tests/cache"),
use_cache=True
)