Skip to content

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor Author

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.
Copy link
Contributor

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.

Copy link
Contributor Author

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`.
Copy link
Contributor

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 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) +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(L2BaseFee * Daily*price_L2_gas_token_to_ETH) +
(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
```

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.
Copy link
Contributor

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


The Arbitrum Foundation can help provide or validate these queries.

### Assertion costs

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

Expand Down Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ As mentioned in our guide on [BoLD adoption for Orbit chains](../../bold-adoptio

## Table of Arbitrum BoLD parameters

The following configuration parameters can be applied when deploying or managing your Orbit chain. For an example of a configuration, feel free to reference this [sample configuration](../../04-maintain-your-chain/05-upgrade-to-bold.mdx#configure-your-chain-parameters) in our guide on how to upgrade your chain to use BoLD.
The following configuration parameters can be applied when deploying or managing your Orbit chain. For an example of a configuration, feel free to reference this [sample configuration](../../04-maintain-your-chain/05-upgrade-to-bold.mdx#step-2-configure-your-chain-parameters) in our guide on how to upgrade your chain to use BoLD.

import OptionalOrbitCompatibleCLIFlagsPartial from '../../../partials/_bold-config-params.mdx';

Expand Down