Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/collect_fees_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,21 @@ 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
- [ ] `min(bal_incentives)` > threshold
branch: gha-biweekly-fees
branch-suffix: timestamp
delete-branch: true
labels: "Biweekly-Report"
reviewers: |
gosuto-inzasheru
Xeonus
jalbrekt85
Zen-Maxi
13 changes: 11 additions & 2 deletions .github/workflows/get_mimic_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,18 @@ 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 }}"
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
labels: "Biweekly-Mimic-Report"
labels: "Biweekly-Mimic-Report"
reviewers: |
gosuto-inzasheru
Xeonus
jalbrekt85
Zen-Maxi
71 changes: 23 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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.
Loading