Skip to main content
All vault and position data here is read from on-chain accounts using the Jupiter Lend Read SDK. No API calls are required.
Exchange prices are in 1e12 decimals. Balances are in 1e9 decimals.

Reading vault data with the SDK

Use the Read SDK to list vaults, read vault config and state, and get user positions (collateral, debt, liquidation status). The SDK uses your RPC to read the Vault program accounts.
1

Create a client

Create a Client with an RPC URL or a Solana Connection. Use client.vault for all vault and position reads.
2

Get all vaults

Fetch full data for every vault in one call: config, state, exchange prices, limits, and availability. Use getAllVaults() for listing markets or building a vault selector.
3

Get vault by ID

Fetch full vault data for a single vault: config, state, exchange prices, limits, and availability. Use getVaultByVaultId(vaultId) when you know the vault ID.
4

Get vault config

Fetch only the vault configuration: supply and borrow token mints, oracle, rebalancer, and risk parameters (collateral factor, liquidation threshold, fees).
5

Get vault state

Fetch the vault’s current state: total supply, total borrow, exchange prices, branch info, and next position ID.
6

Get all user positions

Get all positions owned by a user across all vaults. Returns NftPosition & { vault: VaultEntireData } — each position includes full vault data. Use this for dashboards or portfolio views.
7

Get position by vault and NFT id

Get a single position by vault ID and position (NFT) id. Returns NftPosition & { vault: VaultEntireData } — position fields flattened with full vault data. Use getPositionByVaultId(vaultId, nftId) when you have both IDs.
8

Get raw user position

Fetch the raw position account by vaultId and positionId. Returns the on-chain account or null. Use when you need the low-level position without decoded state.
9

Get current position state

From a raw position, get the computed state: collateral (colRaw), debt (debtRaw), dust, and whether the position is liquidated. Pass the result of getUserPosition.
10

Preview final position

Preview how a position would look after adding collateral or debt (without sending a transaction). Pass optional newColAmount and newDebtAmount as BN; use zero for no change.
11

Get all position IDs for a vault

Get the list of all position IDs (1 to totalPositions) for a vault. Use this with batchGetUserPositions when you need to iterate over every position in a vault.
12

Get all positions with risk ratio

For a vault, fetch all positions with a computed risk ratio (borrow/supply). Useful for dashboards or liquidation-risk views.
13

Get position NFT owner

Resolve the owner of a position NFT (position mint). Use when you have the position mint and need the wallet that owns the position.

SDK types

NftPosition (with vault)

Returned by getAllUserPositions and getPositionByVaultId as NftPosition & { vault: VaultEntireData }:

User position (raw)

Returned by getUserPosition:

Vault config

Returned by getVaultConfig and inside getVaultByVaultId:

Vault state

Returned by getVaultState and inside vault data: