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.
Create a borrow position, deposit collateral, and borrow assets from Jupiter Lend vaults using Privy embedded wallets. The full flow uses two transactions: one to create a position and deposit collateral, and one to borrow.
Set up your Privy credentials, Solana connection, and borrow parameters.
const PRIVY_APP_ID = "put-your-privy-app-id-here";const PRIVY_APP_SECRET = "put-your-privy-app-secret-here";const RPC_ENDPOINT = "https://api.mainnet-beta.solana.com";const VAULT_ID = 1; // target vault (market) IDconst COLLATERAL_AMOUNT = new BN(1_000_000); // e.g. 1 USDC (6 decimals)const AUTH_KEY_ID = "put-your-auth-key-id-here"; // from Privy dashboard or REST APIconst AUTH_KEY_PRIVATE = "put-your-auth-key-private-here"; // P-256 private keyconst WALLET_ID = "put-your-wallet-id-here";const privy = new PrivyClient({ appId: PRIVY_APP_ID, appSecret: PRIVY_APP_SECRET,});const connection = new Connection(RPC_ENDPOINT);
AUTH_KEY_ID identifies the authorization key (from dashboard/API), AUTH_KEY_PRIVATE is the P-256 private key used for signing. See the Privy authorization keys docs for setup.
Pass positionId: 0 to create a new position and deposit collateral in a single transaction. The SDK returns nftId for future operations.
const { ixs, addressLookupTableAccounts, nftId } = await getOperateIx({ vaultId: VAULT_ID, positionId: 0, // 0 = create new position + deposit in one tx colAmount: COLLATERAL_AMOUNT, debtAmount: new BN(0), connection, signer,});console.log("New position ID (nftId):", nftId);if (!ixs?.length) { throw new Error("No deposit instructions returned by Jupiter Lend SDK");}
Save nftId for subsequent operations (borrow, repay, withdraw). With positionId: 0, the SDK batches position creation and collateral deposit into one transaction.