-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (75 loc) · 3.71 KB
/
collect_fees_v2.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: (V1&V2)Process and run reports for a fee round
on:
workflow_dispatch:
inputs:
end_day:
description: "End Date of the last voting period like YYYY-MM-DD. Fees will be calculated for the 2 week period prior 00:00GMT on this day. It should be on a Thursday during an Aura voting round."
required: true
jobs:
generate_fees_report_v1_v2:
runs-on: ubuntu-latest
steps:
- name: Checkout v1 with submodules
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Setup Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Calculate date range
id: date_calc
run: |
end_day=${{ github.event.inputs.end_day }}
start_day=$(date -d "$end_day -14 days" +%Y-%m-%d)
date_range_string="${start_day}_${end_day}"
start_timestamp=$(date -d "$start_day 00:00:00" +"%s")
end_timestamp=$((start_timestamp + 60*60*24*14)) # 2 weeks later
echo "date_range_string=${date_range_string}" >> $GITHUB_OUTPUT
echo "start_timestamp=${start_timestamp}" >> $GITHUB_OUTPUT
echo "end_timestamp=${end_timestamp}" >> $GITHUB_OUTPUT
- name: Run v1 allocator
env:
DRPC_KEY: ${{ secrets.DRPC_KEY }}
GRAPH_API_KEY: ${{ secrets.GRAPH_API_KEY }}
run: |
pip3 install -r requirements.txt
python3 main.py --ts_now ${{ steps.date_calc.outputs.end_timestamp }} --ts_in_the_past ${{ steps.date_calc.outputs.start_timestamp }} --fees_file_name fees_${{ steps.date_calc.outputs.date_range_string }}.json --output_file_name incentives_${{ steps.date_calc.outputs.date_range_string }}.csv
- name: Run v2 allocator
env:
DRPC_KEY: ${{ secrets.DRPC_KEY }}
GRAPH_API_KEY: ${{ secrets.GRAPH_API_KEY }}
run: |
cd v2
git checkout biweekly-runs
git pull origin biweekly-runs
pip3 install -r requirements.txt
python3 main.py --ts_now ${{ steps.date_calc.outputs.end_timestamp }} --ts_in_the_past ${{ steps.date_calc.outputs.start_timestamp }} --fees_file_name fees_${{ steps.date_calc.outputs.date_range_string }}.json --output_file_name incentives_${{ steps.date_calc.outputs.date_range_string }}.csv
cd ..
cp v2/fee_allocator/allocations/incentives/* fee_allocator/allocations/v2
cp v2/fee_allocator/allocations/output_for_msig/* fee_allocator/allocations/output_for_msig/v2
cp v2/fee_allocator/payloads/* fee_allocator/tx_builder/transactions/v2
- name: Create PR
id: cpr
uses: peter-evans/create-pull-request@v7
with:
commit-message: "task: new fees report (v1 and v2) ending ${{ github.event.inputs.end_day }}"
title: "Biweekly Fee Report (v1 and v2) ending ${{ github.event.inputs.end_day }}"
body: |
Checks before merging:
- [ ] all pools must be a core pool
- [ ] `total_incentives` + `fees_to_vebal` + `fees_to_dao` == usdc onchain
- [ ] `aura_incentives` / `total_incentives` ~= aurabal's vebal capture (https://app.aura.finance/#/stats)
- [ ] (`earned_fees` + `fees_to_vebal` + `fees_to_dao`) >= total_swept onchain (per chain)
- [ ] `fees_to_dao` / (`fees_to_vebal` + `fees_to_dao` + `total_incentives`) == .175
- [ ] `min(aura_incentives)` > threshold
- [ ] `min(bal_incentives)` > threshold
branch: gha-biweekly-fees
branch-suffix: timestamp
delete-branch: true
labels: "Biweekly-Report"
reviewers: |
gosuto-inzasheru
Xeonus
jalbrekt85
Zen-Maxi