2

I'm using the Raydium SDK to implement a few functions, and I'm new to the blockchain space.

I just want to know how to get the current price of a token, which is how much sol a token is currently equal to, from its contract address.

Can someone give a simple code example?

1 Answer 1

0

To obtain the price of your token, you can use the Gecko Terminal APIs and DEX scanner APIs. It returns the latest price from the Solanan blockchain.

https://docs.dexscreener.com/api/reference

https://www.geckoterminal.com/dex-api

using Raydium Script:

Calculation of Tocken price (for example SOL-USDC)

3
  • 1
    I would like to know how to get more accurate data directly from the chain or using raydium sdk
    – FengJob
    Apr 4 at 6:44
  • Dexscanner APIs mostly provide accurate data as they fetch the data directly from the chain.
    – Bobz
    Apr 16 at 8:27
  • To get through the script using Raydium SDK check edit answer.
    – Bobz
    Apr 16 at 8:37

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.