44 workflow_dispatch :
55 inputs :
66 manual_date :
7- description : ' End date to process (YYYYMMDD format)'
7+ description : " End date to process (YYYYMMDD format)"
88 required : true
99 type : string
1010 push :
1111 branches :
12- - test-workflow
12+ - biweekly-runs
1313 paths :
14- - ' fee_allocator/fees_collected/*.json'
14+ - " fee_allocator/fees_collected/*.json"
1515
1616jobs :
17- trigger_fee_collection :
17+ process_fees :
1818 runs-on : ubuntu-latest
1919
2020 steps :
@@ -33,21 +33,65 @@ jobs:
3333
3434 # Get the path of the changed JSON file
3535 JSON_PATH=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep 'fee_allocator/fees_collected/.*\.json$' | head -n 1)
36-
36+
3737 if [ -z "$JSON_PATH" ]; then
3838 echo "No JSON file found in recent changes."
3939 exit 1
4040 fi
41-
41+
4242 echo "JSON Path: $JSON_PATH"
43-
43+
4444 # Extract the end date from filename using cut
45- END_DATE=$(basename "$JSON_PATH" | cut -d'_' -f3 | cut -d'.' -f1)
46-
45+ END_DATE=$(basename "$JSON_PATH" | cut -d'_' -f4 | cut -d'.' -f1)
46+
4747 echo "end-date=$END_DATE" >> $GITHUB_OUTPUT
4848
49- - name : Trigger collect_fees_v2 workflow
50- uses : benc-uk/workflow-dispatch@v1
49+ - name : Setup Python 3.10
50+ uses : actions/setup-python@v5
51+ with :
52+ python-version : " 3.10"
53+
54+ - name : Collect fees
55+ env :
56+ DRPC_KEY : ${{ secrets.DRPC_KEY }}
57+ GRAPH_API_KEY : ${{ secrets.GRAPH_API_KEY }}
58+ run : |
59+ pwd
60+ end_day=${{ steps.get-date.outputs.end-date }}
61+ start_day=$(date -d "$end_day -14 days" +%Y-%m-%d)
62+ date_range_string="${start_day}_${end_day}"
63+ echo $date_range_string
64+ start_timestamp=$(date -d "$start_day 00:00:00" +"%s")
65+ end_timestamp=$((start_timestamp + 60*60*24*14)) # 2 weeks later
66+ pip3 install -r requirements.txt
67+
68+ # v2 run
69+ python3 main.py --ts_now $end_timestamp --ts_in_the_past $start_timestamp --fees_file_name v2_fees_${date_range_string}.json --output_file_name v2_incentives_${date_range_string}.csv --protocol_version v2
70+ # v3 run
71+ python3 main.py --ts_now $end_timestamp --ts_in_the_past $start_timestamp --fees_file_name v3_fees_${date_range_string}.json --output_file_name v3_incentives_${date_range_string}.csv --protocol_version v3
72+ # merge v2/v3 payload
73+ python3 combine_payloads.py --payload_file_name v2_fees_${date_range_string}.json
74+
75+ - name : Create PR
76+ id : cpr
77+ uses : peter-evans/create-pull-request@v7
5178 with :
52- workflow : Process and run reports for a fee round
53- inputs : ' {"end_day": "${{ steps.get-date.outputs.end-date }}"}'
79+ commit-message : " task: new fees report ending ${{ steps.get-date.outputs.end-date }}"
80+ title : " Biweekly Fee Report ending ${{ steps.get-date.outputs.end-date }}"
81+ body : |
82+ Checks before merging:
83+ - [ ] all pools must be a core pool
84+ - [ ] `total_incentives` + `fees_to_vebal` + `fees_to_dao` == [usdc onchain](https://etherscan.io/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48?a=0x7c68c42de679ffb0f16216154c996c354cf1161b)
85+ - [ ] `aura_incentives` / `total_incentives` ~= aurabal's vebal capture (https://app.aura.finance/#/stats)
86+ - [ ] `earned_fees` <= total_swept onchain (per chain)
87+ - [ ] `fees_to_dao` / (`fees_to_vebal` + `fees_to_dao` + `total_incentives`) == .175
88+ - [ ] `min(aura_incentives)` > threshold
89+ - [ ] `min(bal_incentives)` > threshold
90+ - [ ] latest [vote round data added](https://github.com/aurafinance/aura-contracts/pulls?q=is%3Apr+is%3Aclosed) by aura team?
91+
92+ Additional checks:
93+ - [ ] paladin quest v2 claimable earnings > $10k? https://quest.paladin.vote/#/claim
94+ branch : gha-biweekly-fees
95+ branch-suffix : timestamp
96+ delete-branch : true
97+ labels : " Biweekly-Report"
0 commit comments