mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
leastAccepted computed the swap floor in whole basis points, so a tolerance below 0.01% truncated to zero and amountOutMinimum came back EQUAL to the quote. A caller asking for very tight protection got none: the router reverts on the first wei of movement, including the movement their own trade causes. The arithmetic is in hundredths of a basis point now, which is the unit a V3 fee tier is already stated in. Measured on 96369 against 997001483075056712: slippage 0.005 gives 996951633000902959, four nines of the quote, where it used to give the quote itself. A direction is not a missing market. getAmountsOut and quoteExactInputSingle price a known input and have no other direction, so an exact-output request gets nothing back however deep the pool is — and "no venue here holds this pair" sent someone looking for liquidity sitting right there. It says which of the two it was, and what to ask instead. Named as the likely cause rather than asserted, because a deployment carrying an arm that prices both ways reaches that line only when the pair really is unheld. A quote that named no pool built a swap against Route[0] of an empty slice. venueQuotes always writes one hop, so this was reachable only by changing that function — which is exactly when a panic in the swap path would be found in production. Co-authored-by: Hanzo Dev <[email protected]>