Repository navigation
Conversation
Mayanode reports a failed quote as HTTP 200 with an error field, while Thornode uses an HTTP error status. getQuote only looked for its too-small errors on the error status, so a real too-small Maya swap surfaced as a generic error instead of below-limit. Read the error from either shape, count zero emit asset as too small, and bound the 10x retries now that this path is live on Maya.
Rango answers NO_ROUTE when a pair has no route at any amount, such as when a chain is halted. The plugin treated a failed minimum search as below-limit, and core ranks that above every other provider's error, so a 43,156 CACAO to BTC swap showed a minimum error with no minimum. An empty search now throws SwapCurrencyError. A found minimum only counts when it is above the request, and Rango's own amount complaints stay below-limit. Without a rate the search never runs, so that case stays generic.
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.
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Description
Asana task
A CACAO to BTC swap of 5,000 USD showed "Amount is below the min limit" with no minimum. Maya Protocol is the only provider for CACAO pairs, and Maya had BTC trading halted when this was tested on 2026-11-02 (
HALTBTCTRADING,HALTSIGNINGBTC). No quote exists at any amount during a halt.The device log showed two provider errors on the from side:
Could not get quote, because Mayanode returned its error as HTTP 200 andgetQuoteonly read errors from an error status.SwapBelowLimitErrorwith an empty minimum. Rango answersNO_ROUTEat every amount, and the plugin treated a failed minimum search as below-limit.Core ranks below-limit above every error except insufficient and pending funds. Rango's false error reached the user.
Rango (
src/swap/defi/rango.ts)SwapBelowLimitErrorSwapCurrencyErrorSwapBelowLimitErrorwith that minimumSwapBelowLimitErrorINPUT_LIMIT_ISSUE, "too low")SwapBelowLimitErrorSwapBelowLimitErrorThorchain and Maya (
src/swap/defi/thorchain/thorchainCommon.ts)getQuotereads the error from an HTTP 200 body as well as from an error status. Without this, the Rango change would turn a real too-small Maya swap into "No enabled exchanges support".zero emit assetcounts as too small, andMAX_MIN_AMOUNT_PROBEScaps the 10x retries because this path is now live on Maya. Other Mayanode errors, including a halt, stay generic.Testing
Tested on the iOS simulator with the fixed plugin bundle on the
agentrole account. The frames are in the evidence table.SwapCurrencyErrorGaps
Test evidence
edebcd1Stop calling Rango no-route a below-limit error
2026-11-02
1. before fix wrong below limit
2. after fix no enabled exchanges
3. after fix genuine below limit
4. after fix cacao arb quote
5. after fix cacao arb success