0

I'm using 0x. The documentation is great, but a field depth looks missing. It's probably not implemented, but I still ask the question.

Suppose I want a very quick quotation for WETH -> USDT

I think that having calculating all routes WETH -> USDC -> USDT, WETH -> DAI -> USDT, etc are way longer than just direct routes WETH -> USDT, so I would like to express this in the api such as :

https://api.0x.org/swap/v1/quote?buyToken=USDT&sellToken=WETH&sellAmount=100000000&depth=1

It could also reduce the error/revert rate. Is it something possible ?

1 Answer 1

2

I believe what you asking is not possible as the 0x API tries always to find the best price, what is a workardound is you manually exclude the sources you don't want and just use for instance Uniswap, as you can see on the excludedSources on https://docs.0x.org/0x-api-swap/api-references/get-swap-v1-quote#request. I don't find this feasible.

Recent update on 0x API is with Mev protection so it should already offer a quote with the minimal reverts possible.

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.