@jup-ag/lend-read SDK provides a Liquidity module to fetch real-time market data, interest rates, and raw user balances.
The Liquidity module is read-only. To supply or borrow assets, use the Earn or Borrow modules instead.
Understanding the Data
Exchange Prices
Exchange Prices
supplyExchangePrice & borrowExchangePrice: These convert the protocol’s raw internal accounting numbers into actual token amounts. As interest accrues, these prices increase. The SDK methods (like getUserSupplyData) automatically apply these exchange prices to give you human-readable token amounts.Utilisation
Utilisation
lastStoredUtilization: The ratio of borrowed assets to supplied assets. High utilisation drives up both supply and borrow interest rates.Limits
Limits
withdrawalLimit & borrowLimit: To protect against flash crashes or bank runs, Jupiter Lend implements automated expanding limits. You can query withdrawable and borrowable on user data objects to see exactly how much liquidity a user can move in the current block.Discovering Markets
UselistedTokens() as your starting point to dynamically discover which markets exist on Jupiter Lend. This fetches an array of all supported token mints (PublicKey objects) that have initialised reserves in the Liquidity protocol, allowing your application to automatically support new tokens as they are added without hardcoding addresses.
Calculating Real-Time Prices
Because interest accrues constantly, the stored on-chain price is slightly outdated until someone interacts with the protocol. These methods let you fetch the raw rate configuration and calculate the exact real-time exchange price locally, which is useful for accurate dashboards and avoiding stale data.Querying Market Data
This is the core method for building APY aggregators and TVL dashboards. It fetches comprehensive market data includingsupplyRate and borrowRate (to determine APYs in basis points), lastStoredUtilization (to see how much capital is being borrowed), and total supply/borrow metrics. You can fetch a single token or all tokens simultaneously.
Querying User Balances
These methods return a specific user’s exact balance for a given token. The returnedsupply or borrow amounts are already adjusted by real-time exchange prices, meaning they accurately reflect any interest earned or owed. They also return expanding limits dictating how much liquidity the user can instantly move.
