When requesting a quote or routes to the API, it is possible that one or more tools (exchanges or bridges) won't be able to provide a result. This can be caused by many reasons, from the tool simply not supporting the requested token pair or insufficient liquidity.
To better explain failure cases, we try to return errors in a predictable format. The ToolError
interface looks like the following:
Copy type ToolErrorType = 'NO_QUOTE'
interface ToolError {
errorType : ToolErrorType
code : string
action : Action
tool : string
message : string
}
Copy {
"message" : "Unable to find a quote for the requested transfer." ,
"errors" : [
{
"errorType" : "NO_QUOTE" ,
"code" : "INSUFFICIENT_LIQUIDITY" ,
"action" : {
"fromChainId" : 100 ,
"toChainId" : 100 ,
"fromToken" : {
"address" : "0x4ecaba5870353805a9f068101a40e0f32ed605c6" ,
"decimals" : 6 ,
"symbol" : "USDT" ,
"chainId" : 100 ,
"coinKey" : "USDT" ,
"name" : "USDT" ,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",
"priceUSD" : "0.99872"
} ,
"toToken" : {
"address" : "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83" ,
"decimals" : 6 ,
"symbol" : "USDC" ,
"chainId" : 100 ,
"coinKey" : "USDC" ,
"name" : "USDC" ,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
} ,
"fromAmount" : "1" ,
"slippage" : 0.03 ,
"fromAddress" : "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0" ,
"toAddress" : "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0"
} ,
"tool" : "1inch" ,
"message" : "The tool's liquidity is insufficient."
} ,
{
"errorType" : "NO_QUOTE" ,
"code" : "TOOL_TIMEOUT" ,
"action" : {
"fromChainId" : 100 ,
"toChainId" : 100 ,
"fromToken" : {
"address" : "0x4ecaba5870353805a9f068101a40e0f32ed605c6" ,
"decimals" : 6 ,
"symbol" : "USDT" ,
"chainId" : 100 ,
"coinKey" : "USDT" ,
"name" : "USDT" ,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",
"priceUSD" : "0.99872"
} ,
"toToken" : {
"address" : "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83" ,
"decimals" : 6 ,
"symbol" : "USDC" ,
"chainId" : 100 ,
"coinKey" : "USDC" ,
"name" : "USDC" ,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
} ,
"fromAmount" : "1" ,
"slippage" : 0.03 ,
"fromAddress" : "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0" ,
"toAddress" : "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0"
} ,
"tool" : "openocean" ,
"message" : "The third party tool timed out."
} ,
{
"errorType" : "NO_QUOTE" ,
"code" : "NO_POSSIBLE_ROUTE" ,
"action" : {
"fromChainId" : 100 ,
"toChainId" : 100 ,
"fromToken" : {
"address" : "0x4ecaba5870353805a9f068101a40e0f32ed605c6" ,
"decimals" : 6 ,
"symbol" : "USDT" ,
"chainId" : 100 ,
"coinKey" : "USDT" ,
"name" : "USDT" ,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",
"priceUSD" : "0.99872"
} ,
"toToken" : {
"address" : "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83" ,
"decimals" : 6 ,
"symbol" : "USDC" ,
"chainId" : 100 ,
"coinKey" : "USDC" ,
"name" : "USDC" ,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
} ,
"fromAmount" : "1" ,
"slippage" : 0.03 ,
"fromAddress" : "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0" ,
"toAddress" : "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0"
} ,
"tool" : "superfluid" ,
"message" : "No route was found for this action."
}
]
}