Skip to main content

Jupiter

Jupiter V6 is natively supported in the SDK. Utility methods are provided to easily get swap quotes, build and send the transactions needed to perform swaps. Jupiter is the key liquidity aggregator for Solana, offering the widest range of tokens and best route discovery between any token pair. For a detailed description refer to the official Jupiter documentation.

Perform a Swap

Create an IDex istance, providing a default account:
Create an IDex istance:
Get a swap quote for 1 SOL:
Display the route path:
Create the swap transaction:
Sign and send the swap transaction:

Use the Jupiter Payments API

The Jupiter Payments API is also available, enabling you to utilize Jupiter + SolanaPay for facilitating user payments with any SPL token, allowing pricing in USDC or other tokens. Create an IDex istance, providing a default account:
Create an IDex istance:
Get a swap quote for the amount of SOL needed for obtaining 5 UDSC:
Create the swap transaction:
Sign and send the swap transaction: