feat: arc bridge native approach#9262
Open
maxime-oe wants to merge 1 commit into
Open
Conversation
16678d5 to
31eae6b
Compare
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
maxime-oe
commented
Jun 25, 2026
| // back-calculated as trade.value - sentAmount. This only holds when the native | ||
| // asset actually flows through trade.value; when trade.value is 0 there is | ||
| // nothing to back out and the relayer fee is 0. | ||
| if (isNativeAddress(quote.srcAsset.address) && relayerFeeAmount.gt(0)) { |
Contributor
Author
There was a problem hiding this comment.
Why this is useful for Arc:
- The logic " - " doesn't make sense for Arc since USDC native transactions will actually be ERC20 transactions. This change prevents the display of wrong fees in the quotes list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
References
Checklist
Note
Medium Risk
Changes quote cost and network-fee metadata used for sorting and display; incorrect relayer logic could mislead users on bridge economics, though the fix targets a known bad path when trade.value is zero.
Overview
Aligns Arc bridge native token metadata with a USDC symbol (replacing
USDC-native) in the default token map andSYMBOL_TO_SLIP44_MAP, matching the “native USDC at zero address” model while the UI can still hide it from the asset picker.Relayer fee math in
calcRelayerFeenow only back-calculatestrade.value - sentAmountwhen the source is native andtrade.valueis greater than zero. Whentrade.valueis0x0(e.g. ERC-20 source or native flows that don’t put value on the trade), the relayer fee stays 0 instead of becoming a large negative that poisoned cost, adjusted return, and total network fee in quote selectors.Selector tests were updated for the corrected fee/cost figures on mocks that use
trade.value: '0x0'.Reviewed by Cursor Bugbot for commit 31eae6b. Bugbot is set up for automated code reviews on this repo. Configure here.