Skip to main content
Access data and build transactions through the API. Use the Read SDK for on-chain data and the Lend SDK for transaction building.

Overview

Jupiter Lend provides multiple integration options:
OptionDescription
REST APIHTTPS endpoints for data, positions, earnings, and unsigned transactions. Language-agnostic.
Read SDK (@jup-ag/lend-read)On-chain reads for Earn and Borrow. Lending tokens, token details, user positions, vaults, and vault positions. TypeScript only.
Lend SDK (@jup-ag/lend)Instruction builders for deposit, withdraw, mint, redeem, and transaction flows. TypeScript only.

Core differences

CapabilityREST APIRead SDKLend SDK
Earn tokens and pool detailstokens endpointgetAllJlTokens, getJlTokenDetails, getAllJlTokenDetails-
Earn user positionspositions endpointgetUserPosition, getUserPositions-
Earnings dataearnings endpoint--
Vault config and state-getAllVaults, getVaultByVaultId-
Borrow user positionsComing soongetAllUserPositions, getPositionByVaultId-
Earn transactions (deposit, withdraw, mint, redeem)deposit, withdraw, mint, redeem or *-instructions-getDepositIxs, getWithdrawIxs, getMintIxs, getRedeemIxs
Borrow transactionsComing soon-getInitPositionIx, getOperateIx, etc.
LanguageAny (HTTP)TypeScript/JavaScriptTypeScript/JavaScript

Data and analytics

Earn tokens and positions

REST API: Fetch available tokens, positions, and earnings via HTTP. See the Earn API reference for endpoints (tokens, positions, earnings), and request formats. Read SDK: Read tokens and positions directly from chain:
import { Client } from "@jup-ag/lend-read";
import { PublicKey } from "@solana/web3.js";

const client = new Client(connection);

// All token details
const allDetails = await client.lending.getAllJlTokenDetails();

// User positions
const user = new PublicKey("YOUR_WALLET");
const positions = await client.lending.getUserPositions(user);

Vault and Borrow data

Read SDK: Vault and position reads:
// All vaults
const vaults = await client.vault.getAllVaults();

// All positions for a user across vaults
const positions = await client.vault.getAllUserPositions(user);

// Single position by vault and NFT id
const { userPosition, vaultData } = await client.vault.getPositionByVaultId(vaultId, nftId);
Borrow API endpoints (vaults, positions, transactions) are coming soon. Use the Read SDK for vault and position data today.

On-chain transactions

Earn deposit and withdraw

REST API: Request unsigned transactions or instructions for deposit, withdraw, mint, and redeem. See the Earn API reference for deposit, withdraw, mint, redeem and deposit-instructions, withdraw-instructions, mint-instructions, redeem-instructions endpoints. Lend SDK: Build instructions directly:
import { getDepositIxs, getWithdrawIxs } from "@jup-ag/lend/earn";
import BN from "bn.js";

const { ixs: depositIxs } = await getDepositIxs({
  connection,
  signer: userPublicKey,
  asset: usdcMint,
  amount: new BN(1_000_000), // 1 USDC
});

const { ixs: withdrawIxs } = await getWithdrawIxs({
  connection,
  signer: userPublicKey,
  asset: usdcMint,
  amount: new BN(1_000_000),
});

Borrow operations

Borrow API and SDK flows for create-position, deposit, borrow, repay, withdraw, and liquidate are documented in the Borrow operations pages. Borrow API endpoints are coming soon.
Use caseBest option
Earn token list and pool detailsAPI or Read SDK
Earn user positionsAPI or Read SDK
Earn earningsAPI
Vault list and configRead SDK
Borrow user positionsRead SDK
Earn transactions (deposit, withdraw, mint, redeem)API or Lend SDK
Borrow transactionsLend SDK
Non-JS backendAPI
On-chain reads and tx building (no API)Read SDK + Lend SDK

Summary

Use the REST API for quick integration, earnings data, and unsigned transactions from any backend. Use the Read SDK for on-chain Earn and Borrow data (tokens, positions, vaults). Use the Lend SDK for transaction instruction building and full control over transaction flow.