I'm currently implementing the Avalanche 0x API for swapping in our UI. The quote arguments are the same as what we use for the ETH mainnet, but it returns Gas estimation failed; not sure how to debug this, can someone please help?

Below is an example call we make:


buyToken: AVAX contract address
sellToken: USDC contract address
takerAddress: the address of the user that is initiating the swap
sellAmount: amount in AVAX
NOTE: we also use affiliateAddress and slippagePercentage but I haven't included them in the link above


  • I think this refers to the available gas. The function call first estimates if it's been allocated enough gas to accomplish/run the function. If not, it will not run as that would just spend the allocated gas without accomplishing anything.
    – Sky
    Nov 10, 2021 at 13:08

1 Answer 1


This usually happens if takerAddress does not have the funds or allowances set up to make the trade.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.