jupiter-lend
Interact with Jupiter Lend Protocol. Read-only SDK (@jup-ag/lend-read) for querying liquidity pools, lending markets (jlTokens), and vaults. Write SDK (@jup-ag/lend) for lending (deposit/withdraw) and vault operations (deposit collateral, borrow, repay, manage positions).
Install / Use
npx skills add internet-court/internet-court-skill --skill jupiter-lendInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of jupiter-lend
jupiter-lend scores 96/100 on our quality scale, 190th of 3,055 Development & Engineering skills we index (top 7%).
Its SKILL.md is 23 KB long, well organised into 31 sections with 13 code examples: a thorough specification that gives an agent plenty to work with.
With 6,129 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 39 days ago, so jupiter-lend is actively maintained.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
jupiter-lend compared with similar skills
All 4 of these similar skills score higher than jupiter-lend; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| jupiter-lend (this skill)by internet-court | 96 | 6.1k | 39d ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 44.3k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | 2d ago | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 5d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 5d ago | SKILL.md |
Frequently asked questions
- How do I install jupiter-lend?
- Run
npx skills add internet-court/internet-court-skill --skill jupiter-lend. The install tabs above show the steps for each supported agent. - Which AI agents does jupiter-lend work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is jupiter-lend safe to use?
- It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is jupiter-lend still maintained?
- The repository was last updated 39 days ago, so jupiter-lend is actively maintained.
Skill content
View source on GitHubname: jupiter-lend version: 0.1.3 description: Interact with Jupiter Lend Protocol. Read-only SDK (@jup-ag/lend-read) for querying liquidity pools, lending markets (jlTokens), and vaults. Write SDK (@jup-ag/lend) for lending (deposit/withdraw) and vault operations (deposit collateral, borrow, repay, manage positions). homepage: https://jup.ag/lend metadata: protocol: jupiter-lend category: defi chains: [solana]
Jupiter Lend Protocol
Jupiter Lend (powered by Fluid Protocol) is a lending and borrowing protocol on Solana. It offers Liquidity Pools, Lending Markets (jlTokens), and Vaults for leveraged positions.
The protocol uses two main SDKs:
@jup-ag/lend-read: Read-only queries for all programs (Liquidity, Lending, Vaults)@jup-ag/lend: Write operations (deposit, withdraw, borrow, repay)
Agent usage
Example prompts you can use to demo Jupiter Lend integrations:
- Discover all available vaults and list them
- Fetch all vault positions for a user
- Deposit collateral and borrow in a single transaction
- Repay max debt and withdraw max collateral for a position
- Get user Earn (jlToken) positions and underlying balances
- Build a flashloan for arbitrage or liquidation
- Get liquidity rates and APY for a token
- Create a new vault position (positionId 0), deposit collateral, and borrow
SDK Installation
# For read operations (queries, prices, positions)
npm install @jup-ag/lend-read
# For write operations (transactions)
npm install @jup-ag/lend
1. Key Concepts & Protocol Jargon
Understanding the architecture and terminology of Jupiter Lend will help you build better integrations.
Architecture: The Two-Layer Model
- Liquidity Layer (Single Orderbook): The foundational layer where all assets reside. It manages token limits, rate curves, and unified liquidity. Users never interact with this directly.
- Protocol Layer: User-facing modules (Lending and Vaults) that sit on top of the Liquidity Layer and interact with it via Cross-Program Invocations (CPIs).
Terminology
- jlToken (Jupiter Lend Token): The yield-bearing asset you receive when supplying tokens to the Lending protocol (e.g.,
jlUSDC). As interest accrues, the exchange rate increases, making yourjlTokenworth more underlyingUSDC. - Exchange Price: The conversion rate used to translate between "raw" stored amounts and actual token amounts. It continuously increases as interest is earned on supply or accrued on debt.
- Collateral Factor (CF): The maximum Loan-to-Value (LTV) ratio allowed when opening or managing a position.
- Liquidation Threshold (LT): The LTV at which a position becomes undercollateralized and eligible for liquidation.
- Liquidation Max Limit (LML): The absolute maximum LTV limit. If a position's risk ratio exceeds this boundary, it is automatically absorbed by the protocol to protect liquidity providers.
- Liquidation Penalty: The discount percentage offered to liquidators when they repay debt on behalf of a risky position.
- Rebalance: An operation that synchronizes the upper protocol layer's accounting (Vaults/Lending) with its actual position on the Liquidity layer. It also syncs the orderbook to account for any active accrued rewards.
- Tick-based Architecture: The Vaults protocol groups positions into "ticks" based on their risk level (debt-to-collateral ratio). This allows the protocol to efficiently manage risk and process liquidations at scale.
- Dust Borrow: A tiny residual amount of debt intentionally kept on positions to handle division rounding complexities.
- Sentinel Values: Constants like
MAX_WITHDRAW_AMOUNTandMAX_REPAY_AMOUNTthat tell the protocol to dynamically calculate and withdraw/repay the maximum mathematically possible amount for a position.
Amounts and units
All SDK amounts use base units (smallest token unit, e.g. 1_000_000 = 1 USDC for 6 decimals).
2. Jupiter Earn (Lending)
Jupiter Earn allows users to supply assets to earn yield. In return, users receive yield-bearing jlTokens (e.g., jlUSDC).
Lending Module (jlTokens)
Access jlToken (Jupiter Lend token) markets, exchange prices, and user positions.
// Get all jlToken details at once
const allDetails = await client.lending.getAllJlTokenDetails();
// Get user's jlToken balance
const position = await client.lending.getUserPosition(USDC, userPublicKey);
Lending (Earn)
Deposit underlying assets to receive yield-bearing tokens, or withdraw them.
import { getDepositIxs, getWithdrawIxs } from "@jup-ag/lend/earn";
import BN from "bn.js";
// Deposit 1 USDC (base units: 1_000_000 for 6 decimals)
const { ixs: depositIxs } = await getDepositIxs({
amount: new BN(1_000_000),
asset: USDC_PUBKEY,
signer: userPublicKey,
connection,
});
// Withdraw 0.1 USDC (100_000 base units @ 6 decimals)
const { ixs: withdrawIxs } = await getWithdrawIxs({
amount: new BN(100_000),
asset: USDC_PUBKEY,
signer: userPublicKey,
connection,
});
3. Jupiter Borrow (Vaults)
Vaults handle collateral deposits and debt borrowing.
Vault Module & Discovery
Access vault configurations, positions, exchange prices, and liquidation data. This is crucial for dynamically listing all available leverage markets.
// Discover all available vaults
const allVaults = await client.vault.getAllVaults();
const totalVaults = allVaults.length;
// Get comprehensive vault data (config + state + rates + limits) for a specific vault
const vaultId = 1;
const vaultData = await client.vault.getVaultByVaultId(vaultId);
// Check borrowing limits dynamically before prompting users
const borrowLimit = vaultData.limitsAndAvailability.borrowLimit;
const borrowable = vaultData.limitsAndAvailability.borrowable;
Finding User Vault Positions
Before making Vault operations (like deposit, borrow, or repay), you need to know a user's existing positionId (which maps to an NFT).
const userPublicKey = new PublicKey("YOUR_WALLET_PUBKEY");
// Retrieve all positions owned by the user
// Each position includes full vault data: NftPosition & { vault: VaultEntireData }
const positions = await client.vault.getAllUserPositions(userPublicKey);
positions.forEach((p) => {
console.log(`Position ID (nftId): ${p.nftId}`);
console.log(`Vault ID: ${p.vault.constantViews.vaultId}`);
console.log(`Collateral Supplied: ${p.supply.toString()}`);
console.log(`Debt Borrowed: ${p.borrow.toString()}`);
});
Vaults (Borrow)
Vaults handle collateral deposits and debt borrowing. All vault operations use the getOperateIx function.
The direction of the operation is determined by the sign of colAmount and debtAmount:
- Deposit:
colAmount> 0,debtAmount= 0 - Withdraw:
colAmount< 0,debtAmount= 0 - Borrow:
colAmount= 0,debtAmount> 0 - Repay:
colAmount= 0,debtAmount< 0
Sentinels: MAX_REPAY_AMOUNT and MAX_WITHDRAW_AMOUNT are already signed (negative); pass them as-is—do not call .neg() on them.
Important: If positionId is 0, a new position NFT is created, and the SDK returns the new positionId.
Common Vault Patterns
1. Deposit Collateral
import { getOperateIx } from "@jup-ag/lend/borrow";
// Deposit 1 USDC (base units: 1_000_000 for 6 decimals)
const { ixs, addressLookupTableAccounts, positionId: newPositionId } = await getOperateIx({
vaultId: 1,
positionId: 0, // 0 = create new position
colAmount: new BN(1_000_000), // Positive = Deposit
debtAmount: new BN(0),
connection,
signer,
});
2. Borrow Debt
// Borrow 0.5 USDC (500_000 base units @ 6 decimals)
const { ixs, addressLookupTableAccounts } = await getOperateIx({
vaultId: 1,
positionId: EXISTING_POSITION_ID, // Use the nftId retrieved from the read SDK
colAmount: new BN(0),
debtAmount: new BN(500_000), // Positive = Borrow (0.5 USDC @ 6 decimals)
connection,
signer,
});
3. Repay Debt (Using Max Sentinel)
When users want to repay their entire debt, do not try to calculate exact dust amounts. Use the MAX_REPAY_AMOUNT sentinel exported by the SDK.
import { getOperateIx, MAX_REPAY_AMOUNT } from "@jup-ag/lend/borrow";
const { ixs, addressLookupTableAccounts } = await getOperateIx({
vaultId: 1,
positionId: EXISTING_POSITION_ID,
colAmount: new BN(0),
debtAmount: MAX_REPAY_AMOUNT, // Tells the protocol to clear the full debt
connection,
signer,
});
4. Withdraw Collateral (Using Max Sentinel)
Similarly, to withdraw all available collateral, use the MAX_WITHDRAW_AMOUNT sentinel.
import { getOperateIx, MAX_WITHDRAW_AMOUNT } from "@jup-ag/lend/borrow";
const { ixs, addressLookupTableAccounts } = await getOperateIx({
vaultId: 1,
positionId: EXISTING_POSITION_ID,
colAmount: MAX_WITHDRAW_AMOUNT, // Tells the protocol to withdraw everything
debtAmount: new BN(0),
connection,
signer,
});
5. Combined operate
You can batch multiple operations—such as depositing + borrowing, or repaying + withdrawing—in a single transaction using getOperateIx:
- a. Deposit + Borrow in one Tx:
Pass both
colAmountanddebtAmountto deposit collateral and borrow simultaneously.const { ixs, addressLookupTableAccounts } = await getOperateIx({ vaultId: 1, positionId: 0, // Create new position colAmount: new BN(1_000_000), // Deposit 1 USDC (6 decimals) debtAmount: new BN(500_000), // Borrow 0.5 USDC (6 decimals) connection, signer, }); - b. Repay + Withdraw in one Tx:
Repay debt and withdraw collateral at once. Use max sentinels for a full repayment or to withdraw the maximum available.
import { getOperateIx, MAX_WITHDRAW_AMOUNT, MAX_REPAY_AMOUNT } from "@jup-ag/lend/borrow"; const { ixs, addressLookupTableAccounts } = await getOperateIx({ vaultId: 1, positionId: EXISTING_POSITION_ID, colAmount: MAX_WITHDRAW_AMOUNT, // Withdraw all collateral debtAmount: MAX_REPAY_AMOUNT, // Repay all debt connection, signer, });
4. Flashloans
Flashloans allow you to borrow liquidity from the protocol without requiring upfront collateral. Return the borrowed amount within the exact same transaction—there are no flashloan fees. Borrow the asset you need directly for arbitrage, liquidations, or other use cases.
Executing a Flashloan (@jup-ag/lend)
The @jup-ag/lend SDK provides simple helper functions to retrieve the instructions needed to execute a flashloan. The most convenient way is using getFlashloanIx.
import { getFlashloanIx } from "@jup-ag/lend/flashloan";
import { Connection, PublicKey, TransactionMessage, VersionedTransaction } from "@solana/web3.js";
import BN from "bn.js";
async function executeFlashloan() {
const connection = new Connection("https://api.mainnet-beta.solana.com");
const signer = new PublicKey("YOUR_WALLET_PUBKEY");
const asset = new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"); // USDC
const borrowAmount = new BN(100_000_000); // 100 USDC (base units, 6 decimals)
// 1. Get the borrow and payback instructions
const { borrowIx, paybackIx } = await getFlashloanIx({
connection,
signer,
asset,
amount: borrowAmount,
});
// 2. Define your custom instructions that utilize the borrowed funds
const myCustomArbitrageInstructions = [
// ... your instructions here
];
// 3. Assemble the transaction: Borrow -> Custom Logic -> Payback
const instructions = [
borrowIx,
...myCustomArbitrageInstructions,
paybackIx
];
const latestBlockhash = await connection.getLatestBlockhash();
const message = new TransactionMessage({
payerKey: signer,
recentBlockhash: latestBlockhash.blockhash,
instructions,
}).compileToV0Message();
const transaction = n
Truncated for display — read the full file on GitHub.
Related Skills
ai-job-search
44.3kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
