0

When trying to make an api call to Ox through Polygon, I am receiving the following error:

{ "code": 100, "reason": "Validation Failed", "validationErrors": [ { "field": "sellAmount", "code": 1004, "reason": "INSUFFICIENT_ASSET_LIQUIDITY" } ] }

The API call is:

https://polygon.api.0x.org/swap/v1/quote?sellToken=0x0000000000000000000000000000000000001010&buyToken=0x7ceb23fd6bc0add59e62ac25578270cff1b9f619&sellAmount=1000000000000000000

I have tried with more zeros and less zeros as the sell amount and nothing seems to work. Anyone had any luck with this call on Polygon. I have been able to use it with AVAX no problem...

1 Answer 1

1

Since you API query passes the address of the chain's native token (MATIC), the value for the token's address needs to be 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee. We always list a chain's native token address at /swap/v1/tokens.

This API call returns successfully:

https://polygon.api.0x.org/swap/v1/quote?sellToken=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&buyToken=0x7ceb23fd6bc0add59e62ac25578270cff1b9f619&sellAmount=1000000000000000000

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.