I am able to call the 0x /swap/v1/quote? endpoint without any issue (I know that is not hard). But passing in multiple exchanges, I thought, would return the swap prices on those exchanges. But it only returns a single price. Is it possible to return multiple prices from 0x or is it used for "best price"?
My code example:
const multiExchangeQuote = async (inputToken, outputToken, value) => {
const exchangeList = '0x,Uniswap,Uniswap_V2,Eth2Dai,Kyber,Curve,Balancer, Balancer_V2,Bancor,mStable,Mooniswap,Swerve,SnowSwap,SushiSwap,Shell MultiHop, DODO,DODO_V2,CREAM,LiquidityProvider,CryptoCom,Linkswap,Lido,MakerPsm,KyberDMM,Smoothy,Component,Saddle,xSigma,Uniswap_V3,Curve_V2'
const params = {
buyToken: 'DAI',
sellToken: 'ETH',
sellAmount: 0.05 * Math.pow(10, 18).toString(), // Always denominated in wei
includedSources: exchangeList,
}
let response
try {
response = await axios.get(
`${URL}${qs.stringify(params)}`,
)
} catch (err) {
console.error(err)
}
console.log("Multi Exchange Quote",)
console.log(response.data);
//console.log("%O",response.data.sources)
}
Thanks