0

I am trying to use 0x for a project and I am getting a lot of Invalid token combination errors when trying to get price quotes.

So this works (USDC / ETH):

https://api.0x.org/swap/v1/quote?buyToken=USDC&sellToken=ETH&sellAmount=100000000000000000

However this does not work (BUSD/BNB):

https://api.0x.org/swap/v1/quote?buyToken=BUSD&sellToken=BNB&sellAmount=100000000000000000

I have not been able to get any combinations working with anything except Eth based tokens. Is there a list anywhere of what token combinations are supported?

4
  • is this thing (0x) still alive? I thought order-book type exchanges are dead.
    – Nulik
    Jan 31 at 2:14
  • 0x is not a "curve" type of exchange, it is an order book exchange, you can't buy something that is not "packaged" to be sold. Someone must make an "order" and then you can buy from that order. If there is an order for BUSD then you can make a transaction
    – Nulik
    Jan 31 at 2:16
  • obviously folks selling there (a dying exchange) want the most liquid form of money (ETH) in the exchange for their asset, that's why you see "Eth based tokens" as you say
    – Nulik
    Jan 31 at 2:17
  • @Nulik The modern 0x swap API is a DEX aggregator. It looks at a large variety of DEXs on the chain you're trying to swap on and finds a supposedly optimal route through the DEXs, including "curve" type exchanges. 0x's swap API is very much not dead/dying
    – natewelch_
    Feb 1 at 17:11

1 Answer 1

0

ZRX API supports all tokens as long they follow the ERC20 standard, and they have liquidity available. You just need to pass the addresses instead of text symbol. Please noet that for each blockchain there is a specific endpoint, the endpoint for bsc chain is https://bsc.api.0x.org/swap/v1/quote?buyToken=BUSD&sellToken=BNB&sellAmount=100000000000000000 the pair works BNB/BUSD works on BUSD, but I highly recommend use addresses instead.

Your Answer

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

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