Borrow
Import Dependencies
Import the required packages for Solana RPC, Jupiter Lend borrow SDK, and versioned transaction building.
Borrow uses
getOperateIx with zero colAmount and positive debtAmount. The borrowed asset is sent to your wallet.Load Keypair and Initialise Connection
Load the signer and create the RPC connection. Set vault ID, position ID, and borrow amount.
Build Borrow Instructions
Build operate instructions with no collateral change and positive debt amount.
Borrow is operate with
colAmount = 0 and debtAmount > 0. The borrow token is sent to your wallet; you accrue interest until you Repay.Build and Sign Transaction
Build a v0 message with the instructions and address lookup tables, then sign.
Operate parameters
getOperateIx accepts the following parameters:
For borrow:
colAmount = 0, debtAmount > 0.
How much can you borrow?
How much can you borrow?
Your maximum borrow depends on your collateral value, the vault’s loan-to-value (LTV) limits, and current borrows. Keep LTV below the liquidation threshold, which you can read from the vault config. The SDK does not provide a “max borrow” sentinel. Compute the maximum from your position (e.g.
getCurrentPosition or getFinalPosition) and the vault’s LTV, or use your app/API for the limit.Interest
Interest
Borrowed amounts accrue interest over time. Repay to reduce debt and stop interest on the repaid portion.
