-
Notifications
You must be signed in to change notification settings - Fork 47
design-doc: revenue sharing #309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Puts together an initial design doc for revenue sharing by enshrining the fee split predeploy in the OP Stack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great proposal, right now I'm curious on the value of having the math calculations to be generalizable or not in this phase
protocol/revenue-sharing.md
Outdated
|
||
#### `FeeSplitter` | ||
|
||
All of the `FeeVault` implementations need to have their `RECIPIENT` set to the `FeeSplitter`. This means that all fees that are accumulated in the system will be sent through the `FeeSplitter`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the math also be enshrined in the contract, or something that whoever is the owner might customize?
For example, when operatorFee
is enabled, how does that impact the current calculation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now we should enshrine the math in the contract. If we need to change the math in the future, we could look into abstracting it. I think the interface would be a list of address/uint256/withdrawal-network and we would just pay out to each of them.
|
||
- Add Operator Fee Vault support | ||
- Make `OPTIMISM_WALLET` and `L1_WALLET` modifiable by L2 `ProxyAdmin.owner()` | ||
- Replace `L1_WALLET` with sending to an L2 account similar to the Unichain architecture so that the design is more flexible. The L2 account that Unichain sends to is called `L1Splitter` ([link](https://github.com/Uniswap/unichain-contracts/blob/main/src/FeeSplitter/L1Splitter.sol)) and withdraws to L1. This architecture will make it more flexible for custom gas token chains or architectures where fees want to be collected on the L2 directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on enabling CGT support
After a couple of reads, I think I get it. We want to:
|
if we are going to migrate all |
Thanks for rereading and summarizing your understanding. The The You are right that at the end of this upgrade, it would not be auto configuring anybody into using the |
I see the nuance, the I don't see how the onchain value would change since it is immutable, but regardless I don't see a problem with using a migrator contract instead of manually setting the address in the rollup config. Both options seem to have a similar complexity, which is low in any case. In general, I agree with the design - I think it can be explained to partners easily. I also agree with the approach - opt-in mitigates the risk of a wholesale migration of all fee flows. We do not standardize the fee flows yet, but make it easier to do so piecemeal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces an initial design document for standardizing revenue sharing across the OP Stack through fee split predeploys. The design aims to create a unified, configurable solution for splitting fees between Superchain operators and chain operators while maintaining backward compatibility with existing implementations.
Key changes include:
- Introduction of a standardized
FeeSplitter
predeploy based on existing Base and Uniswap implementations - Enhanced
FeeVault
contracts with configurable recipient settings - Opt-in migration strategy to avoid breaking existing production systems
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This design doc is specific to the fee splitting logic and does not cover any logic around where those fees go after they are split. | ||
|
||
It is also opt-in for chains, the network upgrade transactions do not modify any existing `FeeVault` configuration. The new `FeeVault` contracts are deployed and initialized at each `FeeVault` predeploy. The `FeeSplitter` is deployed without being hooked into any of the `FeeVault` contracts. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adversarial modeling during threat modeling around advantageous fee splitting
- `RECIPIENT` | ||
- `WITHDRAWAL_NETWORK` | ||
|
||
#### `FeeVaultInitializer` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lay out the pros and cons for modifying the FeeVault
in favor of allowing the chain operators being able to more easily change their config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propose we use defi-wonderland/optimism#482 (comment) as the upgrade path
- 100% opt-in | ||
- Simple runbook for opting in | ||
- Support all 4 fee vaults | ||
- Does not break Base or Uniswap fee splitter contracts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non goal - arbitrary config fee split algo, we enshrine the 15%/2.5%
|
||
### Production Today | ||
|
||
The `FeeSplitter` predeploy (including both Base and Uniswap implementations) depends on the `RECIPIENT` of each of these contracts to be set to the fee split contract with the `WithdrawalNetwork` of L2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do a design review on the FeeSplitter
itself
Reduce the number of interactions as much as possible
|
Few notes in similar vein:
|
Specs - defi-wonderland/specs#47 |
Description
Puts together an initial design doc for revenue sharing by enshrining
the fee split predeploy in the OP Stack.