Skip to content

fix(transaction-pay-controller): ignore synthetic across gas legs#8527

Draft
pedronfigueiredo wants to merge 4 commits intomainfrom
pnf/across-perps-gas-leg-fix
Draft

fix(transaction-pay-controller): ignore synthetic across gas legs#8527
pedronfigueiredo wants to merge 4 commits intomainfrom
pnf/across-perps-gas-leg-fix

Conversation

@pedronfigueiredo
Copy link
Copy Markdown
Contributor

@pedronfigueiredo pedronfigueiredo commented Apr 20, 2026

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

  • ignore synthetic zero-target gas legs when evaluating Across support
  • share the same request filter between Across support checks and quote building
  • add coverage for perps direct deposits that include a synthetic gas leg

Testing

  • yarn jest --config packages/transaction-pay-controller/jest.config.js --watchman=false packages/transaction-pay-controller/src/strategy/across/AcrossStrategy.test.ts --coverage=false

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/across-perps-gas-leg-fix branch from 343d279 to 52950da Compare April 20, 2026 17:07
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