jup-ag/agent-skills/jupiter-lend
Claude Code and agent skill by jup-ag/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
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
npx vskill@latest install jup-ag/agent-skills/jupiter-lendSKILL.md
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
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.
Lending (Earn)
Deposit underlying assets to receive yield-bearing tokens, or withdraw them.
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.
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).
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
2. Borrow Debt
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.
4. Withdraw Collateral (Using Max Sentinel) Similarly, to withdraw all available collateral, use the MAX_WITHDRAW_AMOUNT sentinel.
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 colAmount and debtAmount to deposit collateral and borrow simultaneously. ``typescript 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. ```typescript 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.
5. Liquidity
The Liquidity layer is the foundation of Jupiter Lend, holding all the underlying assets. While you usually interact with the Earn and Borrow layers, querying the Liquidity layer directly is highly useful for analytics, dashboards, and APY aggregators.
Liquidity Module
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/jupiter-lend/SKILL.md
Popularity
- Repository stars
- 61
- Repository forks
- 14
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 22 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jup-ag/agent-skills/jupiter-lend)