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
  • 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 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)

{
    "mainnet": 0.00,
    "arbitrum": 0.00,
    "polygon": 0.00,
    "base": 0.00,
    "gnosis": 0.00,
    "avalanche": 0.00,
    "zkevm": 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 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

  • 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)
  • Copy the table in Column L1 - P9 from another tab into the same place on your sheet.
    • Update N2-9 with the values from the fee json you generated above
  • 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
  • Make sure that the gud pools are getting lots of bribs (it's a maxi thing)

Load the payload

Assuming the results check out, load the payload into the mainnnet fee sweeper multisig. 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

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.

Commit and push the 3 files, and generate a PR. Here is an example PR that may be easier to copy than following the instructions listed here.

Make sure you include the following in the PR Description:

  • A link to the payload in the safe to sign
  • 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.