← Protocols
Kamino
01Description

Solana lending market (KLend) plus automated liquidity vaults that manage CLMM positions on Orca, Raydium, and Meteora. Major venue for SOL and LST collateral, multiply (looped leverage) flows, and kVaults yield strategies.

02Best for
  • 01Solana lending and borrowing
  • 02leveraged LST/SOL multiply positions
  • 03automated CLMM liquidity (kVaults)
  • 04SOL-denominated yield strategies
  • 05stablecoin deposits with Pyth-priced collateral
03Install
  • pnpm add @kamino-finance/klend-sdk @solana/web3.js @coral-xyz/anchor decimal.js
04Environment variables
VariableScopeDescription
SOLANA_RPC_URLServerSolana mainnet RPC. KLend market refreshes scan many reserve and oracle accounts — use a paid RPC.
05Prompt snippet
Use `@kamino-finance/klend-sdk`. Initialize a market: `const market = await KaminoMarket.load(connection, MAIN_MARKET, slot, programId)`; refresh reserves with `await market.loadReserves()`. Build a user obligation via `KaminoAction.buildDepositTxns(market, amountLamports, mint, userPubkey)` for deposit, `buildBorrowTxns` for borrow, `buildRepayTxns` / `buildWithdrawTxns` for repay/withdraw. Each helper returns instructions you wrap in a `VersionedTransaction` with priority fees and a compute budget bump. For multiply / leveraged positions use the `KaminoMultiply` flows or compose KLend with Jupiter swaps in the same tx via flash-loan style atomic execution.
06Gotchas
  • Every KLend instruction must be preceded by `refreshReserve` ixs for ALL reserves your obligation touches AND `refreshObligation` — the SDK builders include them, but if you compose manually you'll get `MathOverflow` or stale-price errors.
  • Compute units: a deposit/borrow with 4–5 reserves can need 800k+ CU. Always set `ComputeBudgetProgram.setComputeUnitLimit({ units: 1_400_000 })` + a priority fee.
  • KLend uses Pyth + Switchboard oracles — if either is stale (confidence too wide or `slotsStale > maxAge`) the reserve refresh fails and txs revert. Surface oracle-stale errors clearly.
  • Liquidations can happen the same slot a price drops — for leveraged multiply positions, monitor LTV against `unhealthyLtv` and unwind preemptively; do not rely on grace periods.
  • kVaults rebalance CLMM positions on Orca/Raydium/Meteora — withdrawals during rebalance can revert; retry with backoff and warn users about momentary unavailability.
  • Token-2022 collateral support varies by reserve — check `reserve.config.tokenInfo.assetType` before assuming SPL Token program.
07Alternatives