Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other routes are not fetched when targeting the api/prices #147

Open
Chandraprakash-Darji opened this issue Feb 20, 2023 · 8 comments
Open

Comments

@Chandraprakash-Darji
Copy link

I have been trying to fetch the data from the apiv5 but not getting the other routes
image
I have also tried using the api playground
image

@Velenir
Copy link
Member

Velenir commented Feb 20, 2023

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.

@Chandraprakash-Darji
Copy link
Author

@Velenir Thanks for helping out

@Chandraprakash-Darji
Copy link
Author

@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"

@Chandraprakash-Darji
Copy link
Author

Also what is srcDecimal?

@Chandraprakash-Darji
Copy link
Author

@mounibec can you help out?

2 similar comments
@Chandraprakash-Darji
Copy link
Author

@mounibec can you help out?

@Chandraprakash-Darji
Copy link
Author

@mounibec can you help out?

@nmaddp1995
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants