From cff24b2a7599a4aa7fb763a2717ca848a2e579c3 Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Fri, 17 Jan 2025 13:32:06 +0100 Subject: [PATCH 1/4] chore: auto request review on mimic pr (#329) --- .github/workflows/get_mimic_report.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/get_mimic_report.yaml b/.github/workflows/get_mimic_report.yaml index fc61df78..0f67c708 100644 --- a/.github/workflows/get_mimic_report.yaml +++ b/.github/workflows/get_mimic_report.yaml @@ -36,9 +36,14 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: - commit-message: "task: new mimic fees report for period ending ${{ env.RUN_DATE }}" + commit-message: "chore: new mimic fees report for period ending ${{ env.RUN_DATE }}" title: "Biweekly Mimic data ending ${{ env.RUN_DATE }}" branch: gha-mimic-fees branch-suffix: timestamp delete-branch: true - labels: "Biweekly-Mimic-Report" \ No newline at end of file + labels: "Biweekly-Mimic-Report" + reviewers: | + gosuto-inzasheru + Xeonus + jalbrekt85 + Zen-Maxi From 2ff8510a7abef1489bca9ecfdba73815035eb9d0 Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Fri, 17 Jan 2025 14:59:47 +0100 Subject: [PATCH 2/4] feat: add checklists to prs --- .github/workflows/collect_fees_v2.yaml | 13 +++++++++++++ .github/workflows/get_mimic_report.yaml | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/collect_fees_v2.yaml b/.github/workflows/collect_fees_v2.yaml index 17646ca6..b08f8e71 100644 --- a/.github/workflows/collect_fees_v2.yaml +++ b/.github/workflows/collect_fees_v2.yaml @@ -62,7 +62,20 @@ jobs: 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` / (`earned_fees` + `fees_to_vebal` + `fees_to_dao`) == .175 + - [ ] `min(aura_incentives)` > threshold branch: gha-biweekly-fees branch-suffix: timestamp delete-branch: true labels: "Biweekly-Report" + reviewers: | + gosuto-inzasheru + Xeonus + jalbrekt85 + Zen-Maxi diff --git a/.github/workflows/get_mimic_report.yaml b/.github/workflows/get_mimic_report.yaml index 0f67c708..9de775d5 100644 --- a/.github/workflows/get_mimic_report.yaml +++ b/.github/workflows/get_mimic_report.yaml @@ -38,6 +38,10 @@ jobs: with: commit-message: "chore: new mimic fees report for period ending ${{ env.RUN_DATE }}" title: "Biweekly Mimic data ending ${{ env.RUN_DATE }}" + body: | + Checks before merging: + - [ ] assert total wei of the json == [wei onchain](https://etherscan.io/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48?a=0x7c68c42de679ffb0f16216154c996c354cf1161b) + - [ ] all active chains present branch: gha-mimic-fees branch-suffix: timestamp delete-branch: true From 417e7d195d3f8904ce3774acf68c69252f81f85b Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Fri, 17 Jan 2025 15:01:43 +0100 Subject: [PATCH 3/4] docs: update readme with new (simplified) steps --- README.md | 71 ++++++++++++++++++------------------------------------- 1 file changed, 23 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 047be8f5..d27bf2c4 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,32 @@ # protocol_fee_allocator -## How to do fees - Quick Docs by Tritium - -## Get the data from Mimic -Mimic provides a sheet each week that looks something like this: https://docs.google.com/spreadsheets/d/1ljyUREr2NcN-xmeB8SYMLyVp_cR2g9EDT4_6uHqmEXc/edit?usp=sharing - - - Check that the sum of all chains in the USDC network section other than optimism add up to to check total mainnet - - Check that check total mainnet is the same amout of USDC as in the [mainnnet fee sweeper multisig](https://app.safe.global/balances?safe=eth:0x7c68c42De679ffB0f16216154C996C354cF1161B) - - There are often errors in the mimic sheet and things do not add up, just ask if something is wrong and they fix it. - -Once everything checks out, create a json file named fees_{start_date}_{end_date}.json in the [./fee_allocator/fees_collected](./fee_allocator/fees_collected) folder. See there for examples. The format should be as follows, with the amounts expressed in USD, rounded down to the nearest cent (for now) -```json -{ - "mainnet": 0.00, - "arbitrum": 0.00, - "polygon": 0.00, - "base": 0.00, - "gnosis": 0.00, - "avalanche": 0.00 -} -``` - -Create a pull request and ensure that at least one other Maxi check's your copypasta agains the mimic sheet and signs off. Once reviewed merge to master. -## Running the allocation logic -Go to the [Process and run reports for a fee round](https://github.com/BalancerMaxis/protocol_fee_allocator/actions/workflows/collect_fees.yaml) github action. Click run_workflow and as instructed enter the end date, this should be the later of the 2 dates in the fee file you just uploaded. - -This action takes about 5-10 minutes to run. If successful it should generate a new PR with csvs and payloads for the fee run. If it doesn't finish, check the action logs and see if you can figure out what is wrong. There are a lot of RPC and data dependencies. - -## Checking the allocation results -= Checkout the branch created by the repo. Load the CSV into a new tab on this [sheet](https://docs.google.com/spreadsheets/d/16axBQBVNdPssQyjcIyb_4m4vOb5rKISIlrVMk7A2qjs/edit#gid=62689806) -- Check an older copy of the sheet and grab copypasta/sense check the totals lines. - - Check that the total out (sum e-g) is equal to the total amount on the sheet and in the safe and matches swept on N9 - - Check that the aura/bal brib ratio under the total in Column I is reasonably close to Aura's share of auraBAL (can get it at https://aura.finance) -- Move last_join_exit to Column D, after symbol -- Create a new row between **earned_fees** and **fees_to_vebal** (column F). Populate it with the sum of G,H and I for each row. -- Copy the table in Column N1 - S9 from another tab on a recent date into the same place on your sheet. - - Update S2-9 with the wei amount values from the fee json you generated above. You can also use P if you have float amounts. -- Check that all chains have a difference of >=1 (or just a tad under) -- If you want to be fancy apply the conditional formatting to make stuff green and red - -## Load the payload -Assuming the results check out, load the payload into the [mainnnet fee sweeper multisig](https://app.safe.global/balances?safe=eth:0x7c68c42De679ffB0f16216154C996C354cF1161B). Run tenderly and make sure it sims, and that the total USDC out matches everything else. Do a quick check, we can review more later, and sign it/load it. - -## Prepare a multisig-ops payload for review +## 1. Review Mimic PR + +As a result from https://github.com/BalancerMaxis/protocol_fee_allocator/blob/main/.github/workflows/get_mimic_report.yaml, a PR will appear bi-weekly Thursday ~9am UTC. It merges the newest fees json into `fee_allocator/fees_collected/fees_***.json`. Checklist is posted automatically in the PR. + +## 2. Run the Allocator with New Mimic Data + +Manual for now via dispatch: https://github.com/BalancerMaxis/protocol_fee_allocator/blob/main/.github/workflows/collect_fees_v2.yaml + +Can be automated to trigger on successful merge of step 1. above (https://github.com/BalancerMaxis/protocol_fee_allocator/issues/330) + +## 3. Review Fee Allocations PR + +Checklist is included in the PR + +## 4. Load the Payload + +Assuming the results check out, load the payload into the [mainnnet fee sweeper multisig](https://app.safe.global/balances?safe=eth:0x7c68c42De679ffB0f16216154C996C354cF1161B). Run tenderly and make sure it sims, and that the total USDC out matches everything else. Do a quick check, we can review more later, and sign it/load it. + +## 5. Prepare a `multisig-ops` Payload for Review + Checkout/open the `BalancerMaxis/multisig-ops` github repo. Pull the newest main and create a new branch from it. Tritium tends to use fees-yyyy-mm-dd with the end date, but anything is fine. copy the artifacts generated by the fee_allocation PR above (in this repo) into the `MaxiOps/feeDistribution/YYYY-MM-DD` folder where the date is the end date used to run the action. -there should be 3 input artifacts in the following subdirectories of the fee_allocator directory: `fees_colected`, `allocations`, `tx_builder/transactions`. note that fees collected is the json file you built above. +there should be 3 input artifacts in the following subdirectories of the fee_allocator directory: `fees_colected`, `allocations`, `tx_builder/transactions`. note that fees collected is the json file you built above. Commit and push the 3 files, and generate a PR. Here is an [example PR](https://github.com/BalancerMaxis/multisig-ops/pull/785) that may be easier to copy than following the instructions listed here. @@ -59,8 +36,6 @@ Make sure you include the following in the PR Description: - A link to the tab on the sheet that you prepaired - A link to the fee allocator PR where everything was generated -Wait about 5-10 minutes for the report to finish, which should generate another view of what is paid where. Once this is done, ask Sigops to check everything, and if you have the energy recheck what you signed against the sheet and the report. - -Note that allocator PR's don't have a great review process right now so it is unclear when/how to merge this PR. In the end, what is reviewed is in msig ops so this PR can be merged once the tx is executed, or even at the end of this process if you've checked everything well. - +Wait about 5-10 minutes for the report to finish, which should generate another view of what is paid where. Once this is done, ask Sigops to check everything, and if you have the energy recheck what you signed against the sheet and the report. +Note that allocator PR's don't have a great review process right now so it is unclear when/how to merge this PR. In the end, what is reviewed is in msig ops so this PR can be merged once the tx is executed, or even at the end of this process if you've checked everything well. From 83c879af8f55d1f5c952639bfeb8d356546fe30d Mon Sep 17 00:00:00 2001 From: Gosuto Inzasheru Date: Fri, 17 Jan 2025 15:29:38 +0100 Subject: [PATCH 4/4] docs: also add min threshold check for bal incentives --- .github/workflows/collect_fees_v2.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/collect_fees_v2.yaml b/.github/workflows/collect_fees_v2.yaml index b08f8e71..fec17e98 100644 --- a/.github/workflows/collect_fees_v2.yaml +++ b/.github/workflows/collect_fees_v2.yaml @@ -70,6 +70,7 @@ jobs: - [ ] (`earned_fees` + `fees_to_vebal` + `fees_to_dao`) >= total_swept onchain (per chain) - [ ] `fees_to_dao` / (`earned_fees` + `fees_to_vebal` + `fees_to_dao`) == .175 - [ ] `min(aura_incentives)` > threshold + - [ ] `min(bal_incentives)` > threshold branch: gha-biweekly-fees branch-suffix: timestamp delete-branch: true