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

feat: Add origin chain fee multipliers #1365

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

feat: Add origin chain fee multipliers #1365

wants to merge 19 commits into from

Conversation

nicholaspai
Copy link
Member

Currently we apply a markup to gas fees based on the chain where the fill transaction is expected to be sent. We can improve this even further by adding additional fee multipliers based on where the deposit is originating from. For example, some chains have higher re-org risk so the deposit to fill latency is expected to be longer than for lower re-org-risk destinations.

- Applies `priorityFeeMultiplier` to Linea's priority fee rather than the `baseFeeMultiplier`
- Allows caller to set a floor on any EIP1559's `priorityFee` with a default of 0.5 gwei for chainId=1 hardcoded
Currently we apply a markup to gas fees based on the chain where the fill transaction is expected to be sent. We can improve this even further by adding additional fee multipliers based on where the deposit is originating from. For example, some chains have higher re-org risk so the deposit to fill latency is expected to be longer than for lower re-org-risk destinations.
Copy link

vercel bot commented Jan 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app-frontend-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 9, 2025 10:21pm
sepolia-frontend-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 9, 2025 10:21pm

// a higher buffer should be applied on the estimated gas price to allow for more volatility.
export const originChainBaseFeeMarkup: {
[chainId: string]: number;
} = JSON.parse(ORIGIN_BASE_FEE_MARKUP || "{}");
Copy link
Member Author

Choose a reason for hiding this comment

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

we might need to make this a origin-destination keyed dictionary. Otherwise this multiplier isn't very useful since the actual multiplier we want to apply is based on the destination chain gas process

We should pass the pre-computed gas price into this call so that we don't query the gas price twice. Additionally, we can use the scaled up gas price value to derive the gas fee totals, which currently are not using the scaled up values
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

Successfully merging this pull request may close these issues.

1 participant