Skip to content

fix(core): report why a pAMM fallback quote is dropped - #633

Open
carloszanella wants to merge 2 commits into
mainfrom
cz/fix/fallback-drop-reason
Open

carloszanella wants to merge 2 commits into
mainfrom
cz/fix/fallback-drop-reason

Conversation

@carloszanella

Copy link
Copy Markdown
Collaborator

Business logic

The router drops a pAMM quote when the fallback pays less than the user's min_amount_out. When it drops every quote of an order this way, the order now fails with the reason route/fallback_below_min_amount_out. Before, the order failed with no cause, and the failure showed as graph/other. On prod Ethereum this is about 22% of failures since fallback:rfq:bebop went live, mostly from clients that send slippage 0.

  • The no-route cause, when quotes exist and none can be ranked, now comes from the quotes' own causes, the failed solvers and the max gas cap, chosen by the existing cause tiers. A route rejection is tier 1, so it now wins over request/max_gas_exceeded when both apply.
  • The new RouteRejection variant is public. Code outside fynd that matches on the enum falls into its wildcard arm until it adds the variant.
  • Consumers of the quote records see a new failure_reason value.

Commits

SHA +/− Files Subject
fb9492e7 +40/−6 4 fix(core): report why a pAMM fallback quote is dropped
99a27140 +63/−1 2 test(core): cover the pAMM fallback drop reason

🤖 Generated with Claude Code

carloszanella and others added 2 commits October 14, 2026 11:45
WHY:
When the pAMM fallback of every quote paid less than the user's
min_amount_out, the router dropped them all and the order failed with
no cause. The failure showed as "graph/other", which hides the real
reason. Clients that send slippage 0 hit this often.

HOW:
- Add RouteRejection::FallbackBelowMinAmountOut with its Display text.
- Record this cause on each quote that the min_amount_out check drops.
- Choose the no-route cause in rank_quotes from the quote causes, the
  failed solvers and the max gas cap, using the existing cause tiers.
- Map the new variant to route/fallback_below_min_amount_out in the
  failure reason slug and to a bench-harness label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WHY:
The drop of a pAMM quote below min_amount_out now records a cause. These
tests check that the cause reaches the order's failure reason.

HOW:
- The drop records FallbackBelowMinAmountOut on the dropped quote.
- The placeholder carries it when every quote was dropped.
- The placeholder keeps it over a max gas cap and a failed solver.
- The failure reason slug is route/fallback_below_min_amount_out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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