1

I'm trying to trade TEDDY on Avalanche via 0x, when I call the tokens API curl -X 'GET' 'https://avalanche.api.0x.org/swap/v1/tokens' -H 'accept: application/json' I only get AVAX, WAVAX, and WETH, are those the only supported Avalanche tokens at this time?

{"records":[{"symbol":"AVAX","address":"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","name":"AVAX","decimals":18},{"symbol":"WAVAX","address":"0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7","name":"WAVAX","decimals":18},{"symbol":"WETH","address":"0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab","name":"Wrapped Ether","decimals":18}]}

1 Answer 1

1

The response from the /tokens endpoint is not at all exhaustive, 0x API supports any ERC20 compliant tokens (without on-transfer fees).

Just pass the addresses of the tokens you want to trade as sellToken and buyToken parameters to the /swap/v1/quote request.

Here is an example request selling 1000 DAI for AVAX: https://avalanche.api.0x.org/swap/v1/quote?buyToken=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&sellAmount=1000000000000000000000&sellToken=0xd586e7f844cea2f87f50152665bcbc2c279d8d70.

Please refer to https://0x.org/docs/api for more information.

Cheers!

1

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.