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

Commit 878e8c2

Browse files
committed
add csv output for noncore allocation
1 parent 8d5c751 commit 878e8c2

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

fee_allocator/fee_allocator.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,35 @@ def generate_incentives_csv(
275275

276276
return output_path
277277

278+
def generate_noncore_csv(
279+
self, output_path: Path = Path("fee_allocator/allocations/noncore")
280+
) -> Path:
281+
logger.info("generating noncore fee allocation csv")
282+
output = []
283+
284+
for chain in self.run_config.all_chains:
285+
output.append({
286+
"chain": chain.name,
287+
"total_fees_collected": round(chain.fees_collected, 4),
288+
"core_pool_fees": round(chain.total_earned_fees_usd_twap, 4),
289+
"noncore_fees": round(chain.noncore_fees_collected, 4),
290+
"noncore_to_dao": round(chain.noncore_to_dao_usd, 4),
291+
"noncore_to_vebal": round(chain.noncore_to_vebal_usd, 4),
292+
"dao_share_pct": round(self.run_config.fee_config.noncore_dao_share_pct * 100, 2),
293+
"vebal_share_pct": round(self.run_config.fee_config.noncore_vebal_share_pct * 100, 2)
294+
})
295+
296+
df = pd.DataFrame(output)
297+
start_date = datetime.datetime.fromtimestamp(self.date_range[0]).date()
298+
end_date = datetime.datetime.fromtimestamp(self.date_range[1]).date()
299+
output_path = (
300+
PROJECT_ROOT / output_path / f"{self.run_config.protocol_version}_noncore_{start_date}_{end_date}.csv"
301+
)
302+
output_path.parent.mkdir(exist_ok=True)
303+
304+
df.to_csv(output_path, index=False)
305+
return output_path
306+
278307
def generate_bribe_payload(
279308
self,
280309
input_csv: str,

main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def main() -> None:
5151
fee_allocator.generate_incentives_csv()
5252
file_name = fee_allocator.generate_bribe_csv()
5353
fee_allocator.generate_bribe_payload(file_name)
54+
fee_allocator.generate_noncore_csv()
5455

5556

5657
if __name__ == "__main__":

0 commit comments

Comments
 (0)