Skip to main content
API REFERENCEFor the full request and response schemas, see the Lend API Reference.
The Borrow API lets you read borrow vaults and user positions, and build borrow transactions. Borrowing uses a single universal operate endpoint: one call can create a position, deposit collateral, borrow, repay, and withdraw, driven by signed colAmount and debtAmount values. Positions are represented as NFTs.

Prerequisite

Set up RPC
NOTESolana provides a default RPC endpoint. As your application grows, provision your own or a 3rd party provider’s RPC endpoint such as Helius or Triton.
Set up Development Wallet

Markets

All borrow endpoints accept an optional market parameter: main (default) or ethena. Pass it as a query parameter (?market=ethena) on any endpoint, including operate calls. Omitting it uses the main market. Vault and position IDs are scoped to a market. The same vaultId refers to a different vault in main than in ethena, so always pass the same market to operate that you used to read the vault or position.

Read vault and position data

Use the read endpoints to discover vaults and inspect user positions. Both accept GET requests.

Vaults

GET https://api.jup.ag/lend/v1/borrow/vaults returns every borrow vault with its collateral token (supplyToken), borrow token (borrowToken), risk parameters, rates, and available liquidity. The id field is the vaultId you pass to operate calls.
Each vault reports collateralFactor (max LTV, where 800 corresponds to 80%), liquidationThreshold, borrowable and withdrawable (available liquidity in base units), and minimumBorrowing (the smallest non-zero debt a position may hold).

Positions

GET https://api.jup.ag/lend/v1/borrow/positions?users={user1},{user2} returns the borrow positions for one or more wallets (comma-separated). Each position reports its NFT id, vaultId, supply (collateral), borrow (debt), and dustBorrow (residual debt including accrued interest).

Operate

POST https://api.jup.ag/lend/v1/borrow/operate builds a borrow transaction from an OperatePayload. The operation performed is determined by the sign of colAmount (collateral) and debtAmount (debt): MIN_I128 is the literal string -170141183460469231731687303715884105728. The OperatePayload fields:
The response includes nftId (the position NFT ID, newly assigned when positionId was 0) and a base64-encoded unsigned VersionedTransaction. The API creates the borrow-token associated token account for the signer when it does not already exist, so borrowing to a fresh wallet works without adding a create-account instruction. You do not need to pre-create the output token account.

Native SOL (WSOL) handling

The API does not wrap or unwrap native SOL. This matters whenever a vault’s supplyToken or borrowToken is So11111111111111111111111111111111111111112 (WSOL):
  • Depositing WSOL collateral: wrap SOL into your WSOL token account first. Without a funded WSOL account, the deposit fails with a token-program insufficient funds error. Wrap slightly more than you deposit: depositing your exact WSOL balance can fail because the transfer rounds up by a few base units.
  • Borrowing or withdrawing WSOL: you receive wrapped SOL in your WSOL token account. Close the account yourself if you want native SOL back.
Repaying the exact borrow amount can leave interest dust below minimumBorrowing, which fails with VaultUserDebtTooLow. Repay with debtAmount: MIN_I128 to clear all debt before closing a position.

Build your own transaction

The Borrow API provides two ways to build an operate transaction. Use /operate for a ready-to-sign transaction, or /operate-instructions when you need the raw instructions to compose with other instructions or for CPI.

Transaction

Call /operate (above), deserialize the base64 transaction, sign, and send.

Instructions

POST https://api.jup.ag/lend/v1/borrow/operate-instructions takes the same OperatePayload and returns { nftId, instructions, addressLookupTableAddresses }. Resolve the address lookup tables and compile a v0 transaction.

CPI

Full code example

Create a position, deposit collateral, then borrow against it. The borrow step uses /operate-instructions to show the address lookup table flow.

Borrow API Reference

Full request and response schemas for vaults, positions, operate, and operate-instructions.

Read SDK

Read vault config, state, and user positions with @jup-ag/lend-read.

Borrow SDK operations

Build operate flows (create, deposit, borrow, repay, withdraw) with @jup-ag/lend.

Borrow CPI

Cross-program invocation for vault operations.