Skip to content

feat(transaction-pay-controller): support max quotes in server strategy - #11418

Open
matthewwalsh0 wants to merge 1 commit into
mainfrom
feat/server-max-quotes
Open

matthewwalsh0 wants to merge 1 commit into
mainfrom
feat/server-max-quotes

Conversation

@matthewwalsh0

@matthewwalsh0 matthewwalsh0 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Explanation

ServerStrategy did not support max-amount quotes. This adopts the shared max flow extracted from RelayStrategy in #11440, so server max requests behave like Relay's:

  • Gas station re-quote: when the user lacks native balance for origin gas, re-quote with the source amount reduced by the gas cost so it can be paid from the source token.
  • Atomic max: when payStrategies.relay.atomicMaxEnabled is enabled, subsidized routes are quoted atomically, with the transaction's calls re-encoded for the max amount.
  • Hooks: the server strategy supplies getServerMaxQuoteDetails (gas limits, first step, gasless, subsidized, target amount), and re-quotes the same provider.
  • Calls: server max requests only embed calls when atomic max is supported, and never opt into deferred calls, since an atomic max quote is only valid when the provider executes the calls.
  • Support: removes the maxAmount unsupported reason from ServerStrategy.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Touches quote request shaping, gas-station re-quoting, and atomic call embedding for server max flows—errors here can mis-price max spends or produce invalid atomic quotes, though behavior mirrors an existing Relay path and is heavily tested.

Overview
ServerStrategy now handles max-amount quote requests by routing them through the shared getMaxQuotes flow (same pattern as Relay), instead of declining them via ServerUnsupportedReason.MaxAmount.

For max requests, server quoting wires in getServerMaxQuoteDetails (gas limits, first transaction step, gasless/subsidized flags, target amount), uses fetchQuotes / requoteProvider for probe and reduced-source re-quotes when origin gas must be paid from the source token, and returns [] on max-quote failures. Support checks drop the maxAmount unsupported reason so isMaxAmount requests are accepted.

Call embedding changes: max quotes only embed transaction calls when isAtomicMaxSupported is true (atomic exact-output with re-encoded calls); they no longer always skip delegation for max, and max quotes never set supportsDeferredCalls because atomic max requires the provider to execute embedded calls.

CHANGELOG and tests cover the new max path (including atomic vs non-atomic server quote bodies) and update unsupported-capability tests from isMaxAmount to isDirectMusdMoneyAccount.

Reviewed by Cursor Bugbot for commit 22c5019. Bugbot is set up for automated code reviews on this repo. Configure here.

Use the shared max quote flow in ServerStrategy, so max-amount requests
get the gas station re-quote and atomic max promotion like RelayStrategy.

This branch was successfully deployed

1 active deployment
default-branch — 22c50191 Deployed Nov 12, 2026 by matthewwalsh0 via Determine whether this PR is a release PR #6940
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant