Skip to main content
Deposit assets into Jupiter Earn vaults using the SDK.
The SDK generates transaction instructions that you can add to your own transaction flow.

Getting Started

Import the required packages for Solana RPC and Jupiter Earn SDK operations.
1

Import Dependencies

Import the packages you need for Solana RPC and Jupiter Lend (Earn) SDK operations.
2

Build Instructions

Use the Jupiter Earn SDK to generate deposit instructions.
Important
  • amount = underlying asset amount being deposited (e.g. USDC)
  • Not vault shares
  • To deposit by specifying the number of vault shares to receive, use getMintIxs

Complete Flow

This example builds, signs, and sends a deposit transaction.
1

Import Dependencies

Import the packages you need for Solana RPC and Jupiter Lend (Earn) SDK operations.
2

Set up connection and deposit parameters

Set your RPC, signer, asset mint, and deposit amount.
If your signer is stored as a local JSON keypair file, you can load it using the helper function below.
Then initialise your signer:
3

Build Deposit Instructions

Build a transaction from the deposit instructions, set blockhash and fee payer, then sign with the user keypair and send the transaction.
4

Build and send transaction

Build a transaction from the deposit instructions, set blockhash and fee payer, then sign with the user keypair and send the transaction.
You have successfully deposited your assets into Jupiter Earn Vaults. Your assets are now earning yield.

Full code example