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.
How Vault APY Is Calculated
Vault APY is a blended rate based on the reserves the vault’s capital is deployed across.
Vault APY ≈ Σ (Reserve APY × Allocation Weight)
Each reserve earns yield based on its utilization and borrow rate. A reserve at 80% utilization earning 8% APY contributes to the vault’s total yield based on its allocation weight, the share of capital deployed there. Allocation weights sum to 100% across all active reserves.
Example — a USDC vault with two allocations:
Reserve Allocation APY USDC Main Market 60% 8% USDC JLP Market 40% 12%
Blended APY = (60% × 8%) + (40% × 12%) = 9.6%
Underlying borrow rates and utilization levels change continuously, so vault APY fluctuates. Quoted APYs are trailing averages and are not guaranteed forward-looking rates.
The displayed APY includes base interest from borrowers plus KMNO emissions when active. APY accounts for compounding. In Kamino vaults, earnings are continuously reinvested, increasing the vault share price over time.
Fetch All Vaults Retrieve the list of all available vaults on Kamino. const API_BASE_URL = 'https://api.kamino.finance' ;
const response = await fetch ( ` ${ API_BASE_URL } /kvaults/vaults` );
const vaults = await response . json ();
The /kvaults/vaults endpoint returns all vaults with basic information including vault addresses, token mints, and strategies.
Get APY for Each Vault Fetch APY metrics for all vaults in parallel using the vault public keys. // Fetch all vault metrics in parallel
const vaultMetrics = await Promise . all (
vaults . map ( async ( vault ) => {
const response = await fetch (
` ${ API_BASE_URL } /kvaults/vaults/ ${ vault . address } /metrics`
);
const metrics = await response . json ();
return {
address: vault . address ,
apy7d: metrics . apy7d ,
apy30d: metrics . apy30d ,
apy90d: metrics . apy90d ,
};
})
);
// Display all vault APYs
vaultMetrics . forEach (( vault ) => {
console . log ( ` \n ${ vault . address } :` );
console . log ( ` 7-day APY: ${ ( vault . apy7d * 100 ). toFixed ( 2 ) } %` );
console . log ( ` 30-day APY: ${ ( vault . apy30d * 100 ). toFixed ( 2 ) } %` );
console . log ( ` 90-day APY: ${ ( vault . apy90d * 100 ). toFixed ( 2 ) } %` );
});
The /kvaults/vaults/{pubkey}/metrics endpoint returns historical APY data across multiple timeframes (7-day, 24-hour, 30-day, 90-day, 180-day, 365-day).
You now have APY data for all vaults across multiple timeframes.
Import Dependencies Import the required packages for Solana RPC communication and Kamino SDK. import { createSolanaRpc } from '@solana/kit' ;
import { KaminoManager , KaminoVault } from '@kamino-finance/klend-sdk' ;
Initialize SDK Set up the RPC connection and create a Kamino Manager instance. const rpc = createSolanaRpc ( 'https://api.mainnet-beta.solana.com' );
const kaminoManager = new KaminoManager ( rpc , 400 );
Get All Vaults Retrieve all available vaults using the Kamino Manager. const vaults = await kaminoManager . getAllVaults ();
Get APYs for Each Vault Fetch APY data for all vaults in parallel. // Fetch APYs for all vaults in parallel
const vaultAPYs = await Promise . all (
vaults . map ( async ( vaultData ) => {
const vault = new KaminoVault ( rpc , vaultData . address );
const apys = await vault . getAPYs ();
return {
address: vaultData . address . toString (),
name: vaultData . state ?. name ,
actualAPY: apys . actualAPY . netAPY ,
theoreticalAPY: apys . theoreticalAPY . netAPY ,
};
})
);
// Display all vault APYs
vaultAPYs . forEach (( vault ) => {
console . log ( ` \n ${ vault . address } :` );
console . log ( ` Actual APY: ${ vault . actualAPY } ` );
console . log ( ` Theoretical APY: ${ vault . theoreticalAPY } ` );
});
The vault.getAPYs() method returns theoreticalAPY and actualAPY, each containing grossAPY and netAPY (after fees) calculated from on-chain state.
You’ve successfully fetched vault APYs using the Kamino SDK.
Lending Vaults Concepts Learn how vaults work under the hood
Vault Data Query vault metrics and positions
Benchmark Rate Compare vault yields to market baseline
Earn Deposit Deposit into vaults via API