(This blogpost was written by Meow in October 23, 2023.)
Jupiter Planetary Developer Week (Day 3 - 5)
Day 3 - Jupiter Terminal v2
Today we will be unveiling the brand new Jupiter Terminal V2! It is the smallest, fastest and easiest way to add Jupiter to your dApp with just a few lines of code!
A big shout out to Meteora, MarginFi, FamousFoxFederation and Bonk for being one of the early adopters of Terminal V2, seamlessly implementing swap functionality for their users without the need to navigate away from their pages.
In this update, we will go through key upgrades made for Terminal v2 to make implementing swap functionality for your dApp better, easier and just more fun:
-
Terminal v2 is now equipped with the latest v6 API, featuring Metis
-
Cross app state sharing with Jupiter Terminal
-
Unified Wallet Kit integration
-
Fee support for partners and integrators
-
Improved UX enhancements
Let’s dive in!
What’s new in Terminal V2
Terminal is a very popular way to integrate Jupiter into various platforms and applications, enabling protocols to seamlessly implement swap functionality for their users. It is also super easy to customize, from configuring input/output mint states, exact output mode, displaying tokens from Jupiter’s strict token list, all these are toggled on and off with just a few clicks to generate the code snippet.
Here are the details of what’s new in v2:
-
Jupiter Terminal v2 is upgraded to v6 API that is running Metis, bringing to you the most powerful price quote engine for the best prices and best token selection, with the best user experience.
-
We introduce cross app state sharing with Jupiter Terminal through the new syncProps() API function:
-
Starting with wallet Passthrough, syncProps() API will make sure your wallet states are always in sync, and Terminal can also callback to your dApp to request for wallet connection.
-
We are actively working on implementing cross-app state syncing for slippage, verTx, priority fees, as well as input mint and amount.
import { useWallet } from '@solana/wallet-adapter-react'; // Or @jup-ag/wallet-adapter;
const passthroughWalletContextState = useWallet();
useEffect(() => {
if (!window.Jupiter.syncProps) return;
window.Jupiter.syncProps({ passthroughWalletContextState });
}, [passthroughWalletContextState.connected, props]);
-
Terminal v2 is using the Unified Wallet Kit - an open-sourced wallet adapter, that incorporates wallet standards and passthrough wallet capabilities. It seamlessly interfaces with many well used wallets out there, to give the best wallet experience for your users.
-
Jupiter Terminal now offers fee support for partners and integrators. Partners can choose to enable platform fees on top of the swaps. To facilitate this, partners need to create token fee accounts to begin collecting platform fees. The Jupiter Referral Dashboard allows partners and integrators to monitor and claim these fees conveniently.
-
We have also enhanced the user experience by implementing additional error and warning messages to guide users. There is now a built-in RPC monitor that notifies users of any RPC abnormalities or degradation in the Solana network.
Terminal Showcase
Check out this mini showcase of how our partners have integrated Terminal to provide swap functionality for their users:
Terminal Showcase #1
Meteora’s mission is to grow liquidity on Solana by building dynamic liquidity protocols - including stablecoin liquidity, LST liquidity and multi-token pools. Idle capital is dynamically distributed to various lending protocols to earn additional yield on top of swap fees and rewards. Meteora’s keeper - Hermes will continuously watch lending pool utilization rates and reserve levels, ready to withdraw the funds for safety.
Terminal v2 has been integrated on Meteora via the widget approach to let their users easily swap on-site for the required tokens to participate in liquidity provisioning.
Terminal Showcase #2
FamousFoxFederation, an NFT and gaming project, offers raffles and sweepstakes to participate in their NFT events. Users are able to both auction and trade their NFTs through raffle events, as well as stand a chance to win NFTs through the sweepstakes.
FamousFoxes has seamlessly integrated Jupiter Terminal into their raffle platform via the Modal approach to let their users stay on the site and effortlessly swap for the tokens required to buy the raffle tickets.
Terminal Showcase #3
MarginFi is one of the leading lending/borrowing protocols in Solana. It offers users a comprehensive platform where they can seamlessly borrow, lend, and even stake SOL for LSTs – all within a unified environment.
MarginFi integrated Jupiter Terminal via the Integrated mode, rendering the swap as part of its dapp, on a dedicated page. Their users can stay on the site to also swap their tokens on top of participating margin trading.
Ending Words
Terminal v2 is like the magic wand for adding swap superpowers to your Solana dApp in the most hassle-free and elegant way. If you haven’t given it a spin yet, now’s the perfect time to unlock its awesomeness and inject some fun and additional functionality into your project!
Day 4 - Unified Wallet Kit
Today, we will be introducing the Unified Wallet Kit, which was born out of our desire to help developers build more easily on Solana, fast tracking through all the challenges we faced in trying to support the majority of the wallets out there and building a great wallet UI/UX.
Unified Wallet Kit is an open-sourced, Swiss Army Knife wallet adapter, striving for the best wallet integration experience for developers, and best wallet experience for your users.
Along with Terminal, it’s the fastest way to get started on Solana.
Let’s learn how.
Unified Wallet Kit to make BUIDLing Easier
To bootstrap a dApp with a wallet, we often find ourselves repeating the same setup, such as getting the various wallet adapters (both Solana Wallet Standard and custom wallets) installed, building notifications for wallet state (selected, connected, disconnected etc.), auto-reconnecting to the last connected wallet, adapting to a mobile-first responsive design, theming etc., over and over again.
This is our biggest motivation in building the Unified Wallet Kit - to have all these essential yet repetitive basic building blocks provided in a simple package that anyone can just plug and play.
Being one of the most used dApps on Solana, where we facilitate the majority of liquidity exchange in the ecosystem, we built our own world-class wallet adapter to support the majority of wallets for access to this liquidity. This wallet adapter includes all the important blocks mentioned above and more, to provide users with the best wallet experience.
Now, we want to give back to the developer community. We hope that by bringing our world class wallet adapter open-source, we will allow any developers to fast track and bootstrap their projects in no time!
Features of Unified Wallet Kit
-
Main ESM bundle at a compact 94KB (~20KB gzipped)
-
Built-in Wallet Standard, Mobile Wallet Adapter support
-
Abstracted wallet adapter, with a Bring Your Own Wallet (BYOW) approach where you can select the wallets your dapp wishes to support. This allows you to add custom and legacy wallets.
-
Mobile responsive
-
Smart notification system where you can either plug in your own notification system or use it by itself. This notification system does not interfere with your dapp.
-
Internationalization with language support for English, Chinese, Vietnamese, French, Japanese, Bahasa Indonesia and Russian
-
Theming - select from light, dark and Jupiter modes. More customisation to come.
-
Pluralization for i18n
-
New user onboarding
The Unified Wallet Kit will allow integrators to very quickly enable these features and let wallets connect to their dApps with only a few lines of code. It can’t get any easier than this.
Similarly with Terminal, the live playground is available at https://unified.jup.ag. Come swing by and check it out.
Quick Notes on Unified Wallet Kit
-
Unified Wallet ships with WalletStandard and Mobile Wallet Adapter by default as we echo the push for the Wallet Standard specification. However any additional wallets or custom implementations can still be added easily with the Bring Your Own Wallet (approach) so that it does not bloat your dapp.
-
We understand that different dapps have their own notification implementation, therefore the notification system is optional and can be plugged in with your existing notification system.
-
The Unified Wallet Kit is currently used on Meteora, do give it a spin.
Ending Words
Jupiter is dedicated to help make BUIDLing easier for everyone. Developers should have zero friction building on Solana, we believe that having this great developer experience is important to help attract even more brilliant people to come build together and drive innovation. This is just the beginning, and we are excited to introduce more open-source projects in time to come.
Let’s keep moving forward together!
Day 5 - Jupiter Gaming Unity SDK
Today, we are excited to delve into the world of Jupiter for gaming, where we will look at how Jupiter has been facilitating in-game swaps and enabling gaming use cases through the integration with the Solana.Unity-SDK, developed by the talented team at MagicBlock. This post is brought to you in collaboration with MagicBlock.
Live Demo: Solana.Unity-SDK
In this post, we will learn about:
-
Why Solana is the major blockchain for on-chain games
-
Solana.Unity-SDK and its main features
-
Jupiter’s role in supporting gaming, use cases that the Jupiter x Solana Unity SDK powers, and a partner showcase
Before anything else, a big shout out to Star Atlas, Guac,Genopets, DefiLand and FamousFoxes for integrating Jupiter and enriching the gaming experience of their users, by providing a seamless and immersive swap experience.
Without further ado, let’s dive in.
Solana, the major blockchain for on-chain gaming
On-chain games are introducing a paradigm shift in the way players interact, own and experience new forms of entertainment. It’s no surprise Solana stands out as a major blockchain for on-chain gaming, thanks to its high throughput, low transaction fees, and robust ecosystem. Its ability to process thousands of transactions per second ensures that gamers experience minimal latency, creating a seamless and enjoyable gaming experience.
Furthermore, Solana’s vibrant community and extensive developer tools make it an attractive platform for game developers of all sorts, from those looking to infuse their game with on-chain assets to the ones pushing the boundaries with fully-on-chain games.
Solana is also designed to be interoperable with other blockchain networks. This means game developers can easily add Solana-based games to other blockchain platforms, allowing for seamless user experience.
As the gaming sector grows, Solana is poised to take the lead in on-chain gaming over all the other chains.
Solana Unity SDK and its main features
MagicBlock, the team behind the Solana Unity SDK, is an end-to-end infrastructure provider for on-chain gaming on Solana, empowering developers to create a new category of composable and permissionless gaming experiences.
The Solana Unity SDK simplifies the integration of Solana-based NFTs, tokens, and on-chain programs into Unity games, making it easier for game developers to create web3 games and experiences.
Some features of Solana.Unity-SDK:
-
Full JSON RPC API coverage
-
Transaction and message decoding/encoding from base64 and wire formats
-
Non-custodial Solana wallet setup in Unity, supporting Solana Wallet Adapter (Phantom, Backpack, Solflare…) and Web3auth (Social login)
-
TokenWallet object for sending and receiving SPL tokens and JIT provisioning of Associated Token Accounts
-
Additional capabilities include NFT support, compiling games to xNFTs (Backpack), native DEX operations (Orca, Jupiter), and websockets for custom events, along with Solana Mobile Stack support
With the Unity-SDK game developers can easily create seamless onboarding flows with wallets, social authentication and gasless API. Now, they can also provide a seamless trading experience with Jupiter swap!
Give the SDK a spin here: GitHub - magicblock-labs/Solana.Unity-SDK: Open-Source Unity-Solana SDK with Full RPC coverage, NFT support and more
Jupiter x Solana.Unity-SDK Native Integration to Power Gaming
As the liquidity infrastructure of Solana, Jupiter provides the best rates and deep liquidity from across the ecosystem. This is important in gaming contexts where gamers trade in-game assets frequently, especially rare assets that are very valuable. The best prices and higher liquidity makes it much easier for the gamers to stay within the game to trade these assets, improving the overall gaming experience.
Jupiter is natively supported in the Solana.Unity-SDK and runs the v6 Quote API and ExactOut v2 API for the best swap prices.
The integration features:
-
Utility methods to easily retrieve tokens information, get swap quotes and perform swaps. Game developers can easily integrate Jupiter swaps in their games and compile cross platforms without changing a single line of code.
-
A native integration that ensures a smooth and uninterrupted game experience for the players where users can exchange assets from the game UI, without annoying popups or embedded iframes.
-
Furthermore, you can effortlessly combine Jupiter with other instructions through the SDK, such as Session Keys, which eliminates the need for manual transaction approvals and ensures uninterrupted gameplay.
This integration caters to a wide range of use cases, which include but are not limited to:
-
Marketplace purchases
-
In-game payment with any coin
-
Asset swaps
-
Gamified trading experiences
Ready to include Jupiter into your game? Check out the docs here: Introduction - MagicBlock Documentation
Showcase - DeFi Land
DeFi Land is a multi-chain agriculture-simulation game created to gamify Decentralized Finance. While there are games that make use of the blockchain, DeFi Land takes DeFi as a whole and aggregates the various actions that can be taken on each DeFi platform and turns them into an interactive game that can be played.
Check out how Defi Land has integrated Jupiter to power their in-game Market, taking the entire experience of DeFi swaps to the next level.
DeFi Land is built with the Unity Engine 2021.2.1 and uses the IDexAggregator interface in the SDK to create their Market.
The interface provides convenient methods for performing swaps and accepting payment - while working seamlessly on any platform. Most notably, DeFi Land is also available as xNFT where players directly leverage Backpack to perform in-game swaps, powered by Jupiter.
Ending Words
Jupiter is Solana’s liquidity hub, offering the best prices and deep liquidity, strongly supporting diverse use cases and enhancing the gaming experience. We believe that Solana is the best place for web3 gaming, with amazing infrastructure support from teams like MagicBlock with their Solana Unity SDK, the perfect foundation for game development.
We can’t wait to see the brilliant game creations of the builders of Solana!
This marks the end of our inaugural Jupiter Planetary Developer Week. It was an amazing week of developer focused updates where we unveiled the spanking new v6 API with Metis for routing, Referral Fees System for easy fee management, ExactOut v2 for Payments, Terminal v2 for the easiest way to integrate Jupiter, Unified Wallet Kit for the best wallet integration experience and showcasing Jupiter for games. We are committed to making things easy for you to create awesome liquidity use cases.
All these just in time for the Breakpoint Conference happening next week! Thanks for following through all days of our massive update, we hope you had supercharged your BUILDling journey with us.
Come talk to us and join our upcoming talks at Breakpoint