-
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?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
.../02-configure-your-chain/advanced-configurations/03-aep-fee-router/03-calculate-aep-fees.mdx
Outdated
Show resolved
Hide resolved
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.
Thanks @gmehta2 !
I've requested some more clarifications in some of the points 🙏
If AEP fees are paid in ETH: | ||
|
||
AEP_FEES = [ | ||
(L2BaseFee * Daily_price_L2_gas_token_to_ETH) + |
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.
I'm still a bit concerned about using "daily price" here. The price of an asset can vary a lot within a given day. I'd say we should either modify the language to not use "daily price" and/or include an explanation on how this price is expected to be obtained.
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.
agreed, working with David to define this
] * 0.1 | ||
|
||
Apechain Example: | ||
L2BaseFee + L2SurplusFee: Summed from feeCollection traces excluding transfers to the system address (denominated in the Orbit’s gas token, example $APE). |
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.
I think "system address" it's not mentioned anywhere else in the docs. Should we add an explanation to what that is? (also, I'm not sure what it is referring to)
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.
agreed, will find out here
.../02-configure-your-chain/advanced-configurations/03-aep-fee-router/03-calculate-aep-fees.mdx
Outdated
Show resolved
Hide resolved
.../02-configure-your-chain/advanced-configurations/03-aep-fee-router/03-calculate-aep-fees.mdx
Outdated
Show resolved
Hide resolved
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.
updated with feedback
- remove l1base fee everywhere
- defined some terms further
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.
@@ -14,14 +14,48 @@ 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: |
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.
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: | |
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 three four components are split as follows: |
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
|
||
- `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 comment
The 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 comment
The 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 comment
The 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 = [ | ||
(L2BaseFee * Daily*price_L2_gas_token_to_ETH) + | ||
(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 |
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.
nit: use codeblocks for these
If AEP fees are paid in `ETH`: | ||
|
||
AEP*FEES = [ | ||
(L2BaseFee * Daily*price_L2_gas_token_to_ETH) + |
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.
(L2BaseFee * Daily*price_L2_gas_token_to_ETH) + | |
(L2BaseFee * Daily_price_L2_gas_token_to_ETH) + |
AEP_FEES = [ | ||
(L2BaseFee) + | ||
(L2SurplusFee) + | ||
(L1SurplusFee \* Daily_price_L1_to_L2_gas) |
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.
(L1SurplusFee \* Daily_price_L1_to_L2_gas) | |
(L1SurplusFee * Daily_price_L1_to_L2_gas) |
(L1SurplusFee \* Daily_price_L1_to_L2_gas) | ||
|
||
- ( | ||
(AssertionCosts _ Daily_price_L1_to_L2_gas) |
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.
(AssertionCosts _ Daily_price_L1_to_L2_gas) | |
(AssertionCosts * Daily_price_L1_to_L2_gas) |
- ( | ||
(AssertionCosts _ Daily_price_L1_gas_token_to_ETH) | ||
) | ||
] _ 0.1 |
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.
] _ 0.1 | |
] * 0.1 |
- ( | ||
(AssertionCosts _ Daily_price_L1_to_L2_gas) | ||
) | ||
] _ 0.1 |
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.
] _ 0.1 | |
] * 0.1 |
|
||
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 comment
The 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
added in David G's calculation's here https://docs.google.com/document/d/1uAYpMJ02gqBmQxKfyQkR1uWyGj9w2os56pGYKJRzrNE/edit?tab=t.0