0x – How to Resolve WalletExecuteDelegateCallFailedError with 0x Quote API on Polygon Network

0x

I am calling the quote api in polygon network, and random received the below error response but sometime the same call just works. Can someone please help here.

request:

The Entire API request:

https://polygon.api.0x.org/swap/v1/quote?sellToken=0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174&buyToken=0x8A953CfE442c5E8855cc6c61b1293FA648BAE472&buyAmount=1507500000000000000000000000&slippagePercentage=0.005&takerAddress=addressplacement

{
  code: 105,
  reason: 'WalletExecuteDelegateCallFailedError',
  values: {
    wallet: '0xdb6f1920a889355780af7570773609bd8cb1f498',
    callTarget: '0xd3afdf4a8ea9183e76c9c2306cda03ea4afffea5',
    callData: '0x832b24bb0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000360a7cdf51055791e2c6ff366ec97ff5450acc26000000000000000000000000360a7cdf51055791e2c6ff366ec97ff5450acc2600000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841740000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f619000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000001bf20ee00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000012556e69737761705633000000000000000000000000000000000000000000000000000000000000000000000001bf20ee0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000e592427a0aece92de3edee1f18e0157c058615640000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002b2791bca1f2de4661ed88a30c99a7a9449aa841740001f47ceb23fd6bc0add59e62ac25578270cff1b9f61900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000',
    errorData: '0xadc35ca60000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841740000000000000000000000000000000000000000000000000000000001bf20ed0000000000000000000000000000000000000000000000000000000001bf20ee'
  }
}

Best Answer

This was an error in 0xAPI and is now fixed.

Looks like it was able to sell all but 1e-6 USDC.

{
  "functionName": "IncompleteFillSellQuoteError",
  "functionSignature": "adc35ca6",
  "functionArguments": [
    "IncompleteFillSellQuoteError({\n  sellToken: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',\n  soldAmount: 29303021,\n  sellAmount: 29303022\n})"
  ]
}
Related Topic