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

Commit 819f696

Browse files
committed
make v2 and v3 fee inputs dinstict
1 parent f1f9f5c commit 819f696

5 files changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/trigger_fee_collection.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
echo "JSON Path: $JSON_PATH"
4343
4444
# Extract the end date from filename using cut
45-
END_DATE=$(basename "$JSON_PATH" | cut -d'_' -f3 | cut -d'.' -f1)
45+
END_DATE=$(basename "$JSON_PATH" | cut -d'_' -f4 | cut -d'.' -f1)
4646
4747
echo "end-date=$END_DATE" >> $GITHUB_OUTPUT
4848

combine_payloads.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66

77
def combine_payloads(fees_file_name: str) -> None:
8-
# Extract the end date from the fees file name (fees_START-DATE_END-DATE.json)
9-
date_str = fees_file_name.split('_')[2].split('.')[0]
8+
date_str = fees_file_name.split('_')[3].split('.')[0]
109

1110
payload_dir = Path("fee_allocator/payloads")
1211

fee_allocator/fees_collected/get_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def get_report(start_date, end_date):
4545

4646
report = get_report(yesterday.strftime("%Y-%m-%d"), today.strftime("%Y-%m-%d"))
4747
with open(
48-
f"fee_allocator/fees_collected/fees_{epoch_start.strftime('%Y-%m-%d')}_{today.strftime('%Y-%m-%d')}.json",
48+
f"fee_allocator/fees_collected/v2_fees_{epoch_start.strftime('%Y-%m-%d')}_{today.strftime('%Y-%m-%d')}.json",
4949
"w",
5050
) as f:
5151
json.dump(report, f, indent=2)

fee_allocator/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ def get_block_by_ts(timestamp, chain: "CorePoolChain", before=False):
9898
else:
9999
return chain.subgraph.get_first_block_after_utc_timestamp(timestamp)
100100

101-
def fetch_collected_fees(start_date: str, end_date: str, fees_file_name: str = None) -> dict:
101+
def fetch_collected_fees(start_date: str, end_date: str, fees_file_name: str = None, protocol_version: str = "v2") -> dict:
102102
# If fees_file_name is provided, use that directly
103103
if fees_file_name:
104104
filename = fees_file_name
105105
else:
106-
filename = f"fees_{start_date}_{end_date}.json"
106+
filename = f"{protocol_version}_fees_{start_date}_{end_date}.json"
107107

108108
local_path = f"fee_allocator/fees_collected/{filename}"
109109
if os.path.exists(local_path):

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def main() -> None:
4040
start_date = datetime.fromtimestamp(ts_in_the_past, tz=pytz.UTC).strftime("%Y-%m-%d")
4141
end_date = datetime.fromtimestamp(ts_now, tz=pytz.UTC).strftime("%Y-%m-%d")
4242

43-
input_fees = fetch_collected_fees(start_date, end_date, args.fees_file_name)
43+
input_fees = fetch_collected_fees(start_date, end_date, args.fees_file_name, args.protocol_version)
4444
date_range = (ts_in_the_past, ts_now)
4545

4646
fee_allocator = FeeAllocator(input_fees, date_range, protocol_version=args.protocol_version)

0 commit comments

Comments
 (0)