1515from fee_allocator .accounting import PROJECT_ROOT
1616from fee_allocator .logger import logger
1717from fee_allocator .payload_visualizer import save_markdown_report
18- from fee_allocator .bribe_platforms import BribePlatformFactory , PaladinPlatform
18+ from fee_allocator .bribe_platforms import get_platform
1919
2020load_dotenv ()
2121
@@ -129,9 +129,7 @@ def generate_artifacts(self, include_bal_transfer: bool = True) -> Dict[str, Pat
129129 Generates all fee allocation artifacts (CSVs and payload).
130130 """
131131 logger .info ("generating fee allocation artifacts" )
132-
133- self ._check_paladin_gauge_requirements ()
134-
132+
135133 incentives_path = self .generate_incentives_csv ()
136134 bribe_path = self .generate_bribe_csv ()
137135 alliance_path = self .generate_alliance_csv ()
@@ -304,22 +302,23 @@ def generate_bribe_csv(
304302 if not core_pool .gauge_address :
305303 logger .warning (f"Pool { core_pool .pool_id } has no gauge address" )
306304
307- platform = BribePlatformFactory .get_platform (core_pool .market_override , self .book , self .run_config )
305+ bal_platform = core_pool .market_override or self .run_config .fee_config .bal_bribe_platform
306+ aura_platform = core_pool .market_override or self .run_config .fee_config .aura_bribe_platform
308307
309308 output .append (
310309 {
311310 "target" : core_pool .gauge_address ,
312311 "platform" : "balancer" ,
313312 "amount" : round (core_pool .to_bal_incentives_usd , 4 ),
314- "bribe_platform" : platform . get_platform_for_market ( "balancer" , core_pool . voting_pool_override ) ,
313+ "bribe_platform" : bal_platform ,
315314 },
316315 )
317316 output .append (
318317 {
319318 "target" : core_pool .gauge_address ,
320319 "platform" : "aura" ,
321320 "amount" : round (core_pool .to_aura_incentives_usd , 4 ),
322- "bribe_platform" : platform . get_platform_for_market ( "aura" , core_pool . voting_pool_override ) ,
321+ "bribe_platform" : aura_platform ,
323322 },
324323 )
325324
@@ -551,17 +550,8 @@ def generate_bribe_payload(
551550 beets_fee_usdc = round (beets_df ["amount" ] * 1e6 ) - 1000 # round down 0.1 cent
552551
553552 for platform_name , platform_bribes in platform_groups .items ():
554- try :
555- platform = BribePlatformFactory .get_platform (
556- platform_name ,
557- self .book ,
558- self .run_config
559- )
560-
561- platform .process_bribes (platform_bribes , builder , usdc )
562- except NotImplementedError as e :
563- logger .warning (f"Platform { platform_name } not yet implemented: { e } " )
564- continue
553+ platform = get_platform (platform_name , self .book , self .run_config )
554+ platform .process_bribes (platform_bribes , builder , usdc )
565555
566556 usdc .transfer (payment_df ["target" ], dao_fee_usdc )
567557 usdc .transfer (beets_df ["target" ], beets_fee_usdc )
@@ -615,34 +605,6 @@ def generate_bribe_payload(
615605 builder .output_payload (output_path )
616606
617607 return output_path
618-
619- def _check_paladin_gauge_requirements (self ):
620- """Check Paladin gauges for requirements and log issues"""
621- paladin = PaladinPlatform (self .book , self .run_config )
622- gauges_with_issues = []
623-
624- for chain in self .run_config .all_chains :
625- for pool in chain .core_pools :
626- if pool .market_override != "paladin" :
627- continue
628-
629- is_valid , error_msg = paladin .validate_gauge_requirements (pool .gauge_address )
630-
631- if not is_valid :
632- pool .market_override = "hh"
633- logger .warning (f"Paladin gauge { pool .gauge_address } missing requirements, falling back to HiddenHand: { error_msg } " )
634- gauges_with_issues .append ({
635- "gauge" : pool .gauge_address ,
636- "pool_id" : pool .pool_id ,
637- "chain" : chain .name ,
638- "action" : error_msg ,
639- "amount" : float (pool .total_to_incentives_usd )
640- })
641-
642- if gauges_with_issues :
643- issues_file = base_dir / "allocations" / f"{ self .run_config .protocol_version } _paladin_gauge_status_{ self .start_date } _{ self .end_date } .json"
644- with open (issues_file , "w" ) as f :
645- json .dump (gauges_with_issues , f , indent = 2 )
646608
647609 def recon (self ) -> None :
648610 """
@@ -773,4 +735,4 @@ def generate_report(self, payload_path: Path, fee_files: List[Path] = None) -> P
773735 if not gauge_issues_path .exists ():
774736 gauge_issues_path = None
775737
776- return save_markdown_report (payload_path , fee_files , output_path = report_path , gauge_issues_path = gauge_issues_path )
738+ return save_markdown_report (payload_path , fee_files , output_path = report_path , gauge_issues_path = gauge_issues_path )
0 commit comments