Skip to content
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

choose a proper scalar for mainnet #93

Open
blockchaindevsh opened this issue Nov 21, 2024 · 1 comment
Open

choose a proper scalar for mainnet #93

blockchaindevsh opened this issue Nov 21, 2024 · 1 comment

Comments

@blockchaindevsh
Copy link
Collaborator

The scalar value is responsible for dealing with the conversion ratio.

We also need to adjust it when the ratio changes a lot.

@qizhou
Copy link

qizhou commented Dec 10, 2024

According to here, we need to confirm three variables defined by the scalar:

  • l1BaseFeeScalar
  • l1BlobBaseFeeScalar
  • l1BlobBaseFee
  • l1BaseFee
    where l1BaseFee is the l1 gas price and l1BlobBaseFee is the l1 BLOB gas price. A code to read the data from deposit tx can be found here.

Suppose the ratio of the XYZ/ETH is 1 ETH = x XYZ token, then a simple formula will be

  • l1BaseFeeScalar = x * OP mainnet's l1BaseFeeScalar
  • l1BlobBaseFeeScalar = x * OP mainnet's l1BlobBaseFeeScalar

To have a safe margin and avoid frequent update because of x, we may

  • l1BaseFeeScalar = y * OP mainnet's l1BaseFeeScalar
  • l1BlobBaseFeeScalar = y * OP mainnet's l1BlobBaseFeeScalar
    where y = 1.5 * x

and when x is changed with a fixed y, we send the scalar-update tx for new y if y < x.

NOTE: In fact, we may have better scalars value by analyzing the actual l1 cost here. The results show that OP mainnet charges about 2x of l1 gas fee, and 1x of l1 blob fee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants