Repository navigation
fix(core): report why a pAMM fallback quote is dropped - #633
Open
carloszanella wants to merge 2 commits into
Open
carloszanella wants to merge 2 commits into
carloszanella wants to merge 2 commits into
Conversation
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>
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.
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 reasonroute/fallback_below_min_amount_out. Before, the order failed with no cause, and the failure showed asgraph/other. On prod Ethereum this is about 22% of failures sincefallback:rfq:bebopwent live, mostly from clients that send slippage 0.request/max_gas_exceededwhen both apply.RouteRejectionvariant is public. Code outside fynd that matches on the enum falls into its wildcard arm until it adds the variant.failure_reasonvalue.Commits
fb9492e799a27140🤖 Generated with Claude Code