Socket
Book a DemoInstallSign in
Socket

spl-price-in-sol

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spl-price-in-sol

Simple one file typescript module to obtain pool id and calculate the token price in SOL utilizing Raydium SDK, with given token address only.

1.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Fetch token price in SOL on Raydium

Simple one file typescript module to obtain pool id and calculate the token price in SOL utilizing Raydium SDK, with given token address only.

Simple usage

  • Install this module.

    yarn add spl-price-in-sol
    
  • Import splPriceInSol function from the package.

  • Set RPC using your own QUICK NODE OR HELIUS. In env file...

    RPC=https://mainnet.helius-rpc.com/?api-key=<your_key>
    
  • Call splPriceInSol function with your own param(desired token address).

    splPriceInSol("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"); // USDC for testing purpose
    

I hope you guys implement this package into your large project and enjoy it!

Feel free to contribute to enhancing the package. Thanks for improving @Allen-Taylor

Keywords

Raydium

FAQs

Package last updated on 06 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.