paraswap-sdk
paraswap-sdk copied to clipboard
Other routes are not fetched when targeting the api/prices
I have been trying to fetch the data from the apiv5 but not getting the other routes
I have also tried using the api playground
Are you passing options.otherExchangePrices: true
to SDK.getRate
call?
const priceRoute = await paraSwap.getRate({
srcToken: ETH,
destToken: DAI,
amount: srcAmount,
userAddress: senderAddress,
side: SwapSide.SELL,
options: {
otherExchangePrices: true,
},
});
You can see an example in tests
In API request it translates to otherExchangePrices=true
query parameter. You can see this parameter in the playground.
@Velenir Thanks for helping out
@Velenir Can you help out when I give the value of 1ETH it shows the value is small. When I check the app.paraswap.io there when we add small value lile 1ETH it multily with the "10000000000000000"
Also what is srcDecimal?
@mounibec can you help out?
@mounibec can you help out?
@mounibec can you help out?
@Chandraprakash-Darji You can simple think in blockchain, there is no decimal number, so that we have to multiply the amount to (10 ** srcDecimal) before send to blockchain. Same with desc amount