Jupiter SDK v1.0-beta now available!

We are pleased to share that we are releasing Jupiter SDK v1.0-beta, the most comprehensive yet easy-to-use liquidity SDK available on Solana.

With more than 3B in swaps performed since we launched Jupiter 2 months ago, Jupiter is Solana’s most proven swap aggregation engine. This SDK will allow any wallet or UI to replicate precisely the functionality on Jupiter.

We are incredibly grateful to our early partners Mango, MeanDAO, Sonar, Tulip, Defiland, and many other individual developers from our discord for their commitment and patience in helping us work through the many issues and kinks to get here.

A great example is Mango, which is an awesome one-stop site for both spot and perp trades!

Screenshot 2021-12-23 at 9.16.40 PM

The Swap SDK For Solana

Swap is a critical use case for the vast majority of use cases in DeFi, including wallets, games, marketplaces, lending, liquidation bots, etc. - and having access to the most comprehensive list of tokens, markets, and routes is critical.

The SDK allows developers to access over 10 Dexes with more than 6bn in liquidity, allowing developers to find the best route with a simple API call.

These features include:

  • Fetching all the available tokens across DEXes
  • Find the best routes based on input token and amount
  • Perform the swap by calling the function directly or using the transaction objects
  • Add platform fee if you are a wallet or UI
  • Caching options for performance

Basic Usage

We designed the SDK to be as easy to use as possible. The basic usage simply comprises of getting the routes for a given token pair and executing the transaction!

const jupiter = await Jupiter.load({
  connection,
  cluster: ENV,
  user: USER_KEYPAIR, 
});

const routes = await jupiter.computeRoutes(
    new PublicKey(inputToken.address), // Mint address of the input token
    new PublicKey(outputToken.address), // Mint address of the output token
    inputAmount,
    slippagePercentage,
    true  // cached=true => will use cache if not older than routeCacheDuration
  )

const { execute } = await jupiter.exchange({ route: routes[0] });
const swapResult: any = await execute(); 

The basic guide can be found here, while a comprehensive example with everything you need to set up a fully functioning swap UI can be found here.

Platform Fees

If you are a wallet or UI that needs to set platform fees, you can do so with this:

// define platform fee and owner account
const platformFeeAndAccounts = {
  feeBps: 50,
  feeAccounts: await getPlatformFeeAccounts(
    new PublicKey('9VjEE6cne5rNzrV9UPPZupab57bDGx3R9ZDG9YMNAht') // The platform fee account owner
  ) 
}

// Pass 
const jupiter = Jupiter.load({
  ... // rest of Jupiter parameters
  platformFeeAndAccounts
})

The guide for adding platform fees can be found here.

Links

Next Steps

This SDK is a critical first step in our overall goal to make liquidity as easily accessible and transparent to the entire ecosystem as possible, including our open source plans in early 2022, which will allow any developer to contribute to Jupiter.

Although we don’t expect significant issues in the SDK’s beta phase, there might still be occasions when things break due to the changes we need to implement, either due to partner feedback or improvements. With that said, we do expect a stable version of the SDK to be released by Jan 2022.

Like how we strive to make our UX as easy and seamless as possible to users, our goal is to deliver an SDK that enables developers to achieve all their goals in the simplest way possible. We are not there yet, so any help/feedback/request will be great!

If you have any needs, requirements, or future requests, please post a reply here or let us know in our developer community Jupiter Aggregator.

12 Likes

I think this days people are looking for the easiest way to do their work and want a platform with high services

6 Likes

Hello! have been looking at the API V1 provided by Jupiter but it looks like the outputAmount don’t match the ones shown on the UI of Mercurial. Do you know if this is an open issue? I saw that the APIs are marked as beta

For example, let’s say that I want to swap 1000 USDC for LUNA. Using the API V1 that is linked in the documentation above I can make a call to the /quote endpoint and receive the following estimate 11.08 while on the UI it shows 11.29 although the routes reported are the same in both cases (SaberxSerum). The same happens also for other pairs, even for the SOL->USDC example used in the documentation.

Thanks for your help and the great work!

6 Likes

The quotes can change quite a bit even over a few seconds between two different quotes. It’s very much dependent on the market.

If you need more support, just go to #developer-support in our discord: Jupiter Aggregator

6 Likes

Jupiter can be great in future by developing the services.

6 Likes

this paltform (defi exchange) is very well
Attributes:
Simple
Safe
Fast

5 Likes

A fast-paced platform is desired.

2 Likes

That’s great! It will be help users have more sympathy with Jupiter

2 Likes

Thank you mr benchow for this

3 Likes

look good ı follow.I think will very big project

Jupiter the best ag in solana keep Mooning us with good good features

I really like this aggregator
I’d like to make a small donation to this project team, is there any channel?

This program is great, but one small question, where can I view my transaction history?

After you connect your wallet there is a tab on the right of the screen. Click it to open up the transaction history. If you need more help, join our discord! Jupiter Aggregator

3 Likes

Please, how do you connect your wallet?

这个项目很棒,但是有一个小问题,我在哪里可以查看我的历史交易记录?

This project is great, but one small question, where can I view my transaction history?

1 Like

appreciate your guys’ effort

1 Like

the exchange works perfectly :heart_eyes:

1 Like

maybe i should make a tutorial on discord , there are too many new users needing guidance sir

1 Like