The Jupiter Developer Platform is live. Previous portal users keep their rate limits for free until 30 June 2026 — set up billing on the new platform before then. See the Migration Guide for details.
Use this file to discover all available pages before exploring further.
Deposit collateral (supply assets) into an existing Jupiter Lend borrow position. The SDK builds operate instructions with a positive collateral amount and zero debt change. Transactions use versioned (v0) format with address lookup tables.
Import the required packages for Solana RPC, Jupiter Lend borrow SDK, and versioned transaction building.
import { Connection, Keypair, TransactionMessage, VersionedTransaction,} from "@solana/web3.js";import BN from "bn.js";import { getOperateIx } from "@jup-ag/lend/borrow";import fs from "fs";import path from "path";
Deposit uses getOperateIx with positive colAmount and zero debtAmount. Versioned transactions and address lookup tables are required.
2
Load Keypair and Initialise Connection
Load the signer and create the RPC connection. Set vault ID, position ID, and deposit amount.
const KEYPAIR_PATH = "/path/to/your/keypair.json";const RPC_URL = "https://api.mainnet-beta.solana.com";const VAULT_ID = 1;const POSITION_ID = 0; // Use 0 to create position + deposit in one tx; or nftId from Create Positionconst DEPOSIT_AMOUNT = new BN(1_000_000); // Collateral in base units (e.g. 1 USDC = 1_000_000)function loadKeypair(keypairPath: string): Keypair { const fullPath = path.resolve(keypairPath); const secret = JSON.parse(fs.readFileSync(fullPath, "utf8")); return Keypair.fromSecretKey(new Uint8Array(secret));}const userKeypair = loadKeypair(KEYPAIR_PATH);const connection = new Connection(RPC_URL, { commitment: "confirmed" });const signer = userKeypair.publicKey;
Pass positionId: 0 to batch init position + deposit in one transaction. The SDK returns nftId (your new position ID) for future operations. If you already have a position, use its nftId instead.
3
Build Deposit Instructions
Build operate instructions with positive collateral amount and no debt change.
const { ixs, addressLookupTableAccounts, nftId } = await getOperateIx({ vaultId: VAULT_ID, positionId: POSITION_ID, colAmount: DEPOSIT_AMOUNT, debtAmount: new BN(0), connection, signer,});// When positionId is 0, nftId is the new position IDif (POSITION_ID === 0) console.log("New position ID (nftId):", nftId);if (!ixs?.length) { throw new Error("No deposit instructions returned by Jupiter Lend SDK.");}
Deposit is operate with colAmount > 0 and debtAmount = 0. Your supplied tokens are locked as collateral and increase your borrowing capacity.
Position NFT ID. Use 0 to create a new position and deposit in one transaction.
colAmount
BN
Signed collateral amount in base units. Positive = deposit (add collateral). Negative = withdraw. Use new BN(0) for borrow/repay-only.
debtAmount
BN
Signed debt amount in base units. Positive = borrow (add debt). Negative = repay (reduce debt). Use new BN(0) for deposit/withdraw-only.
connection
Connection
Solana RPC connection.
signer
PublicKey
Wallet that signs the transaction (position owner).
For deposit: colAmount > 0, debtAmount = 0.
Deposit vs Borrow
Deposit adds collateral (supply token) to your position. Borrow withdraws the borrow token from the vault to your wallet and increases your debt. Deposit first, then borrow.