fix(transaction-pay-controller): ignore synthetic across gas legs#8527
Merged
pedronfigueiredo merged 4 commits intomainfrom Apr 21, 2026
Merged
fix(transaction-pay-controller): ignore synthetic across gas legs#8527pedronfigueiredo merged 4 commits intomainfrom
pedronfigueiredo merged 4 commits intomainfrom
Conversation
343d279 to
52950da
Compare
4 tasks
vinistevam
reviewed
Apr 21, 2026
| export function isAcrossQuoteRequest(request: QuoteRequest): boolean { | ||
| return ( | ||
| request.isMaxAmount === true || | ||
| (request.targetAmountMinimum !== undefined && |
Contributor
There was a problem hiding this comment.
Nit: (request.targetAmountMinimum ?? '0') !== '0'
Any real amount maps to true.
vinistevam
approved these changes
Apr 21, 2026
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.
Problem observed in testing
The perps direct deposit flow could include a synthetic gas-funding leg, generated internally for native ETH on Arbitrum, with targetAmountMinimum: '0'. That leg was optional and not the real asset the user was trying to deposit, but the Across strategy support check still evaluated it as if it were a required quote leg. As a result, a valid perps deposit request could be marked unsupported before quote resolution, because the optional gas leg made the whole request set fail strategy validation.
The fix was to make Across treat those zero-minimum synthetic gas legs consistently everywhere. A shared helper was introduced to identify “real” Across quote requests, and both quote fetching and strategy support now filter out requests where targetAmountMinimum === '0' unless it is a max-amount flow. In practice, that means the real deposit leg can proceed while the optional gas top-up leg no longer disqualifies the route. The turn also added a regression test covering exactly that case: one real perps deposit leg plus one synthetic native-token gas leg, and the strategy now correctly returns supported.
Summary
Testing
Note
Medium Risk
Changes Across strategy request filtering, which affects whether routes are considered supported and which legs are quoted; mistakes could cause valid quotes to be skipped or unsupported routes to be attempted.
Overview
Fixes Across strategy validation/quoting to ignore synthetic “gas” legs (requests with
targetAmountMinimum: '0') so they don’t cause perps direct deposits to be marked unsupported.Introduces a shared
isAcrossQuoteRequesthelper and applies it consistently in bothAcrossStrategy.supportsandgetAcrossQuotes, and adds regression tests covering mixed real+synthetic legs, all-synthetic legs, andisMaxAmountzero-minimum behavior.Reviewed by Cursor Bugbot for commit d773fd3. Bugbot is set up for automated code reviews on this repo. Configure here.