Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank screen attempting to execute unstable tool on Li.Fi #8347

Closed
gomesalexandre opened this issue Dec 12, 2024 · 0 comments · Fixed by #8350
Closed

Blank screen attempting to execute unstable tool on Li.Fi #8347

gomesalexandre opened this issue Dec 12, 2024 · 0 comments · Fixed by #8350

Comments

@gomesalexandre
Copy link
Contributor

Overview

Some tools can be unstable on Li.Fi, i.e they won't be present from one call to the other, not because this route does not exist anymore (you can absolutely execute it and it will go through) but rather because of some Li.Fi internal issues, see e.g Enso in screenshots/additional details section which is a known unstable route which you're close to 100% guaranteed not to get from one call to the other.

When this happens, the swapper will blank out:

image

This has been introduced by the Li.Fi switch to final quotes work in #8326. The whole idea of Li.Fi not fetching final quotes was to avoid that, and while we thought we were safe when testing this PR, this can still happen under rare circumstances for some swappers (e.g Enso here, but e.g 1inch and ZRX tools can sometimes have the same behaviour).

Gut feel is the best way to handle this is to catch those specific failures (tool not available anymore at quote time) and return the rate mutated with quoteOrRate: 'quote' in this specific edge-case, which would be akin to what we were doing before.
Ideally, we would not want to add some spaghetty-y conditions in web again, so the cleanest way (IMO) would be to pass the original rate to getTradeQuote(), and return that with {...rate, quoteOrRate: 'quote'}, this way we can follow the usual pattern, no spaghetty.

References and additional details

{
  "routes": [],
  "unavailableRoutes": {
    "filteredOut": [],
    "failed": [
      {
        "overallPath": "42161:FOX~42161:USDC",
        "subpaths": {
          "42161:FOX~42161:USDC": [
            {
              "errorType": "NO_QUOTE",
              "code": "RATE_LIMIT_EXCEEDED",
              "action": {
                "fromChainId": 42161,
                "fromAmount": "1210000000000000000",
                "fromToken": {
                  "address": "0xf929de51D91C77E42f5090069E0AD7A09e513c73",
                  "chainId": 42161,
                  "symbol": "FOX",
                  "decimals": 18,
                  "name": "FOX",
                  "coinKey": "FOX",
                  "logoURI": "https://static.debank.com/image/eth_token/logo_url/0xc770eefad204b5180df6a14ee197d99d808ee52d/a3ba70c14f1dfe0cd7bff6c759686b33.png",
                  "priceUSD": "0.08580374324695125"
                },
                "toChainId": 42161,
                "toToken": {
                  "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                  "chainId": 42161,
                  "symbol": "USDC",
                  "decimals": 6,
                  "name": "USD Coin",
                  "coinKey": "USDC",
                  "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",
                  "priceUSD": "0.99930048965724"
                },
                "slippage": 0.005,
                "fromAddress": "0x5daf465a9ccf64deb146eeae9e7bd40d6761c986"
              },
              "tool": "enso",
              "message": "The tool has exceeded its rate limit."
            }
          ]
        }
      }
    ]
  }
}

Acceptance Criteria

  • When getting an unstable rate, it is still possible to go all the way through trade execution

Need By Date

No response

Screenshots/Mockups

https://jam.dev/c/9241dff2-4c51-47d8-93be-5a62c84379a7

Estimated effort

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant