-
Notifications
You must be signed in to change notification settings - Fork 389
Update 03-calculate-aep-fees.mdx #2257
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: master
Are you sure you want to change the base?
Changes from all commits
e1be7d8
b84dd76
3a598b9
85cb266
0b37b7e
4b8bb1a
d9cb6af
391ea8e
d59b106
6fdc5db
d8a332c
a937cd1
dce6966
79339fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -14,14 +14,52 @@ Before we define “Protocol Net Revenue”, let's explain how fees work in a st | |||||
|
||||||
### Sequencing revenue | ||||||
|
||||||
In a vanilla Orbit chain (a chain without customizations, transaction ordering policies, or other add-ons), users and dApps will pay a single gas fee to submit their transactions. Under the hood, however, a user’s fee is allocated across four components used by the network in different ways. These four fee components are split as follows: | ||||||
In a vanilla Orbit chain (a chain without customizations, transaction ordering policies, or other add-ons), users and dApps will pay a single gas fee to submit their transactions. Under the hood, however, a user’s fee is allocated across three components used by the network in different ways. These three fee components are split as follows: | ||||||
|
||||||
- `l2BaseFee`: fees paid to execute a transaction on the Orbit chain. | ||||||
- `l2SurplusFee`: surplus fees are charged in addition to the base fee when an Orbit chain is congested. | ||||||
- `l1BaseFee`: fees paid to cover the cost of an Orbit chain posting its settlement transaction to the parent chain. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we mention the 4 components above (based on my previous comment), we should keep this one there too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Harry mentioned to delete this everywhere because it nets to 0 @hkalodner |
||||||
- `l1SurplusFee`: an additional surplus fee that can be configured to award extra fees to the batch poster. | ||||||
|
||||||
Based on the above, we interpret that an Orbit chain’s revenue sources include all fee components: `l2BaseFee`, `l2SurplusFee`, `l1BaseFee`, and `l1SurplusFee`. However, one of these fee components is also a cost, `l1BaseFee`, as it is used to pay for parent chain settlement. | ||||||
Based on the above, we interpret that an Orbit chain’s revenue sources include all fee components: `l2BaseFee`, `l2SurplusFee`, and `l1SurplusFee`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here we start describing the context of "revenue", so it makes sense to pivot to these 3. This bit is correct. |
||||||
|
||||||
AEP fees can be paid in either `ETH` or Custom Gas token. We highly encourage using the automatic routers which will calculate the fees like below: | ||||||
|
||||||
If AEP fees are paid in `ETH`: | ||||||
|
||||||
```jsx | ||||||
AEP*FEES = [ | ||||||
(L2BaseFee * Daily*price_L2_gas_token_to_ETH) + | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
(L2SurplusFee * Daily_price_L2_gas_token_to_ETH) + | ||||||
(L1SurplusFee * Daily_price_L1_gas_token_to_ETH) | ||||||
|
||||||
- ( | ||||||
(AssertionCosts * Daily_price_L1_gas_token_to_ETH) | ||||||
) | ||||||
] * 0.1 | ||||||
``` | ||||||
|
||||||
If AEP fees are paid in the custom gas token: | ||||||
|
||||||
```jsx | ||||||
AEP_FEES = [ | ||||||
(L2BaseFee) + | ||||||
(L2SurplusFee) + | ||||||
(L1SurplusFee * Daily_price_L1_to_L2_gas) | ||||||
|
||||||
- ( | ||||||
(AssertionCosts * Daily_price_L1_to_L2_gas) | ||||||
) | ||||||
] * 0.1 | ||||||
``` | ||||||
|
||||||
**Apechain Example**: | ||||||
`L2BaseFee` + `L2SurplusFee` + `L1SurplusFee` : Summed from feeCollection traces excluding transfers to the system address (denominated in the Orbit’s gas token, example `APE`). `L1SurplusFee` is obtained in the Orbit chain too. | ||||||
|
||||||
**Assertion costs**: Pulled from the `RollupProxy` via `nodeCreated` events and other validator-related transactions (also in `ETH`). | ||||||
|
||||||
To simplify this for developers and avoid discrepancies between chain operators and RaaS providers, we recommend using prebuilt SQL queries from Allium to extract each of these values consistently. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This text should be updated with the method we recommend for the accounting. If we want to change to the "fee splitter method", we should remove the mentions to using queries for Allium |
||||||
|
||||||
The Arbitrum Foundation can help provide or validate these queries. | ||||||
|
||||||
### Assertion costs | ||||||
|
||||||
|
@@ -52,7 +90,7 @@ Based on our understanding above, we can calculate AEP fees as follows. | |||||
```jsx | ||||||
AEP_FEES = [(gross revenue) - (settlement costs)]*0.1 | ||||||
AEP_FEES = [(sequencing revenue + additional revenue) - (settlement costs + assertion costs)]*0.1 | ||||||
AEP_FEES = [(l2BaseFee + l2SurplusFee + l1BaseFee + l1SurplusFee) - (l1BaseFee + assertion costs)]*0.1 | ||||||
AEP_FEES = [(l2BaseFee + l2SurplusFee + l1SurplusFee) - assertion costs]*0.1 | ||||||
``` | ||||||
|
||||||
## Opting in for assertion cost deduction | ||||||
|
@@ -79,7 +117,7 @@ The following costs can be deducted for an eligible validator: | |||||
|
||||||
If a team elects to deduct their assertion posting costs from eligible validators, they must establish and obey the following process: | ||||||
|
||||||
- Communicate to the Arbitrum Foundation that they intend to deduct onchain assertion costs | ||||||
- Communicate to the Arbitrum Foundation (AF) that they intend to deduct onchain assertion costs | ||||||
- Align on a cadence of disbursal and accounting these costs with the Arbitrum Foundation (e.g., quarterly, annually) | ||||||
- At this cadence, provide onchain accounting to the Arbitrum Foundation to substantiate deducted costs from the AEP Fee Router stream. | ||||||
|
||||||
|
@@ -108,4 +146,4 @@ As discussed above in Additional revenue sources, if you have customized your Or | |||||
|
||||||
### Other cases | ||||||
|
||||||
If you are still determining if your Orbit configuration applies to the listed or unlisted special cases, we recommend engaging with the Arbitrum Foundation. | ||||||
If you are still determining if your Orbit configuration applies to the listed or unlisted special cases, we recommend engaging with the AF. |
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 describe here how the fee collecting system works outside the context of AEP fees. So it makes sense to mention the 4 fee components.
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.
Think we can change back to 3 if we remove the l1basefee