Skip to main content

Documentation Index

Fetch the complete documentation index at: https://kamino.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

When a Multiply position is opened, Kamino’s on-chain program immediately begins tracking and updating position health metrics. These metrics update with every transaction that affects the position and recalculate based on current collateral prices and debt accrual. The protocol stores six core metrics that describe position size, leverage level, borrowing capacity, and liquidation risk.

Position Health Metrics

MetricDescription
Total DepositThe total USD value of all collateral deposited into the position
Total BorrowThe total USD value of debt owed on the position
Net ValueEquity in the position. Calculated as Total Deposit - Total Borrow. Represents the value that would be received if all debt were repaid and collateral withdrawn
LeverageCapital amplification multiplier. 1x = no leverage (collateral only), 2x = borrowed amount equals deposit, 3x = borrowed twice the deposit amount
Borrow LimitMaximum borrowing capacity before approaching liquidation threshold. Total Borrow must remain below this value
Liquidation LTVThe loan-to-value percentage at which the position becomes eligible for liquidation. Varies by asset pair and eMode settings
Leverage amplifies both gains and losses. When Current LTV approaches Liquidation LTV, the position risks partial liquidation. When borrow rates exceed collateral yield, Net APY turns negative and debt grows faster than earnings. Regular monitoring enables integrations to alert users when conditions warrant position adjustment—whether through debt repayment, leverage reduction, or position closure.

Get Position Health Metrics

1

Import Dependencies

Import the required packages for Solana RPC communication and Kamino SDK operations.
import { createSolanaRpc, address } from '@solana/kit';
import {
  KaminoMarket,
  parseKeypairFile,
  ObligationTypeTag,
  DEFAULT_RECENT_SLOT_DURATION_MS
} from '@kamino-finance/klend-sdk';
2

Load Market and Initialize RPC

Load the keypair, initialize RPC connection, and load the xStocks market.
const KEYPAIR_FILE = '/path/to/your/keypair.json';

const signer = await parseKeypairFile(KEYPAIR_FILE);

const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');

const marketPubkey = address('5wJeMrUYECGq41fxRESKALVcHnNX26TAWy4W98yULsua'); // xStocks Market
const market = await KaminoMarket.load(rpc, marketPubkey, DEFAULT_RECENT_SLOT_DURATION_MS);
3

Fetch Multiply Obligations

Retrieve all multiply obligations for the wallet address using the obligation type filter.
const obligations = await market!.getUserObligationsByTag(
  ObligationTypeTag.Multiply,
  address(signer.address)
);

if (obligations.length === 0) {
  console.log('No multiply obligations found.');
}
getUserObligationsByTag filters obligations by type. For example, use ObligationTypeTag.Multiply to retrieve only multiply positions.

ObligationTypeTag Values:
TypeValue & Description
ObligationTypeTag.Vanilla0: Cross-collateral mode positions
ObligationTypeTag.Multiply1: Leveraged positions created via Multiply
ObligationTypeTag.Lending2: Lending-only positions
ObligationTypeTag.Leverage3: Legacy leverage positions
4

Read Position Health Metrics

Access the position health statistics from each obligation’s refreshedStats.
obligations.forEach((obligation) => {
  console.log(`\nObligation Address: ${obligation.obligationAddress}`);

  console.log(`Stats:`);
  console.log(`  Total Deposit: $${obligation.refreshedStats.userTotalDeposit.toFixed(2)}`);
  console.log(`  Total Borrow: $${obligation.refreshedStats.userTotalBorrow.toFixed(2)}`);
  console.log(`  Net Value: $${obligation.refreshedStats.userTotalDeposit.minus(obligation.refreshedStats.userTotalBorrow).toFixed(2)}`);
  console.log(`  Leverage: ${obligation.refreshedStats.leverage.toFixed(2)}x`);
  console.log(`  Borrow Limit: $${obligation.refreshedStats.borrowLimit.toFixed(2)}`);
  console.log(`  Liquidation LTV: ${obligation.refreshedStats.liquidationLtv.toFixed(2)}%`);
});
You now have access to all position health metrics including leverage, borrowing capacity, and liquidation thresholds.

Liquidation LTV by Asset Pair

ModeAsset PairLiquidation LTVMax Leverage
StandardSOL / USDC75%4x
StandardTSLAx / USDC65%~2.9x
eMode (Main)mSOL, bSOL, JupSOL / SOL~87%~7.7x
eMode (Jito)JitoSOL / SOL90%10x
No eModeJLP / USDC67%~3.2x
For detailed leverage calculations and eMode mechanics, see LTV and Leverage Concepts.