we are trying to integrate 0x protocol in our derivatives protocol and I have a couple of questions regarding the quote endpoint (GET /swap/v1/quote API, https://0x.org/docs/api#get-swapv1quote)
- Based on my understanding, executing a quote transaction is equivalent to executing a market fill order. Is that correct?
- Is there a way to see what exactly happens under the hood when I execute say https://ropsten.api.0x.org/swap/v1/quote?buyToken=WETH&sellToken=DAI&buyAmount=10000000000000000? Is it sorting the orders from best to worst price and then executing batchFillOrder? Is the code available on github somewhere?
- The quote API doesn't seem to work if I replace buyToken/sellToken in the url with my own ERC20 derivative tokens. It response says INSUFFICIENT_LIQUIDITY. This suggests that posting orders to the quote endpoint is limited to a pre-defined set of exchanges/sources? If yes, what's the process to get our derivatives exchange onboarded?
I have created a github repository that shows a few examples how to interact with the 0x protocol (inluding executing a quote transaction). Beginners may find useful. Contributions and improvement proposals from the broader 0x community are welcome. https://github.com/Walodja1987/0x-fill-order-example