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: decouple network fees from quote #8432

Merged
merged 27 commits into from
Jan 3, 2025

Conversation

gomesalexandre
Copy link
Contributor

@gomesalexandre gomesalexandre commented Dec 20, 2024

Description

Note: This is exclusively tackling network fees estimate for current hop, and is used within the new trade flow components.

This PR refetches network fees at interval for current hop, using similar logic as getUnsignedXyzTransaction to get calldata and estimate network fees from that.

TODO:

  • make PoC work for one swapper only (debugger breakpoint in query is happy)
  • move me useTradeNetworkFeesCryptoBaseUnit instead of colocated with tradeExecution
  • tackle for all swappers
  • wire-up in new trade flow <TradeConfirmFooter />
  • don't try and fetch network fee if approval is required
  • remove from final quote (maybe?) probably not (at least not now)

Issue (if applicable)

closes #8270

Risk

High Risk PRs Require 2 approvals

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

Low - new trade flow only, not in prod yet. Though, if we consider flagged paths as production paths, this should be considered medium risk, as displayed fees could be off, and Txs could fail as a result.

Testing

  • Attempt a trade all the way to final quote (approval granted)
  • Ensure that network fees refetch at interval
  • Try with all swappers and chain families

Engineering

  • ☝🏽

Operations

  • 🏁 My feature is behind a flag and doesn't require operations testing (yet)
  • ☝🏽

Screenshots (if applicable)

https://jam.dev/c/9cf1706f-53d3-46d0-9a4c-cafd5f494462

@gomesalexandre gomesalexandre changed the title [skip ci] wip: decouple network fees from quote feat: decouple network fees from quote Dec 23, 2024
@gomesalexandre gomesalexandre marked this pull request as ready for review December 23, 2024 15:20
@gomesalexandre gomesalexandre requested a review from a team as a code owner December 23, 2024 15:20
@NeOMakinG NeOMakinG self-assigned this Dec 30, 2024
Copy link
Collaborator

@NeOMakinG NeOMakinG left a comment

Choose a reason for hiding this comment

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

First code pass, pending functional review

Copy link
Collaborator

@NeOMakinG NeOMakinG left a comment

Choose a reason for hiding this comment

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

Smoke test

https://jam.dev/c/3d533484-3638-4c92-b0be-9df32be54ada

Looks good so far, couldn't notice anything super weird

Stamping it as I think most of the comments are not blockers but questions

@gomesalexandre gomesalexandre merged commit 93086d0 into develop Jan 3, 2025
6 checks passed
@gomesalexandre gomesalexandre deleted the feat_decouple_quotes_network_fees branch January 3, 2025 09:42
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.

Update network fees at trade confirmation screens as needed separate from quotes
2 participants