# Table of Contents - [Overview - Kamino Docs](#overview-kamino-docs) - [Building with LLMs - Kamino Docs](#building-with-llms-kamino-docs) - [Get airdrop metrics - Kamino Docs](#get-airdrop-metrics-kamino-docs) - [Get KLend reserve history - Kamino Docs](#get-klend-reserve-history-kamino-docs) - [Get KLend reward history - Kamino Docs](#get-klend-reward-history-kamino-docs) - [Get all Kamino Markets config - Kamino Docs](#get-all-kamino-markets-config-kamino-docs) - [Get Kamino Market config - Kamino Docs](#get-kamino-market-config-kamino-docs) - [Get metrics for leverage/multiply vaults - Kamino Docs](#get-metrics-for-leverage-multiply-vaults-kamino-docs) - [Get KLend market reserves account data - Kamino Docs](#get-klend-market-reserves-account-data-kamino-docs) - [Get metrics for market reserves - Kamino Docs](#get-metrics-for-market-reserves-kamino-docs) - [Get user airdrop allocations - Kamino Docs](#get-user-airdrop-allocations-kamino-docs) - [Overview - Kamino Docs](#overview-kamino-docs) - [Agent Integrations: Using OpenClaw with Kamino - Kamino Docs](#agent-integrations-using-openclaw-with-kamino-kamino-docs) - [Get profit and loss for an obligation - Kamino Docs](#get-profit-and-loss-for-an-obligation-kamino-docs) - [Kamino API - Kamino Docs](#kamino-api-kamino-docs) - [Get KLend rewards - Kamino Docs](#get-klend-rewards-kamino-docs) - [Get KLend obligation history - Kamino Docs](#get-klend-obligation-history-kamino-docs) - [Get total strategy TVL - Kamino Docs](#get-total-strategy-tvl-kamino-docs) - [Claim Rewards - Kamino Docs](#claim-rewards-kamino-docs) - [Kamino Portfolio API - Kamino Docs](#kamino-portfolio-api-kamino-docs) - [Get user KVault PnL - Kamino Docs](#get-user-kvault-pnl-kamino-docs) - [Get user position for a specific KVault - Kamino Docs](#get-user-position-for-a-specific-kvault-kamino-docs) - [Get user KVault transactions - Kamino Docs](#get-user-kvault-transactions-kamino-docs) - [Claim User Rewards - Kamino Docs](#claim-user-rewards-kamino-docs) - [Install and Setup the Kamino CLI - Kamino Docs](#install-and-setup-the-kamino-cli-kamino-docs) - [Get all KVault season rewards - Kamino Docs](#get-all-kvault-season-rewards-kamino-docs) - [Get user KVault PnL history - Kamino Docs](#get-user-kvault-pnl-history-kamino-docs) - [Get information about a loan (obligation) - Kamino Docs](#get-information-about-a-loan-obligation-kamino-docs) - [Borrow Overview - Kamino Docs](#borrow-overview-kamino-docs) - [Get Vault APYs - Kamino Docs](#get-vault-apys-kamino-docs) - [Earn Deposit with the API - Kamino Docs](#earn-deposit-with-the-api-kamino-docs) - [Earn Withdraw with the API - Kamino Docs](#earn-withdraw-with-the-api-kamino-docs) - [Kamino Program Addresses - Kamino Docs](#kamino-program-addresses-kamino-docs) - [Get user transactions - Kamino Docs](#get-user-transactions-kamino-docs) - [Vault Operations - Kamino Docs](#vault-operations-kamino-docs) - [Get summary of the KVault program earnings - Kamino Docs](#get-summary-of-the-kvault-program-earnings-kamino-docs) - [Earn Overview - Kamino Docs](#earn-overview-kamino-docs) - [Get borrow order fills for an obligation - Kamino Docs](#get-borrow-order-fills-for-an-obligation-kamino-docs) - [Get farm transactions - Kamino Docs](#get-farm-transactions-kamino-docs) - [Get transaction to withdraw from a kvault - Kamino Docs](#get-transaction-to-withdraw-from-a-kvault-kamino-docs) - [Get transaction to borrow liquidity from a klend reserve - Kamino Docs](#get-transaction-to-borrow-liquidity-from-a-klend-reserve-kamino-docs) - [Get instructions to withdraw from a klend reserve - Kamino Docs](#get-instructions-to-withdraw-from-a-klend-reserve-kamino-docs) - [Get transaction to withdraw from a klend reserve - Kamino Docs](#get-transaction-to-withdraw-from-a-klend-reserve-kamino-docs) - [Get historical user metrics for a single KVault - Kamino Docs](#get-historical-user-metrics-for-a-single-kvault-kamino-docs) - [Get KVault by address - Kamino Docs](#get-kvault-by-address-kamino-docs) - [Get strategy fees and rewards - Kamino Docs](#get-strategy-fees-and-rewards-kamino-docs) - [Oracle - Kamino Docs](#oracle-kamino-docs) - [Calculate Extra Farm Reward APY - Kamino Docs](#calculate-extra-farm-reward-apy-kamino-docs) - [Get user farm transactions - Kamino Docs](#get-user-farm-transactions-kamino-docs) - [Get transaction to deposit into a klend reserve - Kamino Docs](#get-transaction-to-deposit-into-a-klend-reserve-kamino-docs) - [Get all strategies - Kamino Docs](#get-all-strategies-kamino-docs) - [Get user rewards history - Kamino Docs](#get-user-rewards-history-kamino-docs) - [Get user PnL history - Kamino Docs](#get-user-pnl-history-kamino-docs) - [Earn Withdraw with the SDK - Kamino Docs](#earn-withdraw-with-the-sdk-kamino-docs) - [Building with LLMs - Kamino Docs](#building-with-llms-kamino-docs) - [Multiply Repay with xStocks - Kamino Docs](#multiply-repay-with-xstocks-kamino-docs) - [Get Market Reserve APYs - Kamino Docs](#get-market-reserve-apys-kamino-docs) - [Get recent Solana slot duration - Kamino Docs](#get-recent-solana-slot-duration-kamino-docs) - [Calculate Reserve Reward APY - Kamino Docs](#calculate-reserve-reward-apy-kamino-docs) - [Refresh Prices - Kamino Docs](#refresh-prices-kamino-docs) - [Harvest - Kamino Docs](#harvest-kamino-docs) - [Get transaction to deposit into a kvault - Kamino Docs](#get-transaction-to-deposit-into-a-kvault-kamino-docs) - [Get instructions to deposit into a klend reserve - Kamino Docs](#get-instructions-to-deposit-into-a-klend-reserve-kamino-docs) - [Get user PnL - Kamino Docs](#get-user-pnl-kamino-docs) - [Get all kvaults - Kamino Docs](#get-all-kvaults-kamino-docs) - [Get historical user metrics for all KVault positions - Kamino Docs](#get-historical-user-metrics-for-all-kvault-positions-kamino-docs) - [Deposit with the API - Kamino Docs](#deposit-with-the-api-kamino-docs) - [Get token prices - Kamino Docs](#get-token-prices-kamino-docs) - [Feeds - Kamino Docs](#feeds-kamino-docs) - [Monitor Position Health - Kamino Docs](#monitor-position-health-kamino-docs) - [Multiply - Kamino Docs](#multiply-kamino-docs) - [Withdraw - Kamino Docs](#withdraw-kamino-docs) - [Get token price history - Kamino Docs](#get-token-price-history-kamino-docs) - [Get private credit metrics - Kamino Docs](#get-private-credit-metrics-kamino-docs) - [Get private credit metrics history - Kamino Docs](#get-private-credit-metrics-history-kamino-docs) - [Get a wallet earn summary - Kamino Docs](#get-a-wallet-earn-summary-kamino-docs) - [Get instructions to deposit into a kvault - Kamino Docs](#get-instructions-to-deposit-into-a-kvault-kamino-docs) - [Get instructions to repay debt of a klend reserve - Kamino Docs](#get-instructions-to-repay-debt-of-a-klend-reserve-kamino-docs) - [Get transaction to repay debt of a klend reserve - Kamino Docs](#get-transaction-to-repay-debt-of-a-klend-reserve-kamino-docs) - [Get user KLend rewards - Kamino Docs](#get-user-klend-rewards-kamino-docs) - [Get all user obligations - Kamino Docs](#get-all-user-obligations-kamino-docs) - [Get historical KVault allocation volume - Kamino Docs](#get-historical-kvault-allocation-volume-kamino-docs) - [Earn Withdraw with the API - Kamino Docs](#earn-withdraw-with-the-api-kamino-docs) - [Get Vault APYs - Kamino Docs](#get-vault-apys-kamino-docs) - [Borrow with the API - Kamino Docs](#borrow-with-the-api-kamino-docs) - [Withdraw via the API - Kamino Docs](#withdraw-via-the-api-kamino-docs) - [Repay with the API - Kamino Docs](#repay-with-the-api-kamino-docs) - [Monitor Position Health - Kamino Docs](#monitor-position-health-kamino-docs) - [Earn Vaults: Deposit and Withdraw - Kamino Docs](#earn-vaults-deposit-and-withdraw-kamino-docs) - [Get managed LUTs for multiple products - Kamino Docs](#get-managed-luts-for-multiple-products-kamino-docs) - [Farms - Kamino Docs](#farms-kamino-docs) - [Get all user obligations - Kamino Docs](#get-all-user-obligations-kamino-docs) - [Get farm management history - Kamino Docs](#get-farm-management-history-kamino-docs) - [Get charts for a reserve - Kamino Docs](#get-charts-for-a-reserve-kamino-docs) - [Get profit and loss for an obligation - Kamino Docs](#get-profit-and-loss-for-an-obligation-kamino-docs) - [Get metadata for KVault token - Kamino Docs](#get-metadata-for-kvault-token-kamino-docs) --- # Overview - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs#content-area) ![Kamino hero](https://mintcdn.com/kamino-3d73a151/PLATQ08CVUwkaQvR/images/hero-image-with-k.webp?w=2500&fit=max&auto=format&n=PLATQ08CVUwkaQvR&q=85&s=65ed998f09b025ae1b44ec3bb7c08aa8)![Kamino hero](https://mintcdn.com/kamino-3d73a151/PLATQ08CVUwkaQvR/images/dark-hero-background-with-k.webp?w=2500&fit=max&auto=format&n=PLATQ08CVUwkaQvR&q=85&s=ff5d33e7e21c2220a4dce0cc34402cc3) Kamino Documentation ==================== Explore the Kamino protocol with comprehensive documentation for developers, curators, and institutions. [](https://kamino.com/docs/products) Earn Borrow Multiply Swap Audits Risk Safety ### Docs Product Product and risk docs for understanding Kamino. Read about product mechanics, usage guides, audits, safeguards, and the risk framework behind Kamino. [Products](https://kamino.com/docs/products/lending-vaults) •[Learn](https://kamino.com/docs/learn/guides) •[Security & Risk](https://kamino.com/docs/security) [](https://kamino.com/docs/build) const vault = new KaminoVault(rpc, address); const shares = await vault.getUserShares(user); REST API TS SDK ### Buildkit Developer AI-ready docs for faster Kamino integrations. Build on Kamino with APIs, SDKs, Rust tooling, and practical examples. [API Reference](https://kamino.com/docs/build/api-reference/introduction) •[SDK Guides](https://kamino.com/docs/build/developers/overview) •[AI Tools](https://kamino.com/docs/build/agentic-finance/building-with-llms) [](https://kamino.com/docs/curators) CREATE VAULT ALLOCATIONS SET UP FARMS MARKETS RESERVES REWARDS ### Curators Operator Vault and market docs. Design and manage custom lending strategies on Kamino for institutions and professional risk managers. [Vaults](https://kamino.com/docs/curators/vaults) •[Markets](https://kamino.com/docs/curators/markets) •[Parameters](https://kamino.com/docs/curators/reference/parameters) Curators on Kamino ------------------ ![Allez Labs](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/allez-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=df8f8aac3c65fe15a663caed5b91204a)![Allez Labs](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/allez-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=5b6badfab870f852aebe87c1c54a2f0f) ![Gauntlet](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/gauntlet-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=b36039b581e8563c66276d9473d59175)![Gauntlet](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/gauntlet-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=036de48aec44aa6d3f04d121f1c93560) ![Rockaway](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/rockaway-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=6238979ac1995445c76acb94288613c6)![Rockaway](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/rockaway-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=3937252c31a73136888903561b7cb818) ![Steakhouse Financial](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/steakhouse-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f599a87c1485b07e40ec360b903ca1b9)![Steakhouse Financial](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/steakhouse-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=a20b6a17e0950b42c4c1cd855c48b145) ![Sentora](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/sentora-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f62e53ac2689b09788a641dc0b83bff3)![Sentora](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/sentora-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=cfd86a4ce174c3a309059fb89892d854) ![Allez Labs](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/allez-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=df8f8aac3c65fe15a663caed5b91204a)![Allez Labs](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/allez-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=5b6badfab870f852aebe87c1c54a2f0f) ![Gauntlet](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/gauntlet-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=b36039b581e8563c66276d9473d59175)![Gauntlet](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/gauntlet-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=036de48aec44aa6d3f04d121f1c93560) ![Rockaway](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/rockaway-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=6238979ac1995445c76acb94288613c6)![Rockaway](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/rockaway-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=3937252c31a73136888903561b7cb818) ![Steakhouse Financial](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/steakhouse-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f599a87c1485b07e40ec360b903ca1b9)![Steakhouse Financial](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/steakhouse-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=a20b6a17e0950b42c4c1cd855c48b145) ![Sentora](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/sentora-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f62e53ac2689b09788a641dc0b83bff3)![Sentora](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/sentora-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=cfd86a4ce174c3a309059fb89892d854) ![Allez Labs](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/allez-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=df8f8aac3c65fe15a663caed5b91204a)![Allez Labs](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/allez-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=5b6badfab870f852aebe87c1c54a2f0f) ![Gauntlet](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/gauntlet-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=b36039b581e8563c66276d9473d59175)![Gauntlet](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/gauntlet-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=036de48aec44aa6d3f04d121f1c93560) ![Rockaway](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/rockaway-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=6238979ac1995445c76acb94288613c6)![Rockaway](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/rockaway-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=3937252c31a73136888903561b7cb818) ![Steakhouse Financial](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/steakhouse-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f599a87c1485b07e40ec360b903ca1b9)![Steakhouse Financial](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/steakhouse-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=a20b6a17e0950b42c4c1cd855c48b145) ![Sentora](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/sentora-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f62e53ac2689b09788a641dc0b83bff3)![Sentora](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/sentora-logo-dark.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=cfd86a4ce174c3a309059fb89892d854) Kamino gives curators granular controlover institutional-grade lending infrastructure. [### Vaults](https://kamino.com/docs/curators/vaults) 1 ### Deploy Vault Initialize a lending vault that accepts a single deposit token. 2 ### Set Allocation Strategy Configure allocation weights, caps, and risk parameters across reserves. 3 ### Route Assets Distribute depositor assets across lending reserves and issue share tokens. 4 ### Earn Revenue Collect fees from vault operations and manage rewards distribution. [### Markets](https://kamino.com/docs/curators/markets) 1 ### Create Market Deploy an isolated lending market with your own risk parameters. 2 ### Add Reserves Configure reserves with LTV, liquidation thresholds, rate curves, and oracles. 3 ### Configure Rewards Set up collateral and debt farms to distribute rewards to depositors and borrowers. 4 ### Transfer to Multisig Transfer market administration to a Squads multisig before launch. A complete toolchain for faster integrations. --------------------------------------------- #### REST API Data, analytics, user positions, unsigned transactions. #### TypeScript SDK On-chain reads, transaction building, advanced operations. #### Rust Crate Rust clients, bots, on-chain CPI. #### AI Tools llms.txt, skill.md, agent assisted development. #### CLI Managing markets, reserves, vaults, and operational workflows. const res = await fetch('https://api.kamino.finance/ktx/kvault/deposit', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ wallet: 'YOUR_WALLET_ADDRESS', vault: 'HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E', amount: '100.0', }), }); const { transaction } = await res.json(); import { createSolanaRpc, address, generateKeyPairSigner } from '@solana/kit'; import { KaminoVault } from '@kamino-finance/klend-sdk'; import { Decimal } from 'decimal.js'; const signer = await generateKeyPairSigner(); const vault = new KaminoVault( createSolanaRpc('https://api.mainnet-beta.solana.com'), address('HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E') ); const depositIxs = await vault.depositIxs( signer, new Decimal(100.0) ); use kvault_interface::{helpers, pda, VaultInfo, KVAULT_PROGRAM_ID}; use spl_associated_token_account::get_associated_token_address; let vault = VaultInfo::from_account_data( vault_pubkey, &vault_data.data, &reserve_infos )?; let user_token_ata = get_associated_token_address(&owner, &vault.token_mint); let (shares_mint, _) = pda::shares_mint(&KVAULT_PROGRAM_ID, &vault_pubkey); let user_shares_ata = get_associated_token_address(&owner, &shares_mint); let deposit_ix = helpers::deposit::deposit( &vault, owner, user_token_ata, user_shares_ata, 1_000_000, ); #### Kamino MCP Server `npx add-mcp [https://kamino.com/docs/mcp](https://kamino.com/docs/mcp) ` #### Kamino CLI `yarn kamino-manager create-market —mode execute` How can we help? ---------------- Build with Kamino. Get the support you need to ship. Full name \* Email address \* Topic \*Select a topicCustom loan or yield solutionBecome a curatorAPI / SDK developer supportRust Crate developer supportReport a bugFeature requestOther Tell us what you have in mind \* Send message [](https://x.com/kamino) [](https://discord.com/invite/kamino) [](https://t.me/+DVzNEEQqiSRjODg0) [](https://github.com/Kamino-Finance) [Risk dashboard](https://risk.kamino.finance/) [Security](https://kamino.com/docs/security) [App](https://app.kamino.finance/) [Terms](https://kamino.com/terms) Assistant Responses are generated using AI and may contain mistakes. ![Allez Labs](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/allez-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=df8f8aac3c65fe15a663caed5b91204a) ![Gauntlet](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/gauntlet-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=b36039b581e8563c66276d9473d59175) ![Rockaway](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/rockaway-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=6238979ac1995445c76acb94288613c6) ![Steakhouse Financial](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/steakhouse-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f599a87c1485b07e40ec360b903ca1b9) ![Sentora](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/sentora-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f62e53ac2689b09788a641dc0b83bff3) ![Allez Labs](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/allez-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=df8f8aac3c65fe15a663caed5b91204a) ![Gauntlet](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/gauntlet-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=b36039b581e8563c66276d9473d59175) ![Rockaway](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/rockaway-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=6238979ac1995445c76acb94288613c6) ![Steakhouse Financial](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/steakhouse-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f599a87c1485b07e40ec360b903ca1b9) ![Sentora](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/sentora-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f62e53ac2689b09788a641dc0b83bff3) ![Allez Labs](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/allez-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=df8f8aac3c65fe15a663caed5b91204a) ![Gauntlet](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/gauntlet-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=b36039b581e8563c66276d9473d59175) ![Rockaway](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/rockaway-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=6238979ac1995445c76acb94288613c6) ![Steakhouse Financial](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/steakhouse-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f599a87c1485b07e40ec360b903ca1b9) ![Sentora](https://mintcdn.com/kamino-3d73a151/EHpt5rRzyV5R3dXt/images/sentora-logo.svg?w=2500&fit=max&auto=format&n=EHpt5rRzyV5R3dXt&q=85&s=f62e53ac2689b09788a641dc0b83bff3) ![Kamino hero](https://mintcdn.com/kamino-3d73a151/PLATQ08CVUwkaQvR/images/hero-image-with-k.webp?w=2500&fit=max&auto=format&n=PLATQ08CVUwkaQvR&q=85&s=65ed998f09b025ae1b44ec3bb7c08aa8) --- # Building with LLMs - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/agentic-finance/building-with-llms#content-area) Kamino documentation is optimized for AI-powered development. Our machine-readable resources enable LLMs and AI agents to understand our APIs and build transactions on Solana. [​](https://kamino.com/docs/build/agentic-finance/building-with-llms#kamino-ai-resources) Kamino AI Resources ---------------------------------------------------------------------------------------------------------------- skill.md -------- Structured capability reference with API endpoints, SDK methods, and integration workflows. Start here for agent tool use. llms.txt -------- Curated index of all documentation pages with one-line descriptions and direct URLs. llms-pages.json --------------- Machine-readable JSON mapping of every page with title, section, URL, and keywords. ### [​](https://kamino.com/docs/build/agentic-finance/building-with-llms#skill-md) skill.md The skill.md file provides a comprehensive, machine-readable reference of Kamino’s capabilities across all four products: Earn, Borrow, Multiply, and Liquidity. | Includes | Description | | --- | --- | | API endpoints | Complete REST endpoint reference for all products | | SDK methods | TypeScript method signatures with real code examples | | Workflows | Step-by-step operations: deposit, borrow, withdraw, repay, stake, harvest | | Integration patterns | Earn vaults, Borrow markets, Liquidity strategies, and Farms | | Use cases | Agent transaction building, API integration, automated DeFi strategies | ### [​](https://kamino.com/docs/build/agentic-finance/building-with-llms#llms-txt) llms.txt A structured navigation map of Kamino’s entire documentation, enabling LLMs to discover relevant pages and resources efficiently. | Includes | Description | | --- | --- | | Page directory | All documentation pages with direct URLs | | Tutorials | Organized by category: Earn, Borrow, Liquidity, Rewards, Oracle | | API reference | Endpoint navigation and documentation links | | Recipes | Code example locations and implementation guides | ### [​](https://kamino.com/docs/build/agentic-finance/building-with-llms#llms-pages-json) llms-pages.json A JSON file mapping every page path to its metadata: title, URL, section, description, and keywords. Useful for programmatic discovery and filtering. { "/products/lending-vaults": { "title": "Lending Vaults", "url": "https://kamino.com/docs/products/lending-vaults", "section": "Docs", "description": "Single-token managed yield aggregation across Kamino's lending markets", "keywords": ["kamino", "lending vaults", "yield", "vault shares", "auto-compounding"] } } Assistant Responses are generated using AI and may contain mistakes. --- # Get airdrop metrics - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/airdrop/get-airdrop-metrics#content-area) Get airdrop metrics cURL curl --request GET \ --url https://api.kamino.finance/v2/airdrop/metrics const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/airdrop/metrics', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/airdrop/metrics" response = requests.get(url) print(response.text) false 200 400 404 500 [\ {\ "totalAllocation": "1234.56789",\ "totalUsers": "1",\ "claimDate": "2025-03-01T12:00:00.000Z"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } GET / v2 / airdrop / metrics Try it Get airdrop metrics cURL curl --request GET \ --url https://api.kamino.finance/v2/airdrop/metrics const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/airdrop/metrics', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/airdrop/metrics" response = requests.get(url) print(response.text) false 200 400 404 500 [\ {\ "totalAllocation": "1234.56789",\ "totalUsers": "1",\ "claimDate": "2025-03-01T12:00:00.000Z"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/airdrop/get-airdrop-metrics#parameter-source) source string Points source identifier Examples: `"Season1"` `"Season2"` `"Season3"` `"Season4"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/airdrop/get-airdrop-metrics#response-items-total-allocation) totalAllocation string required Total allocated amount across all users for this airdrop Example: `"1234.56789"` [​](https://kamino.com/docs/build/airdrop/get-airdrop-metrics#response-items-total-users) totalUsers string required Total number of unique users participating in the airdrop Examples: `"0"` `"1"` `"100"` `"-1"` [​](https://kamino.com/docs/build/airdrop/get-airdrop-metrics#response-items-claim-date) claimDate string required Date when the airdrop claim becomes available or was executed Example: `"2025-03-01T12:00:00.000Z"` Assistant Responses are generated using AI and may contain mistakes. --- # Get KLend reserve history - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserve-metrics-history#content-area) Get KLend reserve history cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/{marketPubkey}/reserves/{reservePubkey}/metrics/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/{marketPubkey}/reserves/{reservePubkey}/metrics/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/{marketPubkey}/reserves/{reservePubkey}/metrics/history" response = requests.get(url) print(response.text) false 500 { "error": "An internal error occurred" } GET / kamino-market / {marketPubkey} / reserves / {reservePubkey} / metrics / history Try it Get KLend reserve history cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/{marketPubkey}/reserves/{reservePubkey}/metrics/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/{marketPubkey}/reserves/{reservePubkey}/metrics/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/{marketPubkey}/reserves/{reservePubkey}/metrics/history" response = requests.get(url) print(response.text) false 500 { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserve-metrics-history#parameter-market-pubkey) marketPubkey string required Kamino Lend market public key Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserve-metrics-history#parameter-reserve-pubkey) reservePubkey string required Kamino Lend reserve public key Example: `"FBSyPnxtHKLBZ4UeeUyAnbtFuAmTHLtso9YtsqRDRWpM"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserve-metrics-history#parameter-env) env enum default:mainnet-beta Solana cluster environment Available options: `mainnet-beta`, `devnet`, `localnet` Example: `"mainnet-beta"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserve-metrics-history#parameter-one-of-0) start stringnumberstringnumber default:1970-01-01T00:00:00.000Z Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserve-metrics-history#parameter-one-of-0) end stringnumberstringnumber Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserve-metrics-history#parameter-frequency) frequency enum default:hour Frequency of the snapshots Available options: `hour`, `day` Example: `"hour"` #### Response 200 application/json OK Assistant Responses are generated using AI and may contain mistakes. --- # Get KLend reward history - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-history#content-area) Get KLend reward history cURL curl --request GET \ --url https://api.kamino.finance/klend/{depositReservePubkey}/{borrowReservePubkey}/rewards/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/klend/{depositReservePubkey}/{borrowReservePubkey}/rewards/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/klend/{depositReservePubkey}/{borrowReservePubkey}/rewards/history" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "timestamp": "2023-11-07T05:31:56Z",\ "depositReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "borrowReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardToken": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardApy": "0.2"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / klend / {depositReservePubkey} / {borrowReservePubkey} / rewards / history Try it Get KLend reward history cURL curl --request GET \ --url https://api.kamino.finance/klend/{depositReservePubkey}/{borrowReservePubkey}/rewards/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/klend/{depositReservePubkey}/{borrowReservePubkey}/rewards/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/klend/{depositReservePubkey}/{borrowReservePubkey}/rewards/history" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "timestamp": "2023-11-07T05:31:56Z",\ "depositReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "borrowReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardToken": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardApy": "0.2"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-history#parameter-deposit-reserve-pubkey) depositReservePubkey string required Deposit reserve public key Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-history#parameter-borrow-reserve-pubkey) borrowReservePubkey string required Borrow reserve public key Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-history#parameter-one-of-0) start stringnumberstringnumber default:1970-01-01T00:00:00.000Z Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-history#parameter-one-of-0) end stringnumberstringnumber Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-history#parameter-frequency) frequency enum Frequency of historical data aggregation Available options: `hour`, `day` Examples: `"hour"` `"day"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-history#response-items-timestamp) timestamp string required Timestamp of the data point [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-history#response-items-deposit-reserve) depositReserve string required Deposit reserve public key, if applicable Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-history#response-items-borrow-reserve) borrowReserve string required Borrow reserve public key, if applicable Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-history#response-items-reward-token) rewardToken string required Mint address of the reward token Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-history#response-items-reward-apy) rewardApy string required Annual Percentage Yield from rewards at this point in time Example: `"0.2"` Assistant Responses are generated using AI and may contain mistakes. --- # Get all Kamino Markets config - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/market-data/markets-list#content-area) Get all Kamino Markets config cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market" response = requests.get(url) print(response.text) false 200 500 [\ {\ "name": "SOL/BTC Market",\ "isPrimary": true,\ "description": "Primary market on mainnet",\ "lendingMarket": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF",\ "lookupTable": "FGMSBiyVE8TvZcdQnZETAAKw28tkQJ2ccZy6pyp95URb",\ "isCurated": false\ }\ ] { "error": "An internal error occurred" } GET / v2 / kamino-market Try it Get all Kamino Markets config cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market" response = requests.get(url) print(response.text) false 200 500 [\ {\ "name": "SOL/BTC Market",\ "isPrimary": true,\ "description": "Primary market on mainnet",\ "lendingMarket": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF",\ "lookupTable": "FGMSBiyVE8TvZcdQnZETAAKw28tkQJ2ccZy6pyp95URb",\ "isCurated": false\ }\ ] { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/market-data/markets-list#parameter-program-id) programId string default:KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD KLend program ID Example: `"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/borrow/market-data/markets-list#response-items-name) name string required Market name Example: `"SOL/BTC Market"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/markets-list#response-items-is-primary) isPrimary boolean required Whether this is a primary market Example: `true` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/markets-list#response-items-description) description string required Market description Example: `"Primary market on mainnet"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/markets-list#response-items-lending-market) lendingMarket string required Lending market public key Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/markets-list#response-items-lookup-table) lookupTable string required Lookup table address Example: `"FGMSBiyVE8TvZcdQnZETAAKw28tkQJ2ccZy6pyp95URb"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/markets-list#response-items-is-curated) isCurated boolean required Whether this market is curated Example: `false` Assistant Responses are generated using AI and may contain mistakes. --- # Get Kamino Market config - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/market-data/market-detail#content-area) Get Kamino Market config cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market/{pubkey} const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market/{pubkey}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market/{pubkey}" response = requests.get(url) print(response.text) false 200 404 500 { "name": "SOL/BTC Market", "isPrimary": true, "description": "Primary market on mainnet", "lendingMarket": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "lookupTable": "FGMSBiyVE8TvZcdQnZETAAKw28tkQJ2ccZy6pyp95URb", "isCurated": false } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } GET / v2 / kamino-market / {pubkey} Try it Get Kamino Market config cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market/{pubkey} const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market/{pubkey}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market/{pubkey}" response = requests.get(url) print(response.text) false 200 404 500 { "name": "SOL/BTC Market", "isPrimary": true, "description": "Primary market on mainnet", "lendingMarket": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "lookupTable": "FGMSBiyVE8TvZcdQnZETAAKw28tkQJ2ccZy6pyp95URb", "isCurated": false } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-detail#parameter-pubkey) pubkey string required Market public key Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-detail#parameter-program-id) programId string default:KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD KLend program ID Example: `"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-detail#response-name) name string required Market name Example: `"SOL/BTC Market"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-detail#response-is-primary) isPrimary boolean required Whether this is a primary market Example: `true` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-detail#response-description) description string required Market description Example: `"Primary market on mainnet"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-detail#response-lending-market) lendingMarket string required Lending market public key Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-detail#response-lookup-table) lookupTable string required Lookup table address Example: `"FGMSBiyVE8TvZcdQnZETAAKw28tkQJ2ccZy6pyp95URb"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-detail#response-is-curated) isCurated boolean required Whether this market is curated Example: `false` Assistant Responses are generated using AI and may contain mistakes. --- # Get metrics for leverage/multiply vaults - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#content-area) Get metrics for leverage/multiply vaults cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/{pubkey}/leverage/metrics const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/{pubkey}/leverage/metrics', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/{pubkey}/leverage/metrics" response = requests.get(url) print(response.text) false 200 500 [\ {\ "avgLeverage": "1234.56789",\ "totalBorrowed": "1234.56789",\ "totalDeposited": "1234.56789",\ "totalBorrowedUsd": "1234.56789",\ "totalObligations": "",\ "totalDepositedUsd": "1234.56789",\ "tvl": "1234.56789",\ "updatedOn": "2023-11-07T05:31:56Z",\ "depositReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "borrowReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "tag": "Multiply"\ }\ ] { "error": "An internal error occurred" } GET / kamino-market / {pubkey} / leverage / metrics Try it Get metrics for leverage/multiply vaults cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/{pubkey}/leverage/metrics const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/{pubkey}/leverage/metrics', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/{pubkey}/leverage/metrics" response = requests.get(url) print(response.text) false 200 500 [\ {\ "avgLeverage": "1234.56789",\ "totalBorrowed": "1234.56789",\ "totalDeposited": "1234.56789",\ "totalBorrowedUsd": "1234.56789",\ "totalObligations": "",\ "totalDepositedUsd": "1234.56789",\ "tvl": "1234.56789",\ "updatedOn": "2023-11-07T05:31:56Z",\ "depositReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "borrowReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "tag": "Multiply"\ }\ ] { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#parameter-pubkey) pubkey string required Market public key Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#parameter-env) env enum default:mainnet-beta Solana cluster environment Available options: `mainnet-beta`, `devnet`, `localnet` Example: `"mainnet-beta"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#response-items-avg-leverage) avgLeverage string required Average leverage Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#response-items-total-borrowed) totalBorrowed string required Total borrowed amount Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#response-items-total-deposited) totalDeposited string required Total deposited amount Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#response-items-total-borrowed-usd) totalBorrowedUsd string required Total borrowed in USD Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#response-items-total-obligations) totalObligations string required Total number of obligations [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#response-items-total-deposited-usd) totalDepositedUsd string required Total deposited in USD Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#response-items-tvl) tvl string required Total Value Locked Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#response-items-updated-on) updatedOn string required Last update timestamp [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#response-items-deposit-reserve) depositReserve string required Deposit reserve public key Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#response-items-borrow-reserve) borrowReserve string required Borrow reserve public key Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-leverage-metrics#response-items-tag) tag string required Tag (Multiply or Leverage) Example: `"Multiply"` Assistant Responses are generated using AI and may contain mistakes. --- # Get KLend market reserves account data - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-account-data#content-area) Get KLend market reserves account data cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/reserves/account-data const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/reserves/account-data', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/reserves/account-data" response = requests.get(url) print(response.text) false 200 500 [\ {\ "market": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "reserves": [\ {\ "pubkey": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "data": ""\ }\ ]\ }\ ] { "error": "An internal error occurred" } GET / kamino-market / reserves / account-data Try it Get KLend market reserves account data cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/reserves/account-data const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/reserves/account-data', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/reserves/account-data" response = requests.get(url) print(response.text) false 200 500 [\ {\ "market": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "reserves": [\ {\ "pubkey": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "data": ""\ }\ ]\ }\ ] { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-account-data#parameter-program-id) programId string default:KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-account-data#parameter-one-of-0) markets stringstring\[\]stringstring\[\] required #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-account-data#response-items-market) market string required Market public key Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-account-data#response-items-reserves) reserves object\[\] required Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Get metrics for market reserves - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#content-area) Get metrics for market reserves cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/{pubkey}/reserves/metrics const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/{pubkey}/reserves/metrics', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/{pubkey}/reserves/metrics" response = requests.get(url) print(response.text) false 200 404 500 [\ {\ "reserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "liquidityToken": "SOL",\ "liquidityTokenMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "maxLtv": "0.65",\ "borrowApy": "0.05450988511483601",\ "supplyApy": "0.038266801210808055",\ "totalSupply": "1234.56789",\ "totalBorrow": "1234.56789",\ "totalBorrowUsd": "1234.56789",\ "totalSupplyUsd": "1234.56789"\ }\ ] { "metadata": "Account could not be found" } { "error": "An internal error occurred" } GET / kamino-market / {pubkey} / reserves / metrics Try it Get metrics for market reserves cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/{pubkey}/reserves/metrics const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/{pubkey}/reserves/metrics', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/{pubkey}/reserves/metrics" response = requests.get(url) print(response.text) false 200 404 500 [\ {\ "reserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "liquidityToken": "SOL",\ "liquidityTokenMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "maxLtv": "0.65",\ "borrowApy": "0.05450988511483601",\ "supplyApy": "0.038266801210808055",\ "totalSupply": "1234.56789",\ "totalBorrow": "1234.56789",\ "totalBorrowUsd": "1234.56789",\ "totalSupplyUsd": "1234.56789"\ }\ ] { "metadata": "Account could not be found" } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#parameter-pubkey) pubkey string required Market public key Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#parameter-env) env enum default:mainnet-beta Solana cluster environment Available options: `mainnet-beta`, `devnet`, `localnet` Example: `"mainnet-beta"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#response-items-reserve) reserve string required Reserve public key Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#response-items-liquidity-token) liquidityToken string required Liquidity token symbol Example: `"SOL"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#response-items-liquidity-token-mint) liquidityTokenMint string required Liquidity token mint address Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#response-items-max-ltv) maxLtv string required Maximum loan-to-value ratio Example: `"0.65"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#response-items-borrow-apy) borrowApy string required Current borrow APY Example: `"0.05450988511483601"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#response-items-supply-apy) supplyApy string required Current supply APY Example: `"0.038266801210808055"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#response-items-total-supply) totalSupply string required Total supply amount Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#response-items-total-borrow) totalBorrow string required Total borrow amount Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#response-items-total-borrow-usd) totalBorrowUsd string required Total borrow in USD Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/borrow/market-data/market-reserves-metrics#response-items-total-supply-usd) totalSupplyUsd string required Total supply in USD Example: `"1234.56789"` Assistant Responses are generated using AI and may contain mistakes. --- # Get user airdrop allocations - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/airdrop/get-user-airdrop-allocations#content-area) Get user airdrop allocations cURL curl --request GET \ --url https://api.kamino.finance/v2/airdrop/users/{pubkey}/allocations const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/airdrop/users/{pubkey}/allocations', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/airdrop/users/{pubkey}/allocations" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "quantity": "1234.56789",\ "name": "main"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / v2 / airdrop / users / {pubkey} / allocations Try it Get user airdrop allocations cURL curl --request GET \ --url https://api.kamino.finance/v2/airdrop/users/{pubkey}/allocations const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/airdrop/users/{pubkey}/allocations', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/airdrop/users/{pubkey}/allocations" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "quantity": "1234.56789",\ "name": "main"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/airdrop/get-user-airdrop-allocations#parameter-pubkey) pubkey string required Valid base58-encoded address of the user wallet Example: `"AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As"` #### Query Parameters [​](https://kamino.com/docs/build/airdrop/get-user-airdrop-allocations#parameter-source) source string Points source identifier Examples: `"Season1"` `"Season2"` `"Season3"` `"Season4"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/airdrop/get-user-airdrop-allocations#response-items-quantity) quantity string required Quantity of tokens allocated to the user for the airdrop Example: `"1234.56789"` [​](https://kamino.com/docs/build/airdrop/get-user-airdrop-allocations#response-items-name) name string required Name of the airdrop allocation source Example: `"main"` Assistant Responses are generated using AI and may contain mistakes. --- # Overview - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/cli#content-area) The Kamino Manager CLI is a command line tool used to create and manage Kamino lending markets, reserves, and Kamino vaults. The Kamino CLI provides: * Create and configure lending markets with reserves for different token types and custom risk parameters * Build and manage automated liquidity vaults with adjustable allocation strategies and yield optimization * Monitor performance metrics and update market or vault settings as needed Installation & Setup -------------------- Install and configure the Kamino Manager CLI Market Operations ----------------- Create and manage Kamino lending markets and reserves Vault Operations ---------------- Create and manage Kamino vaults Assistant Responses are generated using AI and may contain mistakes. --- # Agent Integrations: Using OpenClaw with Kamino - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#content-area) By the end of this tutorial, you will have the following skill files configured for your agent. | File | Purpose | | --- | --- | | [`SKILL.md`](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#skill-md) | Main skill instructions: capabilities, quick reference, and workflows | | [`references/setup.md`](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/setup-md) | Environment setup: RPC, wallet keypair, OpenClaw config | | [`references/earn.md`](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/earn-md) | Earn vault operations: deposit, withdraw, vault data, user positions | | [`references/borrow.md`](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/borrow-md) | Borrow market operations: deposit, borrow, repay, withdraw, market data | | [`references/multiply.md`](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/multiply-md) | Multiply operations: leveraged positions, flash loans, position health | | [`references/liquidity.md`](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/liquidity-md) | Liquidity strategy operations: deposit, withdraw, strategy metrics, user PnL | | [`references/rewards.md`](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/rewards-md) | Farm operations: stake, unstake, harvest, farm state, pending rewards | | [`references/api.md`](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/api-md) | Complete REST API endpoint reference for all products | [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#prerequisites) Prerequisites ------------------------------------------------------------------------------------------------------------ * Node.js 22+ * Solana wallet with SOL for transaction fees * RPC endpoint [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#skill-folder-structure) Skill Folder Structure ------------------------------------------------------------------------------------------------------------------------------ 1 Create Skill Directory Create a new directory for the Kamino skill in your OpenClaw workspace: mkdir -p ~/.openclaw/workspace/skills/kamino cd ~/.openclaw/workspace/skills/kamino 2 Create File Structure Create the following files in the directory: kamino/ ├── SKILL.md # Main skill instructions for the agent └── references/ ├── setup.md # Environment and SDK setup ├── earn.md # Kamino Earn operations (vaults) ├── borrow.md # Kamino Borrow operations (lending) ├── multiply.md # Kamino Multiply operations (leverage) ├── liquidity.md # Kamino Liquidity operations (strategies) ├── rewards.md # Kamino Rewards operations (farms) └── api.md # Kamino API reference mkdir -p references touch SKILL.md references/setup.md references/earn.md references/borrow.md references/multiply.md references/liquidity.md references/rewards.md references/api.md 3 Get a Solana RPC Endpoint Choose an RPC provider: * **Free**: `https://api.mainnet-beta.solana.com` (rate limited) * **Recommended**: Helius, QuickNode, or Triton (paid, production-ready) 4 Create or Use Existing Wallet Keypair Create a new keypair if needed: solana-keygen new --outfile ~/solana-wallet.json Or use an existing keypair file. 5 Configure OpenClaw Add your Solana credentials to `~/.openclaw/openclaw.json`: { "gateway": { "env": { "SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com", "SOLANA_WS_URL": "wss://api.mainnet-beta.solana.com", "WALLET_KEYPAIR_PATH": "/path/to/your/solana-wallet.json" } } } Replace `/path/to/your/solana-wallet.json` with the actual path to your keypair file. 6 Restart OpenClaw Gateway After updating the configuration: openclaw gateway restart 7 Verify Setup Test your RPC connection: curl -X POST $SOLANA_RPC_URL \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"getHealth"}' ### [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#for-other-ai-agents) For Other AI Agents * **Claude**: Copy the SKILL.md content into your conversation or attach as a file * **Cursor**: Clone into `.cursor/skills/kamino` directory * **Custom Agents**: Reference the markdown files directly [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#file-templates) File Templates -------------------------------------------------------------------------------------------------------------- Copy the following templates into your skill files. ### [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#skill-md) SKILL.md The main skill file that teaches agents how to interact with Kamino: # Kamino Skill Interact with Kamino Finance on Solana: Earn vaults, Borrow markets, Liquidity strategies, and Rewards farms. ## Prerequisites See [setup.md](references/setup.md) for installation and configuration. Required: - Solana RPC endpoint - Wallet keypair for signing transactions - `@solana/kit` and relevant Kamino SDKs installed ## What You Can Do **Kamino Earn** - Deposit into yield-generating vaults **Kamino Borrow** - Supply collateral, borrow assets, repay loans **Kamino Multiply** - Open and manage leveraged positions **Kamino Liquidity** - Deposit into automated concentrated liquidity strategies **Kamino Rewards** - Stake, unstake, and harvest farm rewards **KSwap** - Swap between any two tokens via Kamino's swap aggregator **Oracle (Scope)** - Read token prices on-chain or via REST ## Quick Reference | Operation | Method | Reference | |-----------|--------|-----------| | Earn: Deposit | SDK or API | [earn.md](references/earn.md) | | Earn: Withdraw | SDK or API | [earn.md](references/earn.md) | | Borrow: Deposit Collateral | API | [borrow.md](references/borrow.md) | | Borrow: Borrow Assets | API | [borrow.md](references/borrow.md) | | Borrow: Repay Loan | API | [borrow.md](references/borrow.md) | | Borrow: Withdraw Collateral | API | [borrow.md](references/borrow.md) | | Multiply: Open Position | SDK | [multiply.md](references/multiply.md) | | Multiply: Monitor Health | SDK | [multiply.md](references/multiply.md) | | Multiply: Close Position | SDK | [multiply.md](references/multiply.md) | | Liquidity: Deposit | SDK | [liquidity.md](references/liquidity.md) | | Liquidity: Withdraw | SDK | [liquidity.md](references/liquidity.md) | | Liquidity: Strategy Data | SDK or API | [liquidity.md](references/liquidity.md) | | Rewards: Stake | SDK | [rewards.md](references/rewards.md) | | Rewards: Unstake | SDK | [rewards.md](references/rewards.md) | | Rewards: Harvest | SDK | [rewards.md](references/rewards.md) | | KSwap: Swap Tokens | API | [api.md](references/api.md) | | Oracle: Read Prices | SDK or API | [api.md](references/api.md) | | Query Market Data | SDK | [borrow.md](references/borrow.md) | | Get Vault/Market Lists | API | [api.md](references/api.md) | ## Core Workflow ### For Kamino Earn: 1. Choose a vault (get list via API or use known address) 2. Deposit tokens to earn yield 3. Withdraw vault shares when needed ### For Kamino Borrow: 1. Supply collateral to a market 2. Borrow assets against your collateral 3. Monitor health factor (keep LTV below 75%) 4. Repay loans and withdraw collateral ### For Kamino Multiply: 1. Choose a strategy (LST, JLP, stablecoin, or xStocks) 2. Open a leveraged position with target leverage 3. Monitor LTV and liquidation risk 4. Adjust leverage, repay debt, or close position ### For Kamino Liquidity: 1. Choose a strategy (get list via API or use known address) 2. Deposit tokens (single-sided or two-sided) 3. Monitor share price and PnL 4. Withdraw shares when needed ### For Kamino Rewards: 1. Find the farm for your position (by stake mint or known address) 2. Stake share tokens into the farm 3. Monitor pending rewards 4. Harvest rewards or unstake and withdraw **SOL/BTC Market**: `7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF` ## Reference Files - **[setup.md](references/setup.md)** — Installation and OpenClaw configuration - **[earn.md](references/earn.md)** — Vault deposit/withdraw code examples - **[borrow.md](references/borrow.md)** — Lending market operations - **[multiply.md](references/multiply.md)** — Leveraged position operations - **[liquidity.md](references/liquidity.md)** — Liquidity strategy operations - **[rewards.md](references/rewards.md)** — Farm staking and reward harvesting - **[api.md](references/api.md)** — Complete API endpoint reference See all 89 lines ### [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/setup-md) references/setup.md Setup guide for using Kamino with OpenClaw: # Kamino Setup Configure OpenClaw to interact with Kamino Finance protocols on Solana. ## Prerequisites Before using this skill, you need: - OpenClaw installed (Node.js 22+) - Solana RPC endpoint (get from Helius, QuickNode, or use public endpoint) - Solana wallet keypair file for signing transactions For complete developer documentation: https://kamino.com/docs/build **SOL/BTC Market**: `7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF` See all 14 lines ### [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/earn-md) references/earn.md Kamino Earn vault operations: # Kamino Earn Operations Deposit into yield-generating vaults, withdraw shares, and query vault/user data. ## Dependencies ```bash npm install @solana/kit @kamino-finance/klend-sdk decimal.js ``` ## SDK Instantiation ```typescript import { createSolanaRpc, address } from '@solana/kit'; import { KaminoVault, KaminoManager } from '@kamino-finance/klend-sdk'; const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); // Initialize a specific vault const vault = new KaminoVault( rpc, address('VAULT_PUBKEY_HERE') ); // Or use manager for multi-vault operations const manager = new KaminoManager(rpc); ``` ## SDK Operations | What to Do | SDK Method | Documentation | |------------|------------|---------------| | **Transactions** | | Deposit to vault | `vault.depositIxs(signer, amount)` | [Recipe](https://docs.kamino.finance/build/recipes/earn/earn-via-sdk) | | Withdraw from vault | `vault.withdrawIxs(signer, shareAmount)` | [Recipe](https://docs.kamino.finance/build/recipes/earn/earn-withdraw-via-sdk) | | **Read Vault Data** | | Get vault holdings | `vault.getVaultHoldings()` | [Data Docs](https://docs.kamino.finance/build/earn/data/vault-data) | | Get vault APY | `vault.getAPYs()` | [Data Docs](https://docs.kamino.finance/build/earn/data/vault-data) | | Get exchange rate | `vault.getExchangeRate()` | [Data Docs](https://docs.kamino.finance/build/earn/data/vault-data) | | Get allocations | `vault.getVaultAllocations()` | [Data Docs](https://docs.kamino.finance/build/earn/data/vault-data) | | Get vault overview | `manager.getVaultOverview(vault, tokenPrice)` | [Data Docs](https://docs.kamino.finance/build/earn/data/vault-data) | | **Read User Data** | | Get user shares | `vault.getUserShares(userAddress)` | [Data Docs](https://docs.kamino.finance/build/earn/data/user-position-data) | | Get all positions | `manager.getUserSharesBalanceAllVaults(userAddress)` | [Data Docs](https://docs.kamino.finance/build/earn/data/user-position-data) | ## API Operations | What to Do | API Endpoint | Documentation | |------------|--------------|---------------| | **Transactions** | | Deposit to vault | `POST /ktx/kvault/deposit` | [Recipe](https://docs.kamino.finance/build/recipes/earn/earn-via-api) | | Withdraw from vault | `POST /ktx/kvault/withdraw` | [Recipe](https://docs.kamino.finance/build/recipes/earn/earn-withdraw-via-api) | | **Read Vault Data** | | List all vaults | `GET /kvaults/vaults` | [API Docs](https://api-docs.kamino.finance) | | Get vault details | `GET /vault/{vaultPubkey}` | [API Docs](https://api-docs.kamino.finance) | | Get vault metrics | `GET /vault/{vaultPubkey}/metrics` | [API Docs](https://api-docs.kamino.finance) | | Historical metrics | `GET /vault/{vaultPubkey}/metrics/history` | [API Docs](https://api-docs.kamino.finance) | | **Read User Data** | | Get user positions | `GET /kvaults/users/{wallet}/positions` | [API Docs](https://api-docs.kamino.finance) | | Get vault position | `GET /kvaults/users/{wallet}/vaults/{vaultPubkey}/position` | [API Docs](https://api-docs.kamino.finance) | | Get position PnL | `GET /kvaults/users/{wallet}/vaults/{vaultPubkey}/pnl` | [API Docs](https://api-docs.kamino.finance) | | Get transactions | `GET /kvaults/users/{wallet}/transactions` | [API Docs](https://api-docs.kamino.finance) | ## Important Notes - Withdrawals use **vault share amounts**, not underlying token amounts - SDK automatically handles farm unstaking if needed - API transactions use Address Lookup Tables - must use `decompileTransactionMessageFetchingLookupTables` - Historical data only available via API ## Complete Tutorial [Earn and Withdraw Tutorial](https://docs.kamino.finance/build/tutorials/earn/earn-and-withdraw) See all 73 lines ### [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/borrow-md) references/borrow.md Kamino Borrow operations (deposit collateral, borrow, repay, withdraw): # Kamino Borrow Operations Supply collateral, borrow assets, repay loans, withdraw collateral, and query market/user data. **SOL/BTC Market**: `7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF` ## Dependencies ```bash npm install @solana/kit @kamino-finance/klend-sdk decimal.js ``` ## SDK Instantiation ```typescript import { createSolanaRpc, address } from '@solana/kit'; import { KaminoMarket, VanillaObligation, PROGRAM_ID } from '@kamino-finance/klend-sdk'; const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const marketPubkey = address('7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'); // Load market with 400ms slot duration const market = await KaminoMarket.load(rpc, marketPubkey, 400, PROGRAM_ID); // Get user's obligation const userAddress = address('USER_WALLET_ADDRESS'); const obligation = await market.getObligationByWallet( userAddress, new VanillaObligation(PROGRAM_ID) ); ``` ## SDK Operations | What to Do | SDK Method | Documentation | |------------|------------|---------------| | **Read Market Data** | | Get total deposit TVL | `market.getTotalDepositTVL()` | [Data Docs](https://docs.kamino.finance/build/borrow/data/market-data) | | Get total borrow TVL | `market.getTotalBorrowTVL()` | [Data Docs](https://docs.kamino.finance/build/borrow/data/market-data) | | Get all reserves | `market.getReserves()` | [Data Docs](https://docs.kamino.finance/build/borrow/data/market-data) | | Get reserve deposit TVL | `reserve.getDepositTvl()` | [Data Docs](https://docs.kamino.finance/build/borrow/data/market-data) | | Get reserve borrow TVL | `reserve.getBorrowTvl()` | [Data Docs](https://docs.kamino.finance/build/borrow/data/market-data) | | Get reserve borrow APY | `reserve.totalBorrowAPY(slot)` | [Data Docs](https://docs.kamino.finance/build/borrow/data/market-data) | | Get reserve supply APY | `reserve.totalSupplyAPY(slot)` | [Data Docs](https://docs.kamino.finance/build/borrow/data/market-data) | | Get reserve utilization | `reserve.calculateUtilizationRatio()` | [Data Docs](https://docs.kamino.finance/build/borrow/data/market-data) | | **Read User Data** | | Get user's obligation | `market.getObligationByWallet(user, obligationType)` | [Data Docs](https://docs.kamino.finance/build/borrow/data/user-position-data) | | Get all user obligations | `market.getAllUserObligations(user)` | [Data Docs](https://docs.kamino.finance/build/borrow/data/user-position-data) | | Get LTV ratio | `obligation.loanToValue()` | [Data Docs](https://docs.kamino.finance/build/borrow/data/user-position-data) | | Get borrow utilization | `obligation.refreshedStats.borrowUtilization` | [Data Docs](https://docs.kamino.finance/build/borrow/data/user-position-data) | | Get user deposits | `obligation.deposits` | [Data Docs](https://docs.kamino.finance/build/borrow/data/user-position-data) | | Get user borrows | `obligation.borrows` | [Data Docs](https://docs.kamino.finance/build/borrow/data/user-position-data) | ## API Operations | What to Do | API Endpoint | Documentation | |------------|--------------|---------------| | **Transactions** | | Deposit collateral | `POST /ktx/klend/deposit` | [Recipe](https://docs.kamino.finance/build/recipes/borrow/deposit-via-api) | | Borrow assets | `POST /ktx/klend/borrow` | [Recipe](https://docs.kamino.finance/build/recipes/borrow/borrow-via-api) | | Repay loan | `POST /ktx/klend/repay` | [Recipe](https://docs.kamino.finance/build/recipes/borrow/repay-via-api) | | Withdraw collateral | `POST /ktx/klend/withdraw` | [Recipe](https://docs.kamino.finance/build/recipes/borrow/withdraw-via-api) | | **Read Market Data** | | List all markets | `GET /v2/kamino-market` | [API Docs](https://api-docs.kamino.finance) | | Get market details | `GET /kamino-market/{marketPubkey}` | [API Docs](https://api-docs.kamino.finance) | | Historical reserve APY | `GET /kamino-market/{marketPubkey}/reserves/{reservePubkey}/metrics/history` | [API Docs](https://api-docs.kamino.finance) | | **Read User Data** | | Get user obligations | `GET /kamino-market/{marketPubkey}/users/{userPubkey}/obligations` | [API Docs](https://api-docs.kamino.finance) | | Get obligation details | `GET /kamino-market/{marketPubkey}/obligations/{obligationPubkey}` | [API Docs](https://api-docs.kamino.finance) | | Get obligation PnL | `GET /kamino-market/{marketPubkey}/users/{userPubkey}/obligations/{obligationPubkey}/pnl` | [API Docs](https://api-docs.kamino.finance) | | Get user rewards | `GET /kamino-market/{marketPubkey}/users/{userPubkey}/rewards` | [API Docs](https://api-docs.kamino.finance) | ## Important Notes - **Address Lookup Tables**: All API transactions use ALTs, must use `decompileTransactionMessageFetchingLookupTables` - **Health checks**: Always verify obligation LTV before borrowing or withdrawing collateral - **Commitment levels**: Use `finalized` for blockhash, `confirmed` for transaction sends - **Error handling**: Wrap all operations in try-catch blocks - **Historical data**: Only available via API ## Complete Tutorials - [Deposit and Borrow Tutorial](https://docs.kamino.finance/build/tutorials/borrow/deposit-and-borrow) - [Repay and Withdraw Tutorial](https://docs.kamino.finance/build/tutorials/borrow/repay-and-withdraw) See all 84 lines ### [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/multiply-md) references/multiply.md Kamino Multiply leveraged position operations: # Kamino Multiply Operations Open leveraged positions, monitor health, adjust leverage, and close positions. ## Dependencies ```bash npm install @solana/kit @kamino-finance/klend-sdk @kamino-finance/kswap-sdk @kamino-finance/scope-sdk decimal.js ``` ## SDK Instantiation ```typescript import { createSolanaRpc, address } from '@solana/kit'; import { KaminoMarket, PROGRAM_ID, getFlashLoanInstructions, getDepositWithLeverageIxs, getRepayWithCollIxs } from '@kamino-finance/klend-sdk'; const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const marketPubkey = address('7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'); const market = await KaminoMarket.load(rpc, marketPubkey, 400, PROGRAM_ID); ``` ## SDK Operations | What to Do | SDK Method | Documentation | |------------|------------|---------------| | **Transactions** | | Open leveraged position | `getDepositWithLeverageIxs({...})` | [Guide](https://docs.kamino.finance/build/developers/multiply/operations/deposit-xstocks) | | Repay with collateral | `getRepayWithCollIxs({...})` | [Guide](https://docs.kamino.finance/build/developers/multiply/operations/repay-collateral) | | Flash loan | `getFlashLoanInstructions({...})` | [Guide](https://docs.kamino.finance/build/developers/multiply/flash-loans) | | **Read Position Data** | | Get multiply positions | `market.getUserObligationsByTag(ObligationTypeTag.Multiply, userAddress)` | [Guide](https://docs.kamino.finance/build/developers/multiply/data/health-metrics) | | Get position LTV | `obligation.refreshedStats.loanToValue` | [Guide](https://docs.kamino.finance/build/developers/multiply/data/health-metrics) | | Get liquidation LTV | `obligation.refreshedStats.liquidationLtv` | [Guide](https://docs.kamino.finance/build/developers/multiply/data/health-metrics) | | Get net value | `obligation.refreshedStats.netAccountValue` | [Guide](https://docs.kamino.finance/build/developers/multiply/data/health-metrics) | ## Important Notes - Multiply uses flash loans to open positions atomically in a single transaction - Leveraged combo operations (`getDepositWithLeverageIxs`, `getRepayWithCollIxs`) are TypeScript SDK only, not available in Rust - Always monitor LTV to avoid liquidation - Requires KSwap SDK for swap routing and Scope SDK for oracle price refresh - Fetch pair LUTs from `cdn.kamino.finance/resources.json` before building transactions ## Complete Guides - [Flash Loans](https://docs.kamino.finance/build/developers/multiply/flash-loans) - [Open Position (xStocks)](https://docs.kamino.finance/build/developers/multiply/operations/deposit-xstocks) - [Repay with Collateral](https://docs.kamino.finance/build/developers/multiply/operations/repay-collateral) - [Monitor Position Health](https://docs.kamino.finance/build/developers/multiply/data/health-metrics) See all 50 lines ### [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/liquidity-md) references/liquidity.md Kamino Liquidity strategy operations: # Kamino Liquidity Operations Deposit into automated concentrated liquidity strategies, withdraw shares, and query strategy/user data. ## Dependencies ```bash npm install @solana/kit @kamino-finance/kliquidity-sdk decimal.js ``` ## SDK Instantiation ```typescript import { createSolanaRpc, address } from '@solana/kit'; import { Kamino } from '@kamino-finance/kliquidity-sdk'; const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const kamino = new Kamino('mainnet-beta', rpc); ``` ## SDK Operations | What to Do | SDK Method | Documentation | |------------|------------|---------------| | **Transactions** | | Single-sided deposit | `kamino.singleSidedDepositTokenB(strategy, amount, signer, slippageBps)` | [Guide](https://docs.kamino.finance/build/developers/liquidity/operations/deposit) | | Two-sided deposit | `kamino.deposit(strategyWithAddress, amountA, amountB, signer)` | [Guide](https://docs.kamino.finance/build/developers/liquidity/operations/deposit) | | Withdraw all shares | `kamino.withdrawAllShares(strategyWithAddress, signer)` | [Guide](https://docs.kamino.finance/build/developers/liquidity/operations/withdraw) | | **Read Strategy Data** | | Get all strategies | `kamino.getAllStrategiesWithFilters(filters)` | [Guide](https://docs.kamino.finance/build/developers/liquidity/data/strategy) | | Get share price and balances | `kamino.getStrategyShareData(strategyAddress)` | [Guide](https://docs.kamino.finance/build/developers/liquidity/data/strategy) | | Get share price only | `kamino.getStrategySharePrice(strategyAddress)` | [Guide](https://docs.kamino.finance/build/developers/liquidity/data/strategy) | | **Read User Data** | | Get user positions | `kamino.getUserPositions(walletAddress)` | [Guide](https://docs.kamino.finance/build/developers/liquidity/data/user-position) | ## API Operations | What to Do | API Endpoint | Documentation | |------------|--------------|---------------| | **Read Strategy Data** | | List all strategies | `GET /strategies?status=LIVE` | [API Ref](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-list) | | Get strategy metrics | `GET /strategies/{pubkey}/metrics` | [API Ref](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategy-metrics) | | Historical metrics | `GET /v2/strategies/{pubkey}/history` | [API Ref](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategy-metrics-history) | | Total TVL | `GET /strategies/tvl` | [API Ref](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-tvl) | | Fees and rewards | `GET /strategies/fees-and-rewards?period=24h` | [API Ref](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards) | | **Read User Data** | | User PnL | `GET /v2/strategies/{pubkey}/shareholders/{wallet}/pnl` | [API Ref](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl) | | User transactions | `GET /v2/shareholders/{wallet}/transactions` | [API Ref](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-transactions) | ## Important Notes - Single-sided deposit auto-swaps half the input via the SDK's built-in swap router - Withdrawals return both Token A and Token B proportionally - Use `POST /luts/find-minimal` for address lookup table resolution on deposits and withdrawals - Historical data only available via API ## Complete Guide - [Deposit Guide](https://docs.kamino.finance/build/developers/liquidity/operations/deposit) - [Withdraw Guide](https://docs.kamino.finance/build/developers/liquidity/operations/withdraw) See all 60 lines ### [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/rewards-md) references/rewards.md Kamino Rewards farm operations: # Kamino Rewards Operations Stake into farms, unstake, harvest rewards, and query farm/user data. ## Dependencies ```bash npm install @solana/kit @kamino-finance/farms-sdk decimal.js ``` ## SDK Instantiation ```typescript import { createSolanaRpc, address } from '@solana/kit'; import { Farms, FarmState } from '@kamino-finance/farms-sdk'; const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const farms = new Farms(rpc); ``` ## SDK Operations | What to Do | SDK Method | Documentation | |------------|------------|---------------| | **Transactions** | | Stake tokens | `farms.stakeIx(...)` | [Guide](https://docs.kamino.finance/build/developers/rewards/operations/stake) | | Unstake tokens | `farms.unstakeIx(...)` | [Guide](https://docs.kamino.finance/build/developers/rewards/operations/unstake) | | Withdraw unstaked | `farms.withdrawUnstakedDepositIx(...)` | [Guide](https://docs.kamino.finance/build/developers/rewards/operations/withdraw-unstaked) | | Harvest all rewards | `farms.claimForUserForFarmAllRewardsIx(...)` | [Guide](https://docs.kamino.finance/build/developers/rewards/operations/harvest) | | **Read Farm Data** | | Get farm state | `FarmState.fetch(rpc, farmAddress)` | [Guide](https://docs.kamino.finance/build/developers/rewards/data/farm-state) | | Batch-load farms | `farms.getAllFarmStatesByPubkeys(addresses)` | [Guide](https://docs.kamino.finance/build/developers/rewards/data/farm-state) | | Find farms by mint | `farms.getFarmsForMint(stakeMint)` | [Guide](https://docs.kamino.finance/build/developers/rewards/data/farm-state) | | Get incentive APY | `farms.getRewardsAPYForStrategy(strategyAddress)` | [Guide](https://docs.kamino.finance/build/developers/rewards/data/farm-state) | | **Read User Data** | | Get all user positions | `farms.getAllFarmsForUser(walletAddress, now)` | [Guide](https://docs.kamino.finance/build/developers/rewards/data/user-position) | | Get pending rewards | `farms.getUserPendingRewards(userState, farmState, now, oraclePrices)` | [Guide](https://docs.kamino.finance/build/developers/rewards/data/user-position) | | Get lockup status | `farms.getLockupDurationAndExpiry(farm, user, now)` | [Guide](https://docs.kamino.finance/build/developers/rewards/data/user-position) | ## API Operations | What to Do | API Endpoint | Documentation | |------------|--------------|---------------| | Farm transactions | `GET /farms/{farmPubkey}/transactions` | [API Ref](https://kamino.com/docs/build/api-reference/rewards/farm-transactions) | | Farm management history | `GET /farms/{farmPubkey}/management-history` | [API Ref](https://kamino.com/docs/build/api-reference/rewards/farm-management-history) | | User farm transactions | `GET /farms/users/{pubkey}/transactions` | [API Ref](https://kamino.com/docs/build/api-reference/rewards/user-transactions) | | Oracle prices (for reward valuation) | `GET /oracles/prices` | [API Ref](https://kamino.com/docs/build/api-reference/oracle/oracle-prices) | ## Important Notes - **Delegated farms** (klend reserve farms, kvault farms) have no stake mint; a delegate authority stakes on behalf of users - **Non-delegated farms** own their stake token; use `getFarmsForMint` to discover them - Unstaking triggers a **withdrawal cooldown** before tokens can be withdrawn - Reward valuation requires oracle prices from `GET /oracles/prices?source=scope` - Farm operations are SDK-only; there are no transaction-building API endpoints for farms ## Complete Guide - [Farm State Guide](https://docs.kamino.finance/build/developers/rewards/data/farm-state) - [User Position Guide](https://docs.kamino.finance/build/developers/rewards/data/user-position) - [Stake Guide](https://docs.kamino.finance/build/developers/rewards/operations/stake) - [Harvest Guide](https://docs.kamino.finance/build/developers/rewards/operations/harvest) See all 62 lines ### [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#references/api-md) references/api.md Kamino REST API endpoints: # Kamino API Reference Quick reference for Kamino Finance REST API. ## Base URL `https://api.kamino.finance` No API key required for public endpoints. ## Complete Documentation - Full API Reference: https://kamino.com/docs/build/api-reference - OpenAPI Specification: https://api-docs.kamino.finance ## Key Endpoints **Kamino Earn:** - `POST /ktx/kvault/deposit` - Deposit to vault - `POST /ktx/kvault/withdraw` - Withdraw from vault - `GET /kvaults/vaults` - List all vaults - `GET /kvaults/users/{walletAddress}/positions` - User positions **Kamino Borrow:** - `POST /ktx/klend/deposit` - Deposit collateral - `POST /ktx/klend/borrow` - Borrow assets - `POST /ktx/klend/repay` - Repay loan - `POST /ktx/klend/withdraw` - Withdraw collateral - `GET /v2/kamino-market` - List all markets - `GET /kamino-market/{marketPubkey}/users/{userPubkey}/obligations` - User obligations **Kamino Multiply:** - Multiply operations are SDK-only (no API transaction endpoints) - Monitor positions via `GET /kamino-market/{marketPubkey}/users/{userPubkey}/obligations` **Kamino Liquidity:** - `GET /strategies?status=LIVE` - List all strategies - `GET /strategies/{pubkey}/metrics` - Strategy metrics - `GET /v2/strategies/{pubkey}/history` - Historical metrics - `GET /strategies/tvl` - Total TVL - `GET /v2/strategies/{pubkey}/shareholders/{wallet}/pnl` - User PnL - `GET /v2/shareholders/{wallet}/transactions` - User transactions **Kamino Rewards (Farms):** - `GET /farms/{farmPubkey}/transactions` - Farm transactions - `GET /farms/{farmPubkey}/management-history` - Farm management history - `GET /farms/users/{pubkey}/transactions` - User farm transactions **Oracle:** - `GET /oracles/prices` - Oracle prices with timestamp and staleness - `GET /prices` - Token USD prices by mint **KSwap (Token Swaps):** - `GET /kswap/swap/` - Get best route and transaction for swapping between two tokens **Utilities:** - `POST /luts/find-minimal` - Find minimal Address Lookup Tables ## Important Notes - All transaction endpoints return base64-encoded transactions - Transactions use Address Lookup Tables and require `decompileTransactionMessageFetchingLookupTables` - Client must decode, sign with fresh blockhash, and submit transactions - Farm operations (stake, unstake, harvest) are SDK-only with no API transaction endpoints See all 64 lines [​](https://kamino.com/docs/build/agentic-finance/openclaw-agent-integration#usage-examples) Usage Examples -------------------------------------------------------------------------------------------------------------- Once installed, your agent can execute commands like: * “Deposit 100 USDC into the SOL-USDC vault” * “Check my current lending positions on Kamino” * “Withdraw 50% of my vault shares” * “Supply 1000 USDC to the lending market” * “What’s the APY on the SOL-USDC vault?” * “Deposit into the KMNO/USDC liquidity strategy” * “What are my pending farm rewards?” * “Harvest all rewards from my staked positions” * “Swap 1 SOL to USDC” * “Get the current SOL price from the oracle” For detailed code examples, see the Kamino documentation links in the reference files. Assistant Responses are generated using AI and may contain mistakes. --- # Get profit and loss for an obligation - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-pnl#content-area) Get profit and loss for an obligation cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl" response = requests.get(url) print(response.text) false 200 422 500 503 { "usd": "25.21", "sol": "1.0", "invested": { "usd": "1234.56789", "sol": "1234.56789" }, "truncatedHistory": true } { "error": "The requested calculation is not supported for this asset" } { "error": "An internal error occurred" } { "error": "" } GET / v2 / kamino-market / {marketPubkey} / obligations / {obligationPubkey} / pnl Try it Get profit and loss for an obligation cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl" response = requests.get(url) print(response.text) false 200 422 500 503 { "usd": "25.21", "sol": "1.0", "invested": { "usd": "1234.56789", "sol": "1234.56789" }, "truncatedHistory": true } { "error": "The requested calculation is not supported for this asset" } { "error": "An internal error occurred" } { "error": "" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-pnl#parameter-market-pubkey) marketPubkey string required Kamino Lend market public key Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-pnl#parameter-obligation-pubkey) obligationPubkey string required Kamino Lend obligation public key Example: `"63QrAB1okxCc4FpsgcKYHjYTp1ua8ch6mLReyKRdc22o"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-pnl#parameter-env) env enum default:mainnet-beta Solana cluster environment Available options: `mainnet-beta`, `devnet`, `localnet` Example: `"mainnet-beta"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-pnl#parameter-program-id) programId string default:KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD KLend program ID Example: `"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-pnl#parameter-use-stake-rate) useStakeRate enum default:false For xSOL pairs, calculate the PnL using the stake rate Available options: `true`, `false` Example: `"true"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-pnl#response-usd) usd string required PnL in USD Example: `"25.21"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-pnl#response-sol) sol string required PnL in SOL Example: `"1.0"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-pnl#response-invested) invested object Invested amounts Show child attributes [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-pnl#response-truncated-history) truncatedHistory boolean Set when the obligation transaction history exceeded the computation cap and older transactions were dropped from the PnL calculation Assistant Responses are generated using AI and may contain mistakes. --- # Kamino API - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/introduction#content-area) Access comprehensive data for Kamino Earn vaults, lending markets, user positions, and transaction endpoints to seamlessly integrate yield strategies and borrowing functionality into your applications. [​](https://kamino.com/docs/build/api-reference/introduction#base-url) Base URL ---------------------------------------------------------------------------------- All Kamino API requests use the following base URL: https://api.kamino.finance Assistant Responses are generated using AI and may contain mistakes. --- # Get KLend rewards - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-list#content-area) Get KLend rewards cURL curl --request GET \ --url https://api.kamino.finance/klend/rewards const options = {method: 'GET'}; fetch('https://api.kamino.finance/klend/rewards', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/klend/rewards" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "depositReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "borrowReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "market": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardToken": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "lastCalculated": "2023-11-07T05:31:56Z",\ "apy": "0.2",\ "tokensPerSecond": "1234.56789",\ "activePositionsUsd": "1234.56789"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / klend / rewards Try it Get KLend rewards cURL curl --request GET \ --url https://api.kamino.finance/klend/rewards const options = {method: 'GET'}; fetch('https://api.kamino.finance/klend/rewards', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/klend/rewards" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "depositReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "borrowReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "market": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardToken": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "lastCalculated": "2023-11-07T05:31:56Z",\ "apy": "0.2",\ "tokensPerSecond": "1234.56789",\ "activePositionsUsd": "1234.56789"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-list#parameter-source) source string Points source identifier Examples: `"Season1"` `"Season2"` `"Season3"` `"Season4"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-list#response-items-deposit-reserve) depositReserve string required Deposit reserve public key, if applicable Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-list#response-items-borrow-reserve) borrowReserve string required Borrow reserve public key, if applicable Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-list#response-items-market) market string required Market public key Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-list#response-items-reward-token) rewardToken string required Mint address of the reward token Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-list#response-items-last-calculated) lastCalculated string required Timestamp of the last calculation [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-list#response-items-apy) apy string required Annual Percentage Yield from rewards Example: `"0.2"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-list#response-items-tokens-per-second) tokensPerSecond string required Number of reward tokens distributed per second Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/borrow/rewards/rewards-list#response-items-active-positions-usd) activePositionsUsd string required Total USD value of active positions receiving rewards Example: `"1234.56789"` Assistant Responses are generated using AI and may contain mistakes. --- # Get KLend obligation history - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-metrics-history#content-area) Get KLend obligation history cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/metrics/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/metrics/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/metrics/history" response = requests.get(url) print(response.text) false 200 500 { "obligation": "3HdrCvoJ91bwgVTejdDXfguo6S2A9jjUkBR5fasq4WhB", "history": [\ {\ "timestamp": "2025-10-17T00:00:00.000Z",\ "refreshedStats": {\ "leverage": "1.0580080950430842892",\ "borrowLimit": "1.3496969599567630906",\ "loanToValue": "0.054827647647367082766",\ "liquidationLtv": "0.75000000000000000001",\ "netAccountValue": "1.7239138521696367095",\ "userTotalBorrow": "0.10000095858274584538",\ "userTotalDeposit": "1.8239148107523825549",\ "borrowUtilization": "0.074091415739685246983",\ "borrowLiquidationLimit": "1.3679361080642869162",\ "userTotalCollateralDeposit": "1.8239148107523825549",\ "userTotalLiquidatableDeposit": "1.8239148107523825549",\ "potentialElevationGroupUpdate": 0,\ "userTotalBorrowBorrowFactorAdjusted": "0.10000095858274584538"\ },\ "deposits": [\ {\ "amount": "10000708.005624756258",\ "mintAddress": "So11111111111111111111111111111111111111112",\ "marketValueRefreshed": "1.8239148107523825549",\ "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59"\ }\ ],\ "borrows": [\ {\ "amount": "10000708.005624756258",\ "mintAddress": "So11111111111111111111111111111111111111112",\ "marketValueRefreshed": "1.8239148107523825549",\ "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59"\ }\ ],\ "tag": 0,\ "obligationSolValues": {\ "netValueSol": "0.009469142566566941841900274495955292427975",\ "collateralValueSol": "0.01001842948854487210536205388880118310325",\ "debtValueSol": "0.0005492869219779302633519230615141419874818",\ "solPrice": "182.05596125",\ "timestampSolPrice": "2025-10-17T00:00:00.000Z",\ "timestampObligation": "2025-10-17T00:00:00.000Z"\ }\ }\ ] } { "error": "An internal error occurred" } GET / v2 / kamino-market / {marketPubkey} / obligations / {obligationPubkey} / metrics / history Try it Get KLend obligation history cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/metrics/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/metrics/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/metrics/history" response = requests.get(url) print(response.text) false 200 500 { "obligation": "3HdrCvoJ91bwgVTejdDXfguo6S2A9jjUkBR5fasq4WhB", "history": [\ {\ "timestamp": "2025-10-17T00:00:00.000Z",\ "refreshedStats": {\ "leverage": "1.0580080950430842892",\ "borrowLimit": "1.3496969599567630906",\ "loanToValue": "0.054827647647367082766",\ "liquidationLtv": "0.75000000000000000001",\ "netAccountValue": "1.7239138521696367095",\ "userTotalBorrow": "0.10000095858274584538",\ "userTotalDeposit": "1.8239148107523825549",\ "borrowUtilization": "0.074091415739685246983",\ "borrowLiquidationLimit": "1.3679361080642869162",\ "userTotalCollateralDeposit": "1.8239148107523825549",\ "userTotalLiquidatableDeposit": "1.8239148107523825549",\ "potentialElevationGroupUpdate": 0,\ "userTotalBorrowBorrowFactorAdjusted": "0.10000095858274584538"\ },\ "deposits": [\ {\ "amount": "10000708.005624756258",\ "mintAddress": "So11111111111111111111111111111111111111112",\ "marketValueRefreshed": "1.8239148107523825549",\ "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59"\ }\ ],\ "borrows": [\ {\ "amount": "10000708.005624756258",\ "mintAddress": "So11111111111111111111111111111111111111112",\ "marketValueRefreshed": "1.8239148107523825549",\ "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59"\ }\ ],\ "tag": 0,\ "obligationSolValues": {\ "netValueSol": "0.009469142566566941841900274495955292427975",\ "collateralValueSol": "0.01001842948854487210536205388880118310325",\ "debtValueSol": "0.0005492869219779302633519230615141419874818",\ "solPrice": "182.05596125",\ "timestampSolPrice": "2025-10-17T00:00:00.000Z",\ "timestampObligation": "2025-10-17T00:00:00.000Z"\ }\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-metrics-history#parameter-market-pubkey) marketPubkey string required Kamino Lend market public key Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-metrics-history#parameter-obligation-pubkey) obligationPubkey string required Kamino Lend obligation public key Example: `"63QrAB1okxCc4FpsgcKYHjYTp1ua8ch6mLReyKRdc22o"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-metrics-history#parameter-env) env enum default:mainnet-beta Solana cluster environment Available options: `mainnet-beta`, `devnet`, `localnet` Example: `"mainnet-beta"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-metrics-history#parameter-one-of-0) start stringnumberstringnumber default:1970-01-01T00:00:00.000Z Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-metrics-history#parameter-one-of-0) end stringnumberstringnumber Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-metrics-history#parameter-use-stake-rate-for-obligation) useStakeRateForObligation enum default:false Use stake rate to calculate net SOL value Available options: `true`, `false` Example: `"true"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-metrics-history#response-obligation) obligation string required Obligation public key Example: `"3HdrCvoJ91bwgVTejdDXfguo6S2A9jjUkBR5fasq4WhB"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/obligation-metrics-history#response-history) history object\[\] required Historical metrics for the obligation Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Get total strategy TVL - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-tvl#content-area) Get total strategy TVL cURL curl --request GET \ --url https://api.kamino.finance/strategies/tvl const options = {method: 'GET'}; fetch('https://api.kamino.finance/strategies/tvl', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/strategies/tvl" response = requests.get(url) print(response.text) false 200 400 500 { "tvl": "0.123" } { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } GET / strategies / tvl Try it Get total strategy TVL cURL curl --request GET \ --url https://api.kamino.finance/strategies/tvl const options = {method: 'GET'}; fetch('https://api.kamino.finance/strategies/tvl', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/strategies/tvl" response = requests.get(url) print(response.text) false 200 400 500 { "tvl": "0.123" } { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-tvl#parameter-env) env string default:mainnet-beta Solana cluster environment. Defaults to mainnet-beta. Example: `"mainnet-beta"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-tvl#response-tvl) tvl string required Aggregate TVL in USD across all live strategies Example: `"0.123"` Assistant Responses are generated using AI and may contain mistakes. --- # Claim Rewards - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/earn/tutorials/claim-rewards#content-area) [​](https://kamino.com/docs/build/earn/tutorials/claim-rewards#claiming-rewards) Claiming Rewards ---------------------------------------------------------------------------------------------------- Retrieve and claim all pending rewards from a vault position. 1 ### [​](https://kamino.com/docs/build/earn/tutorials/claim-rewards#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, Kamino SDK operations, and Kit transaction building. import { createSolanaRpc, createSolanaRpcSubscriptions, address, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { KaminoManager, KaminoVault, getMedianSlotDurationInMsFromLastEpochs, parseKeypairFile, } from '@kamino-finance/klend-sdk'; 2 ### [​](https://kamino.com/docs/build/earn/tutorials/claim-rewards#load-signer-and-initialize-rpc) Load Signer and Initialize RPC Load your keypair from a file and initialize RPC connections for both standard and subscription-based operations. const KEYPAIR_FILE = '/path/to/your/keypair.json'; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const rpcSubscriptions = createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com'); Replace `/path/to/your/keypair.json` with the actual path to your keypair file. The `rpcSubscriptions` enables real-time transaction confirmation. 3 ### [​](https://kamino.com/docs/build/earn/tutorials/claim-rewards#initialize-manager-and-vault) Initialize Manager and Vault Initialize the Kamino manager with slot timing and create a vault instance. const vaultAddress = address('HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E'); // USDC vault const slotDuration = await getMedianSlotDurationInMsFromLastEpochs(); const kaminoManager = new KaminoManager(rpc, slotDuration); const vault = new KaminoVault(rpc, vaultAddress); The `getMedianSlotDurationInMsFromLastEpochs` function calculates the median slot duration from recent epochs for accurate timing. This vault instance represents a specific Kamino vault you want to claim rewards from. 4 ### [​](https://kamino.com/docs/build/earn/tutorials/claim-rewards#generate-claim-rewards-instructions) Generate Claim Rewards Instructions Request all claim reward instructions for the vault from the Kamino manager. const claimRewardsIxs = await kaminoManager.getClaimAllRewardsForVaultIxs(signer, vault); if (!claimRewardsIxs.length) { throw new Error('No instructions returned by Kamino SDK'); } The `getClaimAllRewardsForVaultIxs` method generates instructions to claim all available rewards for your position in the specified vault. If no instructions are returned, there may be no claimable rewards available. 5 ### [​](https://kamino.com/docs/build/earn/tutorials/claim-rewards#build-and-sign-transaction) Build and Sign Transaction Use Kit’s functional pipe pattern to build and sign the transaction with a fresh blockhash. const { value: latestBlockhash } = await rpc.getLatestBlockhash().send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), (tx) => setTransactionMessageFeePayerSigner(signer, tx), (tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), (tx) => appendTransactionMessageInstructions(claimRewardsIxs, tx) ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); Kit’s `pipe` function enables functional composition of transaction building steps. The signed transaction is ready to be sent to the network. 6 ### [​](https://kamino.com/docs/build/earn/tutorials/claim-rewards#send-and-confirm-transaction) Send and Confirm Transaction Send the transaction to the network and wait for confirmation using the subscription-based confirmation method. const signature = getSignatureFromTransaction(signedTransaction); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: 'confirmed', skipPreflight: true, }); console.log('Claim rewards successful! Signature:', signature); Assistant Responses are generated using AI and may contain mistakes. --- # Kamino Portfolio API - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/portfolio#content-area) The Portfolio API returns a wallet’s positions across **every Kamino product in one call**: lending, multiply, leverage, liquidity, earn, private credit, and staking. It’s the single request a dashboard makes to paint the whole picture, plus a companion endpoint for pending farm rewards. **Source data, composed by you.** Positions arrive already valued (each carries `value`/`price`), but portfolio-wide totals, net worth, and PnL are intentionally left to client composition, so you build exactly the rollups your app needs. See [Calculate portfolio totals](https://kamino.com/docs/build/developers/portfolio/response#calculate-portfolio-totals) . **No API key required.** All Portfolio endpoints are public on `https://api.kamino.finance`. [​](https://kamino.com/docs/build/developers/portfolio#endpoints) Endpoints ------------------------------------------------------------------------------ | Method | Endpoint | Returns | | --- | --- | --- | | `GET` | `/portfolio/{pubkey}` | All positions across the seven product sections | | `GET` | `/portfolio/{pubkey}/rewards` | Pending farm rewards across all products | See the full field reference in [Portfolio response](https://kamino.com/docs/build/developers/portfolio/response) . [​](https://kamino.com/docs/build/developers/portfolio#what-you-can-build) What you can build ------------------------------------------------------------------------------------------------ * **Portfolio dashboards:** render every position a wallet holds across Kamino from one request. * **Liquidation and health monitors:** read `ltv` against `liquidationLtv` on lending, multiply, and leverage positions to alert before liquidation. * **Net-worth and PnL tools:** sum `netValue` across sections and convert to USD with the [Oracle prices](https://kamino.com/docs/build/developers/oracle/data/prices) endpoint. * **Reward trackers:** surface pending farm rewards across lending, borrowing, and liquidity in one view. [​](https://kamino.com/docs/build/developers/portfolio#quickstart) Quickstart -------------------------------------------------------------------------------- Fetch a wallet’s full portfolio and count positions per product. const WALLET = 'YOUR_WALLET_ADDRESS'; // replace with your wallet pubkey const API = 'https://api.kamino.finance'; const portfolio = await (await fetch(`${API}/portfolio/${WALLET}`)).json(); console.log('Timestamp:', portfolio.timestamp); const products = ['lending', 'multiply', 'leverage', 'liquidity', 'earn', 'privateCredit', 'staking'] as const; products.forEach((p) => console.log(` ${p}: ${(portfolio[p] || []).length} position(s)`)); Numeric fields are returned as **strings** (for example `"0.38"`, `"100.05"`). Parse them with `parseFloat` before doing math. [​](https://kamino.com/docs/build/developers/portfolio#next-steps) Next steps -------------------------------------------------------------------------------- Portfolio response ------------------ Full field reference for every product section, plus runnable examples. API reference ------------- The raw OpenAPI spec for both Portfolio endpoints. Oracle prices ------------- Convert position amounts to USD when composing totals. Rewards ------- Read and aggregate pending farm rewards across products. Assistant Responses are generated using AI and may contain mistakes. --- # Get user KVault PnL - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl#content-area) Get user KVault PnL cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl" response = requests.get(url) print(response.text) false 200 400 500 { "totalPnl": { "usd": "1234.56789", "sol": "1234.56789", "token": "1234.56789" }, "totalCostBasis": { "usd": "1234.56789", "sol": "1234.56789", "token": "1234.56789" } } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / kvaults / users / {userPubkey} / vaults / {vaultPubkey} / pnl Try it Get user KVault PnL cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl" response = requests.get(url) print(response.text) false 200 400 500 { "totalPnl": { "usd": "1234.56789", "sol": "1234.56789", "token": "1234.56789" }, "totalCostBasis": { "usd": "1234.56789", "sol": "1234.56789", "token": "1234.56789" } } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl#parameter-vault-pubkey) vaultPubkey string required Valid base58-encoded address of the vault Example: `"HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl#parameter-user-pubkey) userPubkey string required Valid base58-encoded address of the user wallet Example: `"AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl#response-total-pnl) totalPnl object required Show child attributes [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl#response-total-cost-basis) totalCostBasis object required Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Get user position for a specific KVault - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-position#content-area) Get user position for a specific KVault cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{userPubkey}/positions/{vaultPubkey} const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{userPubkey}/positions/{vaultPubkey}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{userPubkey}/positions/{vaultPubkey}" response = requests.get(url) print(response.text) false 200 400 404 500 { "vaultAddress": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "stakedShares": "1234.56789", "unstakedShares": "1234.56789", "totalShares": "1234.56789" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } GET / kvaults / users / {userPubkey} / positions / {vaultPubkey} Try it Get user position for a specific KVault cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{userPubkey}/positions/{vaultPubkey} const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{userPubkey}/positions/{vaultPubkey}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{userPubkey}/positions/{vaultPubkey}" response = requests.get(url) print(response.text) false 200 400 404 500 { "vaultAddress": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "stakedShares": "1234.56789", "unstakedShares": "1234.56789", "totalShares": "1234.56789" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-position#parameter-vault-pubkey) vaultPubkey string required Valid base58-encoded address of the vault Example: `"HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-position#parameter-user-pubkey) userPubkey string required Valid base58-encoded address of the user wallet Example: `"AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-position#response-vault-address) vaultAddress string required Address of the Kamino Earn Vault Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-position#response-staked-shares) stakedShares string required The number of Kamino Earn Vault shares staked in a farm Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-position#response-unstaked-shares) unstakedShares string required The number of Kamino Earn Vault shares held in the user wallet Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-position#response-total-shares) totalShares string required The total number of Kamino Earn Vault shares both held and staked by the user Example: `"1234.56789"` Assistant Responses are generated using AI and may contain mistakes. --- # Get user KVault transactions - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#content-area) Get user KVault transactions cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{pubkey}/transactions const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{pubkey}/transactions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{pubkey}/transactions" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "createdOn": "2023-12-25",\ "instruction": "",\ "tokenMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "tokenAmount": "1234.56789",\ "tokenPrice": "1234.56789",\ "solPrice": "1234.56789",\ "sharePrice": "1234.56789",\ "numberOfShares": "1234.56789",\ "usdValue": "1234.56789",\ "transaction": "",\ "kvault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "latestPosition": true\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / kvaults / users / {pubkey} / transactions Try it Get user KVault transactions cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{pubkey}/transactions const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{pubkey}/transactions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{pubkey}/transactions" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "createdOn": "2023-12-25",\ "instruction": "",\ "tokenMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "tokenAmount": "1234.56789",\ "tokenPrice": "1234.56789",\ "solPrice": "1234.56789",\ "sharePrice": "1234.56789",\ "numberOfShares": "1234.56789",\ "usdValue": "1234.56789",\ "transaction": "",\ "kvault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "latestPosition": true\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#parameter-pubkey) pubkey string required Valid base58-encoded address of the user wallet Example: `"AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-created-on) createdOn string required Date when the instruction was created [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-instruction) instruction string required Type of instruction [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-token-mint) tokenMint string required Token mint address Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-token-amount) tokenAmount string required Amount of tokens involved Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-token-price) tokenPrice string required Price of the token at the time of instruction Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-sol-price) solPrice string required Price of SOL at the time of instruction Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-share-price) sharePrice string required Price per share at the time of instruction Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-number-of-shares) numberOfShares string required Number of shares involved Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-usd-value) usdValue string required USD value of the transaction Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-transaction) transaction string required Transaction signature [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-kvault) kvault string required KVault identifier Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-transactions#response-items-latest-position) latestPosition boolean required Indicates if this is the latest position Assistant Responses are generated using AI and may contain mistakes. --- # Claim User Rewards - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/borrow/rewards/claim-user-rewards#content-area) **Delegated vs Non-Delegated Farms**Different farm types use different delegation patterns. For the correct delegatees for your specific farm, check the user farm state returned by `getAllFarmsForUser` in the “Calculate Claimable User Rewards” tutorial. [​](https://kamino.com/docs/build/developers/borrow/rewards/claim-user-rewards#claim-user-rewards) Claim User Rewards ------------------------------------------------------------------------------------------------------------------------ Claim all pending rewards from a user’s farm position. 1 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/claim-user-rewards#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, Kamino SDK operations, and Kit transaction building. import { createSolanaRpc, createSolanaRpcSubscriptions, address, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { KaminoMarket, parseKeypairFile, VanillaObligation, PROGRAM_ID } from '@kamino-finance/klend-sdk'; import { Farms } from '@kamino-finance/farms-sdk'; 2 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/claim-user-rewards#load-signer-and-initialize-rpc) Load Signer and Initialize RPC Load your keypair from a file and initialize RPC connections. // Configuration - UPDATE THESE VALUES const KEYPAIR_FILE = '/path/to/your/keypair.json'; // Load keypair from file const signer = await parseKeypairFile(KEYPAIR_FILE); // Initialize RPC and RPC Subscriptions const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const rpcSubscriptions = createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com'); 3 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/claim-user-rewards#load-market-and-get-obligation) Load Market and Get Obligation Load the Kamino market and get the user’s obligation address. const marketPubkey = address('7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'); const market = await KaminoMarket.load(rpc, marketPubkey, 400); // Get obligation address for delegatees array const kaminoObligation = await market!.getObligationByWallet(signer.address, new VanillaObligation(PROGRAM_ID)); if (!kaminoObligation) { throw new Error('No obligation found'); } console.log('Obligation:', kaminoObligation.obligationAddress.toString()); 4 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/claim-user-rewards#build-claim-instructions) Build Claim Instructions Use the Farms SDK to build claim instructions for all rewards on the farm. // Build claim instructions using farms-sdk const farm = new Farms(rpc); const claimIxs = await farm.claimForUserForFarmAllRewardsIx( signer, // payer signer.address, // user (wallet address = owner) address('Gsoc83qRQ5X1LfGGbPqU2FdxZnveqbkP2vMXq6BcmtMk'), // farm true, // isDelegated = true for lending farms [signer.address, kaminoObligation.obligationAddress] // delegatees array ); The `delegatees` array values depend on your specific farm position. To find the correct delegatee addresses for your farm, use the “Calculate Claimable User Rewards” tutorial - it shows the actual delegatee in the user farm state. 5 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/claim-user-rewards#build-and-sign-transaction) Build and Sign Transaction Use Kit’s functional pipe pattern to build and sign the transaction with a fresh blockhash. const { value: latestBlockhash } = await rpc.getLatestBlockhash({ commitment: 'finalized' }).send(); const claimTx = pipe( createTransactionMessage({ version: 0 }), (tx) => setTransactionMessageFeePayerSigner(signer, tx), (tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), (tx) => appendTransactionMessageInstructions(claimIxs, tx) ); const claimSigned = await signTransactionMessageWithSigners(claimTx); const claimSignature = getSignatureFromTransaction(claimSigned); 6 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/claim-user-rewards#send-and-confirm-transaction) Send and Confirm Transaction Send the transaction to the network and wait for confirmation. await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(claimSigned, { commitment: 'confirmed', skipPreflight: true, }); console.log(`Claim farm rewards successful! Signature: ${claimSignature}`); The rewards have been claimed and transferred to your wallet. You can verify the transaction using the signature on a Solana explorer. Assistant Responses are generated using AI and may contain mistakes. --- # Install and Setup the Kamino CLI - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/cli/installation-setup#content-area) The Kamino Manager CLI is a command-line tool for creating and managing Kamino lending markets, reserves, and vaults. [​](https://kamino.com/docs/build/cli/installation-setup#prerequisites) Prerequisites ---------------------------------------------------------------------------------------- Before installing the Kamino Manager CLI: Node.js, Yarn package manager, and Solana CLI tools are required to run the Kamino Manager CLI. [​](https://kamino.com/docs/build/cli/installation-setup#installation) Installation -------------------------------------------------------------------------------------- Follow these steps to install and configure the Kamino Manager CLI: 1 Install Node.js and Yarn Install Node.js from [nodejs.org](https://nodejs.org/) , then install Yarn package manager. npm install -g yarn 2 Install Solana CLI Install the Solana CLI tools to create and manage keypairs. sh -c "$(curl -sSfL https://release.solana.com/v1.18.18/install)" After installation, restart the terminal to ensure the Solana CLI is available in PATH. 3 Clone and Setup Kamino Manager Clone the Kamino SDK repository and install dependencies. git clone git@github.com:Kamino-Finance/klend-sdk.git cd klend-sdk yarn This will install all necessary dependencies for the Kamino Manager CLI. [​](https://kamino.com/docs/build/cli/installation-setup#configuration) Configuration ---------------------------------------------------------------------------------------- After installation, configure the Kamino Manager CLI with a wallet and RPC endpoint. 1 Create Admin Keypair Create a new keypair that will serve as the admin account for managing markets and vaults. solana-keygen new -o admin.json Store the keypair file securely and never share it. This keypair will need SOL for transaction fees. Existing keypairs can be used instead of creating a new one. Specify the path to the existing keypair file in the configuration. 2 Configure Environment Variables Create a `.env` file in the `klend-sdk` directory and configure the following variables: # Path to admin keypair file ADMIN=./admin.json # Solana RPC endpoint RPC=https://api.mainnet-beta.solana.com # Program IDs KLEND_PROGRAM_ID_MAINNET="KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD" KVAULT_PROGRAM_ID_MAINNET="KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd" KLEND_PROGRAM_ID_STAGING="SLendK7ySfcEzyaFqy93gDnD3RtrpXJcnRwb6zFHJSh" KVAULT_PROGRAM_ID_STAGING="stKvQfwRsQiKnLtMNVLHKS3exFJmZFsgfzBPWHECUYK" KVAULT_PROGRAM_ID_DEVNET="devkRngFnfp4gBc5a3LsadgbQKdPo8MSZ4prFiNSVmY" For production use, it’s recommended to use a private RPC endpoint from providers like [Helius](https://www.helius.dev/) . Public RPCs are rate-limited and may cause transaction failures. 3 Fund Your Admin Account Transfer SOL to the admin account to pay for transaction fees. Get the admin account address: solana-keygen pubkey admin.json Transfer SOL to this address from another wallet or acquire it from an exchange. [​](https://kamino.com/docs/build/cli/installation-setup#verify-installation) Verify Installation ---------------------------------------------------------------------------------------------------- Run a simple command to verify everything is set up correctly: yarn run kamino-manager --help The help output should display available commands for managing markets and vaults. [​](https://kamino.com/docs/build/cli/installation-setup#next-steps) Next Steps ---------------------------------------------------------------------------------- The Kamino Manager CLI is now installed and ready for managing markets and vaults: Market Operations ----------------- Create and manage lending markets and reserves Vault Operations ---------------- Create and manage Kamino vaults Assistant Responses are generated using AI and may contain mistakes. --- # Get all KVault season rewards - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-rewards#content-area) Get all KVault season rewards cURL curl --request GET \ --url https://api.kamino.finance/kvaults/rewards const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/rewards', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/rewards" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "kvault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardToken": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "lastCalculated": "2023-12-25",\ "apy": "0.2",\ "tokensPerSecond": "1234.56789"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / kvaults / rewards Try it Get all KVault season rewards cURL curl --request GET \ --url https://api.kamino.finance/kvaults/rewards const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/rewards', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/rewards" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "kvault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardToken": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "lastCalculated": "2023-12-25",\ "apy": "0.2",\ "tokensPerSecond": "1234.56789"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-rewards#parameter-source) source string Points source identifier Examples: `"Season1"` `"Season2"` `"Season3"` `"Season4"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-rewards#response-items-kvault) kvault string required Address of the kvault Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-rewards#response-items-reward-token) rewardToken string required Mint address of the reward token Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-rewards#response-items-last-calculated) lastCalculated string required Timestamp of the last calculation [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-rewards#response-items-apy) apy string required Annual Percentage Yield from rewards in the kvault Example: `"0.2"` [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-rewards#response-items-tokens-per-second) tokensPerSecond string required Number of reward tokens distributed per second Example: `"1234.56789"` Assistant Responses are generated using AI and may contain mistakes. --- # Get user KVault PnL history - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl-history#content-area) Get user KVault PnL history cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history" response = requests.get(url) print(response.text) false 200 400 500 { "history": [\ {\ "timestamp": 123,\ "type": "buy",\ "position": "1234.56789",\ "quantity": "1234.56789",\ "tokenPrice": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "sharePrice": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "costBasis": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "realizedPnl": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "pnl": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "positionValue": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "investment": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ }\ }\ ], "totalPnl": { "usd": "1234.56789", "sol": "1234.56789", "token": "1234.56789" }, "totalCostBasis": { "usd": "1234.56789", "sol": "1234.56789", "token": "1234.56789" } } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / kvaults / users / {userPubkey} / vaults / {vaultPubkey} / pnl / history Try it Get user KVault PnL history cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history" response = requests.get(url) print(response.text) false 200 400 500 { "history": [\ {\ "timestamp": 123,\ "type": "buy",\ "position": "1234.56789",\ "quantity": "1234.56789",\ "tokenPrice": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "sharePrice": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "costBasis": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "realizedPnl": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "pnl": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "positionValue": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ },\ "investment": {\ "usd": "1234.56789",\ "sol": "1234.56789",\ "token": "1234.56789"\ }\ }\ ], "totalPnl": { "usd": "1234.56789", "sol": "1234.56789", "token": "1234.56789" }, "totalCostBasis": { "usd": "1234.56789", "sol": "1234.56789", "token": "1234.56789" } } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl-history#parameter-vault-pubkey) vaultPubkey string required Valid base58-encoded address of the vault Example: `"HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl-history#parameter-user-pubkey) userPubkey string required Valid base58-encoded address of the user wallet Example: `"AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl-history#parameter-one-of-0) start stringnumberstringnumber Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl-history#parameter-one-of-0) end stringnumberstringnumber Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl-history#response-history) history object\[\] required Show child attributes [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl-history#response-total-pnl) totalPnl object required Show child attributes [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-pnl-history#response-total-cost-basis) totalCostBasis object required Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Get information about a loan (obligation) - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/loan-detail#content-area) Get information about a loan (obligation) cURL curl --request GET \ --url https://api.kamino.finance/klend/loans/{pubkey} const options = {method: 'GET'}; fetch('https://api.kamino.finance/klend/loans/{pubkey}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/klend/loans/{pubkey}" response = requests.get(url) print(response.text) false 200 400 404 422 500 503 { "loanId": "wGzt1J5Nr182HHqAc1zsfD9SLoe1MJb25VWih5NRY", "marketId": "6HT16972HHiY4RM33GfUc22pHZ3VLDPpXFWhQ7XJzA", "user": "7yexZcPbepXgWw3Cxc7YB2eLaxwyuyshRbAF8XHDi2g", "timestamp": 1760707165421, "solanaSlot": 373973788, "elevationGroup": 0, "leverage": "0.5", "loanInfo": { "collateral": { "deposits": [\ {\ "tokenMint": "So11111111111111111111111111111111111111112",\ "tokenName": "SOL",\ "tokenAmount": "0.0100002082771212",\ "tokenValue": "1.80421579010444",\ "maxLtv": 0.74,\ "liquidationLtv": 0.75,\ "maxWithdrawableAmount": 51225.5590659256,\ "maxWithdrawableValue": "9242003.76257327",\ "tokenPrice": 180.41782132\ }\ ] }, "debt": { "borrows": [\ {\ "tokenMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",\ "tokenName": "USDC",\ "tokenAmount": "0.100002775657846",\ "tokenValue": "0.0999921413626825",\ "maxBorrowableAmount": 1.30084031718889,\ "maxBorrowableValue": "1.30070198582957",\ "tokenPrice": 0.99989366,\ "borrowFactor": 1\ }\ ] }, "currentLtv": 0.0554213869045533, "maxLtv": 0.74, "liquidationLtv": 0.75, "closeFactor": 0.1 } } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "The requested calculation is not supported for this asset" } { "error": "An internal error occurred" } { "error": "" } GET / klend / loans / {pubkey} Try it Get information about a loan (obligation) cURL curl --request GET \ --url https://api.kamino.finance/klend/loans/{pubkey} const options = {method: 'GET'}; fetch('https://api.kamino.finance/klend/loans/{pubkey}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/klend/loans/{pubkey}" response = requests.get(url) print(response.text) false 200 400 404 422 500 503 { "loanId": "wGzt1J5Nr182HHqAc1zsfD9SLoe1MJb25VWih5NRY", "marketId": "6HT16972HHiY4RM33GfUc22pHZ3VLDPpXFWhQ7XJzA", "user": "7yexZcPbepXgWw3Cxc7YB2eLaxwyuyshRbAF8XHDi2g", "timestamp": 1760707165421, "solanaSlot": 373973788, "elevationGroup": 0, "leverage": "0.5", "loanInfo": { "collateral": { "deposits": [\ {\ "tokenMint": "So11111111111111111111111111111111111111112",\ "tokenName": "SOL",\ "tokenAmount": "0.0100002082771212",\ "tokenValue": "1.80421579010444",\ "maxLtv": 0.74,\ "liquidationLtv": 0.75,\ "maxWithdrawableAmount": 51225.5590659256,\ "maxWithdrawableValue": "9242003.76257327",\ "tokenPrice": 180.41782132\ }\ ] }, "debt": { "borrows": [\ {\ "tokenMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",\ "tokenName": "USDC",\ "tokenAmount": "0.100002775657846",\ "tokenValue": "0.0999921413626825",\ "maxBorrowableAmount": 1.30084031718889,\ "maxBorrowableValue": "1.30070198582957",\ "tokenPrice": 0.99989366,\ "borrowFactor": 1\ }\ ] }, "currentLtv": 0.0554213869045533, "maxLtv": 0.74, "liquidationLtv": 0.75, "closeFactor": 0.1 } } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "The requested calculation is not supported for this asset" } { "error": "An internal error occurred" } { "error": "" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/loan-detail#parameter-pubkey) pubkey string required Valid base58-encoded address Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/loan-detail#parameter-env) env enum default:mainnet-beta Solana cluster environment Available options: `mainnet-beta`, `devnet`, `localnet` Example: `"mainnet-beta"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/loan-detail#response-loan-id) loanId string required The loan (obligation) public key Example: `"wGzt1J5Nr182HHqAc1zsfD9SLoe1MJb25VWih5NRY"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/loan-detail#response-market-id) marketId string required The market public key Example: `"6HT16972HHiY4RM33GfUc22pHZ3VLDPpXFWhQ7XJzA"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/loan-detail#response-user) user string required The loan owner public key Example: `"7yexZcPbepXgWw3Cxc7YB2eLaxwyuyshRbAF8XHDi2g"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/loan-detail#response-timestamp) timestamp number required UTC timestamp when this report was produced Example: `1760707165421` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/loan-detail#response-solana-slot) solanaSlot number required Solana slot when this report was produced Example: `373973788` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/loan-detail#response-elevation-group) elevationGroup number required The elevation group assigned to this obligation for isolation of risks Example: `0` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/loan-detail#response-leverage) leverage number required Current leverage ratio of the position Example: `"0.5"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/loan-detail#response-loan-info) loanInfo object required Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Borrow Overview - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/borrow#content-area) ![](https://mintcdn.com/kamino-3d73a151/wADNksI7oget4gqs/images/borrow/kamino-dots.svg?w=2500&fit=max&auto=format&n=wADNksI7oget4gqs&q=85&s=c22a1a90c3c51266bda1cdaebf0bf90c) Borrow & Lend =============== Integrate borrow and lending markets, and build leveraged positions with Multiply. $2.7B Market Size $1B Active Borrows 18+ Audits How It Works ------------ A high-level view of the Borrow model. ![Deposit icon](https://mintcdn.com/kamino-3d73a151/wADNksI7oget4gqs/images/borrow/deposit.png?w=2500&fit=max&auto=format&n=wADNksI7oget4gqs&q=85&s=53bc161b4c626170aaa69beb8e71c5ac) ### Deposit User supplies collateral tokens. An obligation is created to track their position and enable borrowing capacity. ![Borrow icon](https://mintcdn.com/kamino-3d73a151/wADNksI7oget4gqs/images/borrow/borrow.png?w=2500&fit=max&auto=format&n=wADNksI7oget4gqs&q=85&s=072f03b7dd49734f5e8ed91e8b1e2ba2) ### Borrow User borrows assets against collateral. LTV ratio determines borrow limit. Interest accrues on borrowed amount. ![Repay icon](https://mintcdn.com/kamino-3d73a151/wADNksI7oget4gqs/images/borrow/repay.png?w=2500&fit=max&auto=format&n=wADNksI7oget4gqs&q=85&s=508a361e80b59603a4e6eea9e1a3ff65) ### Repay User repays borrowed assets plus interest. Reduces debt, improves health factor, and unlocks collateral for withdrawal. Borrow Integration Model ------------------------ Built for seamless integration. Borrow centers on three core layers of composability. [Markets & Reserves](https://kamino.com/docs/build/borrow#bim-markets) [Transactions](https://kamino.com/docs/build/borrow#bim-transactions) [Positions & Health](https://kamino.com/docs/build/borrow#bim-positions) ![Layer 1, Markets and Reserves: browse reserves to supply and borrow capital and understand each market's conditions before routing users](https://mintcdn.com/kamino-3d73a151/wADNksI7oget4gqs/images/borrow/integration-markets.png?w=2500&fit=max&auto=format&n=wADNksI7oget4gqs&q=85&s=371f7f35af253e90b53e8e60239b0e07) ![Layer 2, Transactions: turn lending actions into signable flows, from account setup to obligation management and transaction construction](https://mintcdn.com/kamino-3d73a151/wADNksI7oget4gqs/images/borrow/integration-transactions.png?w=2500&fit=max&auto=format&n=wADNksI7oget4gqs&q=85&s=134293e9afb525e017cc5f0a8165943d) ![Layer 3, Positions and Health: bring account health into focus across the borrow lifecycle to keep users within healthy borrowing ranges](https://mintcdn.com/kamino-3d73a151/wADNksI7oget4gqs/images/borrow/integration-positions.png?w=2500&fit=max&auto=format&n=wADNksI7oget4gqs&q=85&s=47cac655686e3385370bfec350d91775) ### Markets & Reserves Browse reserves to supply and borrow capital, and understand the conditions of each market before routing users. Best Tools: REST API, TypeScript SDK Available Market Data: supply APY, borrow APY, utilization, liquidity, market configuration, reserve metadata, reward farms, and bonus yield. ### Transactions Turn lending actions into signable flows, from account setup to obligation management and transaction construction. Best Tools: TypeScript SDK, REST API, Rust Interface Crate Available Transaction Flows: user account setup, obligation account creation, transaction construction, flash loans. ### Positions & Health Bring account health into focus across the borrow lifecycle, helping users stay within healthy borrowing ranges. Best Tools: TypeScript SDK, REST API Available Position Data: obligations, user PnL, portfolio value, collateral balances, debt balances, LTV, health factors, borrowing capacity, liquidation thresholds, and position history. Start Building -------------- Explore guides, tutorials, and API references. [### SDK Tutorials\ \ Step-by-step guides for building with Kamino lending markets.\ \ View Tutorials](https://kamino.com/build/borrow/tutorials/deposit-and-borrow) [### API Recipes\ \ Quick code examples for common lending operations via API.\ \ View Recipes](https://kamino.com/build/borrow/recipes/deposit-via-api) [### Rust Tutorials\ \ Deposit, borrow, repay, and withdraw using the klend-interface Rust crate.\ \ View Tutorials](https://kamino.com/build/borrow/tutorials/rust/deposit-and-borrow) [### Multiply Integration\ \ Build leveraged positions with flash loans and swaps.\ \ Learn More](https://kamino.com/build/borrow/multiply/leverage-concepts) Assistant Responses are generated using AI and may contain mistakes. --- # Get Vault APYs - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/earn/get-vault-apys#content-area) [​](https://kamino.com/docs/build/earn/get-vault-apys#how-vault-apy-is-calculated) 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 SOL/BTC 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. * API * SDK 1 ### [​](https://kamino.com/docs/build/earn/get-vault-apys#fetch-all-vaults) 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. 2 ### [​](https://kamino.com/docs/build/earn/get-vault-apys#get-apy-for-each-vault) 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. 1 ### [​](https://kamino.com/docs/build/earn/get-vault-apys#import-dependencies) 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'; 2 ### [​](https://kamino.com/docs/build/earn/get-vault-apys#initialize-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); 3 ### [​](https://kamino.com/docs/build/earn/get-vault-apys#get-all-vaults) Get All Vaults Retrieve all available vaults using the Kamino Manager. const vaults = await kaminoManager.getAllVaults(); 4 ### [​](https://kamino.com/docs/build/earn/get-vault-apys#get-apys-for-each-vault) 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. [​](https://kamino.com/docs/build/earn/get-vault-apys#related-resources) Related Resources --------------------------------------------------------------------------------------------- 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 Assistant Responses are generated using AI and may contain mistakes. --- # Earn Deposit with the API - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/earn/recipes/earn-via-api#content-area) [​](https://kamino.com/docs/build/earn/recipes/earn-via-api#earn-deposit-with-api) Earn Deposit with API ----------------------------------------------------------------------------------------------------------- 1 ### [​](https://kamino.com/docs/build/earn/recipes/earn-via-api#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, transaction handling, and Kamino SDK utilities. import { createSolanaRpc, createSolanaRpcSubscriptions, pipe, getTransactionDecoder, getCompiledTransactionMessageDecoder, decompileTransactionMessageFetchingLookupTables, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, addSignersToTransactionMessage, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { parseKeypairFile } from '@kamino-finance/klend-sdk/dist/utils/signer.js'; 2 ### [​](https://kamino.com/docs/build/earn/recipes/earn-via-api#configure-and-initialize) Configure and Initialize Set up the configuration and initialize RPC connections. const KEYPAIR_FILE = '/path/to/your/keypair.json'; const API_BASE_URL = 'https://api.kamino.finance'; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const rpcSubscriptions = createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com'); 3 ### [​](https://kamino.com/docs/build/earn/recipes/earn-via-api#call-kamino-api) Call Kamino API Make a POST request to the Kamino API to build the deposit transaction. const response = await fetch(`${API_BASE_URL}/ktx/kvault/deposit`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ wallet: signer.address, kvault: 'HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E', amount: '1.0', }), }); if (!response.ok) { const error = await response.json(); throw new Error(`API error: ${error.message}`); } const { transaction: encodedTransaction } = await response.json(); The API returns a pre-built transaction encoded in base64 format. This transaction includes Address Lookup Tables (ALTs) for efficiency. 4 ### [​](https://kamino.com/docs/build/earn/recipes/earn-via-api#decode-transaction) Decode Transaction Decode the base64-encoded transaction and extract the message bytes. const txBuffer = Buffer.from(encodedTransaction, 'base64'); const txMessageBytes = getTransactionDecoder().decode(txBuffer).messageBytes; const compiledMessage = getCompiledTransactionMessageDecoder().decode(txMessageBytes); 5 ### [​](https://kamino.com/docs/build/earn/recipes/earn-via-api#resolve-address-lookup-tables) Resolve Address Lookup Tables Fetch and resolve the Address Lookup Tables from the blockchain. const { value: latestBlockhash } = await rpc.getLatestBlockhash({ commitment: 'finalized' }).send(); const signedTransaction = await pipe( await decompileTransactionMessageFetchingLookupTables(compiledMessage, rpc), (tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), (tx) => setTransactionMessageFeePayerSigner(signer, tx), (tx) => addSignersToTransactionMessage([signer], tx), (tx) => signTransactionMessageWithSigners(tx) ); `decompileTransactionMessageFetchingLookupTables` fetches the lookup table data from the blockchain and resolves all address references. This is required for transactions that use ALTs. A fresh blockhash is fetched and set to ensure the transaction remains valid. 6 ### [​](https://kamino.com/docs/build/earn/recipes/earn-via-api#send-and-confirm-transaction) Send and Confirm Transaction Submit the signed transaction to the Solana network. const signature = getSignatureFromTransaction(signedTransaction); console.log(`Sending transaction with signature: ${signature}`); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: 'confirmed', skipPreflight: true, }); console.log('Deposit successful! Signature:', signature); Your deposit is complete! The API built the transaction, you signed it locally (keeping your keys secure), and it was successfully submitted to the network. Assistant Responses are generated using AI and may contain mistakes. --- # Earn Withdraw with the API - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/earn/recipes/earn-withdraw-via-api#content-area) [​](https://kamino.com/docs/build/earn/recipes/earn-withdraw-via-api#earn-withdraw-with-api) Earn Withdraw with API ---------------------------------------------------------------------------------------------------------------------- 1 ### [​](https://kamino.com/docs/build/earn/recipes/earn-withdraw-via-api#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, transaction handling, and Kamino SDK utilities. import { createSolanaRpc, createSolanaRpcSubscriptions, pipe, getTransactionDecoder, getCompiledTransactionMessageDecoder, decompileTransactionMessageFetchingLookupTables, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, addSignersToTransactionMessage, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { parseKeypairFile } from '@kamino-finance/klend-sdk/dist/utils/signer.js'; 2 ### [​](https://kamino.com/docs/build/earn/recipes/earn-withdraw-via-api#configure-and-initialize) Configure and Initialize Set up the configuration and initialize RPC connections. const KEYPAIR_FILE = '/path/to/your/keypair.json'; const API_BASE_URL = 'https://api.kamino.finance'; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const rpcSubscriptions = createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com'); 3 ### [​](https://kamino.com/docs/build/earn/recipes/earn-withdraw-via-api#call-kamino-api) Call Kamino API Make a POST request to the Kamino API to build the withdrawal transaction. const response = await fetch(`${API_BASE_URL}/ktx/kvault/withdraw`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ wallet: signer.address, kvault: 'HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E', amount: '1.0', }), }); if (!response.ok) { const error = await response.json(); throw new Error(`API error: ${error.message}`); } const { transaction: encodedTransaction } = await response.json(); The API returns a pre-built transaction encoded in base64 format. This transaction includes Address Lookup Tables (ALTs) for efficiency. 4 ### [​](https://kamino.com/docs/build/earn/recipes/earn-withdraw-via-api#decode-transaction) Decode Transaction Decode the base64-encoded transaction and extract the message bytes. const txBuffer = Buffer.from(encodedTransaction, 'base64'); const txMessageBytes = getTransactionDecoder().decode(txBuffer).messageBytes; const compiledMessage = getCompiledTransactionMessageDecoder().decode(txMessageBytes); 5 ### [​](https://kamino.com/docs/build/earn/recipes/earn-withdraw-via-api#resolve-address-lookup-tables) Resolve Address Lookup Tables Fetch and resolve the Address Lookup Tables from the blockchain. const { value: latestBlockhash } = await rpc.getLatestBlockhash({ commitment: 'finalized' }).send(); const signedTransaction = await pipe( await decompileTransactionMessageFetchingLookupTables(compiledMessage, rpc), (tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), (tx) => setTransactionMessageFeePayerSigner(signer, tx), (tx) => addSignersToTransactionMessage([signer], tx), (tx) => signTransactionMessageWithSigners(tx) ); `decompileTransactionMessageFetchingLookupTables` fetches the lookup table data from the blockchain and resolves all address references. This is required for transactions that use ALTs. A fresh blockhash is fetched and set to ensure the transaction remains valid. 6 ### [​](https://kamino.com/docs/build/earn/recipes/earn-withdraw-via-api#send-and-confirm-transaction) Send and Confirm Transaction Submit the signed transaction to the Solana network. const signature = getSignatureFromTransaction(signedTransaction); console.log(`Sending transaction with signature: ${signature}`); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: 'confirmed', skipPreflight: true, }); console.log('Withdrawal successful! Signature:', signature); Your withdrawal is complete! The API built the transaction, you signed it locally (keeping your keys secure), and it was successfully submitted to the network. Assistant Responses are generated using AI and may contain mistakes. --- # Kamino Program Addresses - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/resources/program-addresses#content-area) [​](https://kamino.com/docs/build/resources/program-addresses#klend) Klend ----------------------------------------------------------------------------- | Environment | Address | | --- | --- | | Mainnet | `KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD` | | Staging (Mainnet) | `SLendK7ySfcEzyaFqy93gDnD3RtrpXJcnRwb6zFHJSh` | | Devnet | `KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD` | [​](https://kamino.com/docs/build/resources/program-addresses#kvault) Kvault ------------------------------------------------------------------------------- | Environment | Address | | --- | --- | | Mainnet | `KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd` | | Staging (Mainnet) | `stKvQfwRsQiKnLtMNVLHKS3exFJmZFsgfzBPWHECUYK` | | Devnet | `devkRngFnfp4gBc5a3LsadgbQKdPo8MSZ4prFiNSVmY` | [​](https://kamino.com/docs/build/resources/program-addresses#kfarms) Kfarms ------------------------------------------------------------------------------- | Environment | Address | | --- | --- | | Mainnet | `FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr` | | Devnet | `FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr` | [​](https://kamino.com/docs/build/resources/program-addresses#limo) Limo --------------------------------------------------------------------------- | Environment | Address | | --- | --- | | Mainnet | `LiMoM9rMhrdYrfzUCxQppvxCSG1FcrUK9G8uLq4A1GF` | | Staging (Mainnet) | `sLim6uuAFC8kAWstWpu1r6oJD4T8VR6raukSpU2Zim7` | [​](https://kamino.com/docs/build/resources/program-addresses#scope) Scope ----------------------------------------------------------------------------- | Environment | Address | | --- | --- | | Mainnet | `HFn8GnPADiny6XqUoWE8uRPPxb29ikn4yTuPa9MF2fWJ` | | Staging (Mainnet) | `scpStzYvKzE7DHwsGMP5XLhcMTuLr3feoiC9mJ3yHr5` | [​](https://kamino.com/docs/build/resources/program-addresses#kliquidity) Kliquidity --------------------------------------------------------------------------------------- | Environment | Address | | --- | --- | | Mainnet | `6LtLpnUFNByNXLyCoK9wA2MykKAmQNZKBdY8s47dehDc` | Assistant Responses are generated using AI and may contain mistakes. --- # Get user transactions - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-transactions#content-area) Get user transactions cURL curl --request GET \ --url https://api.kamino.finance/v2/shareholders/{walletPubkey}/transactions const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/shareholders/{walletPubkey}/transactions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/shareholders/{walletPubkey}/transactions" response = requests.get(url) print(response.text) false 200 400 500 { "transactions": [\ {}\ ] } { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } GET / v2 / shareholders / {walletPubkey} / transactions Try it Get user transactions cURL curl --request GET \ --url https://api.kamino.finance/v2/shareholders/{walletPubkey}/transactions const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/shareholders/{walletPubkey}/transactions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/shareholders/{walletPubkey}/transactions" response = requests.get(url) print(response.text) false 200 400 500 { "transactions": [\ {}\ ] } { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-transactions#parameter-wallet-pubkey) walletPubkey string required Wallet address of the user Example: `"AcNSmd5CxwLs21TYUmhWt7CW2v159TdYRkvQxb1iBYRj"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-transactions#parameter-env) env string default:mainnet-beta Solana cluster environment. Defaults to mainnet-beta. Example: `"mainnet-beta"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-transactions#response-transactions) transactions object\[\] required Deposit, withdrawal, and claim transactions Assistant Responses are generated using AI and may contain mistakes. --- # Vault Operations - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/cli/vault-operations#content-area) Use the Kamino Manager CLI to create vaults, manage reserve allocations, and configure vault parameters. Before starting, complete the [Installation & Setup](https://kamino.com/docs/build/cli/installation-setup) guide. Commands require a .env file with ADMIN (path to vault owner keypair) and RPC configured. [​](https://kamino.com/docs/build/cli/vault-operations#understanding-cli-modes) Understanding CLI Modes ---------------------------------------------------------------------------------------------------------- All Kamino Manager commands support different execution modes to test and verify operations before committing them: * **inspect** - Preview the transaction without executing it * **simulate** - Test the transaction simulation on-chain * **execute** - Execute the transaction immediately * **multisig** - Generate a multisig proposal for the operation It’s recommended to always start with `inspect` or `simulate` mode to verify transactions before running with `execute`. [​](https://kamino.com/docs/build/cli/vault-operations#network-selection) Network Selection ---------------------------------------------------------------------------------------------- By default, all commands run against **mainnet** and no additional flag is needed. To target a different network, pass one of the following flags: * `--staging` — Use the staging program ID * `--devnet` — Use the devnet program ID # Mainnet (default, no flag needed) yarn kamino-manager create-vault --mint --mode execute # Staging yarn kamino-manager create-vault --mint --mode execute --staging # Devnet yarn kamino-manager create-vault --mint --mode execute --devnet The corresponding program IDs (`KVAULT_PROGRAM_ID_MAINNET`, `KVAULT_PROGRAM_ID_STAGING`, `KVAULT_PROGRAM_ID_DEVNET`) must be configured in your `.env` file. See the [Installation & Setup](https://kamino.com/docs/build/cli/installation-setup) guide. [​](https://kamino.com/docs/build/cli/vault-operations#create-a-new-vault) Create a New Vault ------------------------------------------------------------------------------------------------ Create a new Kamino vault to manage automated liquidity strategies. 1 Create Vault Run the create vault command with the desired liquidity token mint. yarn kamino-manager create-vault --mint --mode execute For testing purposes, add the `--staging` flag to use the staging program ID or `--devnet` to use the devnet program ID. These flags are applicable to all CLI commands. 2 Save Vault Address After creation, save the vault address from the command output. This address is required for all subsequent vault operations. [​](https://kamino.com/docs/build/cli/vault-operations#manage-reserve-allocations) Manage Reserve Allocations ---------------------------------------------------------------------------------------------------------------- Configure how vault assets are distributed across different lending reserves. ### [​](https://kamino.com/docs/build/cli/vault-operations#add-or-update-reserve-allocation) Add or Update Reserve Allocation Add a new reserve to the vault or update an existing reserve’s allocation parameters. yarn kamino-manager update-vault-reserve-allocation \ --vault \ --reserve \ --allocation-weight \ --allocation-cap \ --mode simulate **Parameters:** * `allocation-weight` - The allocation weight for this reserve; only relevant in relation to other reserve weights (proportional). If Reserve A has weight 100,000 and Reserve B has weight 50,000, Reserve A gets 2/3 of vault assets and Reserve B gets 1/3 * `allocation-cap` - The allocation cap in decimal (not lamports) for this reserve **Example:** Adding PRIME market allocation yarn kamino-manager update-vault-reserve-allocation \ --vault 67dqmR76uAbjX6e81A1ganKv3ou31WUMEdeWJkwVfeXy \ --reserve 9GJ9GBRwCp4pHmWrQ43L5xpc9Vykg7jnfwcFGN8FoHYu \ --allocation-weight 100000 \ --allocation-cap 18446744073709.551615 \ --mode simulate First run with `--mode simulate` to verify the operation works as expected, then use `--mode execute` to send the transaction. ### [​](https://kamino.com/docs/build/cli/vault-operations#remove-reserve-allocation) Remove Reserve Allocation Remove a reserve from the vault’s allocation strategy. yarn kamino-manager remove-vault-allocation \ --vault \ --reserve \ --mode simulate **Example:** Removing USDC reserve from fartcoin market yarn kamino-manager remove-vault-allocation \ --vault 67dqmR76uAbjX6e81A1ganKv3ou31WUMEdeWJkwVfeXy \ --reserve F22tnLsbv66vEU2GZRc7coaqZsr8UcBbyp9V2kqWAiWK \ --mode simulate [​](https://kamino.com/docs/build/cli/vault-operations#vault-ownership-management) Vault Ownership Management ---------------------------------------------------------------------------------------------------------------- Transfer vault ownership to a different admin account. For production vaults, we recommend transferring ownership to a [Squads](https://squads.xyz/multisig) multisig with hardware wallet support. 1 Set Pending Admin Update the vault’s pending admin to the new owner address. yarn kamino-manager update-vault-pending-admin \ --vault \ --new-admin \ --mode execute **Parameters:** * `vault` - The vault address to change the pending admin for * `new-admin` - The new admin pubkey to set as pending admin (typically a multisig address) 2 Accept Ownership The new admin must accept ownership to complete the transfer. yarn kamino-manager accept-ownership \ --vault \ --mode execute This command must be run with the new admin’s keypair in the ADMIN field of the .env file. [​](https://kamino.com/docs/build/cli/vault-operations#fee-management) Fee Management ---------------------------------------------------------------------------------------- Configure and manage vault performance and management fees. ### [​](https://kamino.com/docs/build/cli/vault-operations#performance-fees) Performance Fees Set the performance fee taken on generated yield. yarn kamino-manager update-vault-perf-fee \ --vault \ --fee-bps \ --mode execute The fee is specified in basis points (1 bps = 0.01%). ### [​](https://kamino.com/docs/build/cli/vault-operations#management-fees) Management Fees Set the yearly management fee for vault operations. yarn kamino-manager update-vault-mgmt-fee \ --vault \ --fee-bps \ --mode execute ### [​](https://kamino.com/docs/build/cli/vault-operations#withdraw-pending-fees) Withdraw Pending Fees Withdraw accumulated fees from the vault. yarn kamino-manager withdraw-pending-fees \ --vault \ --mode execute ### [​](https://kamino.com/docs/build/cli/vault-operations#relinquish-fees) Relinquish Fees The vault manager can give up pending fees (partial or full), which will be distributed to vault token holders. This is useful when pending fees grow larger than the total vault value, allowing the manager to restore the vault to a healthy state. yarn kamino-manager give-up-pending-fees \ --vault \ --max-amount-to-give-up \ --mode execute **Parameters:** * `vault` - The vault address to give up fees for * `max-amount-to-give-up` - The amount in tokens to be given up from the pending fees [​](https://kamino.com/docs/build/cli/vault-operations#advanced-operations) Advanced Operations -------------------------------------------------------------------------------------------------- ### [​](https://kamino.com/docs/build/cli/vault-operations#multisig-management) Multisig Management For multisig-controlled vaults, use the `--mode multisig` flag to generate Base58-encoded transactions for proposal submission. yarn kamino-manager update-vault-reserve-allocation \ --vault \ --reserve \ --allocation-weight \ --allocation-cap \ --mode multisig \ --multisig We recommend using [Squads](https://squads.xyz/multisig) with a hardware wallet for multisig management. The generated transaction can be submitted as a multisig proposal through Squads. [​](https://kamino.com/docs/build/cli/vault-operations#next-steps) Next Steps -------------------------------------------------------------------------------- Market Operations ----------------- Create and manage lending markets and reserves Installation & Setup -------------------- Review installation and configuration Assistant Responses are generated using AI and may contain mistakes. --- # Get summary of the KVault program earnings - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-summary#content-area) Get summary of the KVault program earnings cURL curl --request GET \ --url https://api.kamino.finance/kvaults/summary const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/summary', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/summary" response = requests.get(url) print(response.text) false 200 500 { "earnings": { "interest": { "usd": "1234.56789", "sol": "1234.56789" }, "rewards": { "usd": "1234.56789", "sol": "1234.56789" }, "reserveRewards": { "usd": "1234.56789", "sol": "1234.56789" }, "total": { "usd": "1234.56789", "sol": "1234.56789" } } } { "error": "An internal error occurred" } GET / kvaults / summary Try it Get summary of the KVault program earnings cURL curl --request GET \ --url https://api.kamino.finance/kvaults/summary const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/summary', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/summary" response = requests.get(url) print(response.text) false 200 500 { "earnings": { "interest": { "usd": "1234.56789", "sol": "1234.56789" }, "rewards": { "usd": "1234.56789", "sol": "1234.56789" }, "reserveRewards": { "usd": "1234.56789", "sol": "1234.56789" }, "total": { "usd": "1234.56789", "sol": "1234.56789" } } } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-summary#parameter-type) type enum default:default Type of vaults queried Available options: `default`, `private-credit` Example: `"default"` #### Response 200 application/json OK KVault Summary Data [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-summary#response-earnings) earnings object required Earnings summary Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Earn Overview - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/earn#content-area) ![](https://mintcdn.com/kamino-3d73a151/PLATQ08CVUwkaQvR/images/earn/earn-hero.webp?w=2500&fit=max&auto=format&n=PLATQ08CVUwkaQvR&q=85&s=6e6d1c1a0401b6b933a0e00498fbff34) Earn ==== Integrate yield into your app or deploy your own vault strategy on Kamino. $510M Kamino TVL 50+ Active Vaults 18+ Audits Earn Integration Options ------------------------ Choose between a faster app integration or a fully managed vault strategy. ### Integrate Earn into your app Best for: wallets, dashboards, dApps, AI agents, and small teams. #### Use existing Kamino vaults Skip configuration and plug into fully automated vaults. Primary advantage: fastest path to ship Earn into a product, integrated in minutes. [Read How Earn Works](https://kamino.com/docs/build/earn#how-it-works) ### Deploy your own vault strategy Best for: protocols, curators, institutions, and treasury teams that want strategy control, custom access, and revenue from managed vaults. #### Set Custom Performance Fee Earn a share of yield generated by the vault and align revenue with strategy performance. #### Provide Additional Farm Rewards Add token incentives to attract deposits, retain users, or support a new vault launch. #### Whitelist Market Reserves Control where vault capital can be deployed by limiting deposits to approved Kamino lending reserves. #### Permissioned Deposits Maintain deposits for accredited investors and KYC users, or restrict vault access through an allowlist model. Primary advantage: launch a branded vault product with strategy control, depositor controls, and revenue. [Read the Curator Docs](https://kamino.com/docs/curators/vaults/guides/create-a-vault) How It Works ------------ A high-level view of the Earn Vault model. [Deposit](https://kamino.com/docs/build/earn#hiw-deposit) [Earn](https://kamino.com/docs/build/earn#hiw-earn) [Claim](https://kamino.com/docs/build/earn#hiw-claim) ![Deposit flow: User supplies tokens, and the vault allocates assets across lending markets according to its strategy](https://mintcdn.com/kamino-3d73a151/O3MRVWxAZCaSynKP/images/earn/deposit-flow.png?w=2500&fit=max&auto=format&n=O3MRVWxAZCaSynKP&q=85&s=31e2506ac316755cb153d4767dbe587b) ![Earn yield: Borrower interest becomes yield. User receives vault shares in their wallet that track their position value](https://mintcdn.com/kamino-3d73a151/O3MRVWxAZCaSynKP/images/earn/earn-yield.png?w=2500&fit=max&auto=format&n=O3MRVWxAZCaSynKP&q=85&s=7d593a319f65184f48015bdf8cb87d8f) ![Claim rewards: Lending yield accrues automatically, and users can claim additional rewards when available](https://mintcdn.com/kamino-3d73a151/O3MRVWxAZCaSynKP/images/earn/claim-rewards.png?w=2500&fit=max&auto=format&n=O3MRVWxAZCaSynKP&q=85&s=e8dacbc0364f0e63017e031500244683) 01 ### Deposit User supplies tokens, and the vault allocates assets across lending markets according to its strategy. 02 ### Earn Borrower interest becomes yield. User receives vault shares in their wallet that track their position value. 03 ### Claim Lending yield accrues automatically, and users can claim additional rewards when available. Earn Integration Model ---------------------- Built for seamless integration. Earn centers on three core layers of composability. [Vault Data](https://kamino.com/docs/build/earn#eim-vault-data) [Transactions](https://kamino.com/docs/build/earn#eim-transactions) [Positions](https://kamino.com/docs/build/earn#eim-positions) ![Layer 1, Vault Data: discover vaults and retrieve configuration, allocation strategy, performance metrics, and active incentive programs](https://mintcdn.com/kamino-3d73a151/O3MRVWxAZCaSynKP/images/earn/integration-vault-data.png?w=2500&fit=max&auto=format&n=O3MRVWxAZCaSynKP&q=85&s=3f0858aa3f987c59baa50d6539b638cc) ![Layer 2, Transactions: generate deposit and withdrawal transactions, manage approvals, and mint or redeem vault shares](https://mintcdn.com/kamino-3d73a151/O3MRVWxAZCaSynKP/images/earn/integration-transactions.png?w=2500&fit=max&auto=format&n=O3MRVWxAZCaSynKP&q=85&s=4f516ea70e014c384b47322ecb8e6643) ![Layer 3, Positions and Accounting: access user vault positions, share balances, yield accrual, and historical performance](https://mintcdn.com/kamino-3d73a151/O3MRVWxAZCaSynKP/images/earn/integration-positions.png?w=2500&fit=max&auto=format&n=O3MRVWxAZCaSynKP&q=85&s=56ea9cb45fc7f204889a54b7cc7a797a) ### Vault Data Discover vaults and retrieve their configuration, allocation strategy, performance metrics, and active incentive programs. Best Tools: REST API, TypeScript SDK Available Vault Data: APY, TVL, historical performance, vault configuration, allocation strategy, reserve data, market metadata. ### Transactions Generate deposit and withdrawal transactions, manage token approvals, and mint or redeem vault share tokens when users enter or exit a vault. Best Tools: TypeScript SDK, REST API, Rust Interface Crate Vault Interactions: Instruction building, backend and frontend signing flows. ### Positions & Accounting Access user vault positions, including share balances, yield accrual, and historical performance metrics. Best Tools: TypeScript SDK, REST API Available User Data: Share balances, portfolio, token exchange rates. Assistant Responses are generated using AI and may contain mistakes. --- # Get borrow order fills for an obligation - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-lend-borrow-orders/get-borrow-order-fills-for-an-obligation#content-area) Get borrow order fills for an obligation cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market/obligations/{pubkey}/borrow-order-fills const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market/obligations/{pubkey}/borrow-order-fills', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market/obligations/{pubkey}/borrow-order-fills" response = requests.get(url) print(response.text) false 200 400 500 { "fills": [\ {\ "eventType": "partial_fill",\ "eventTimestamp": "2023-12-25",\ "transactionSignature": "2XWcSQVtR4NoHBhzYpDkYkmYtEFkFXC5ZwrKiPok1kvA86GvnN15qP7RNP6eTeNWgJqgnR1GA2M3QPp1hucW7e1v",\ "debtLiquidityMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "filledAmount": "1234.56789"\ }\ ] } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / v2 / kamino-market / obligations / {pubkey} / borrow-order-fills Try it Get borrow order fills for an obligation cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market/obligations/{pubkey}/borrow-order-fills const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market/obligations/{pubkey}/borrow-order-fills', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market/obligations/{pubkey}/borrow-order-fills" response = requests.get(url) print(response.text) false 200 400 500 { "fills": [\ {\ "eventType": "partial_fill",\ "eventTimestamp": "2023-12-25",\ "transactionSignature": "2XWcSQVtR4NoHBhzYpDkYkmYtEFkFXC5ZwrKiPok1kvA86GvnN15qP7RNP6eTeNWgJqgnR1GA2M3QPp1hucW7e1v",\ "debtLiquidityMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "filledAmount": "1234.56789"\ }\ ] } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/kamino-lend-borrow-orders/get-borrow-order-fills-for-an-obligation#parameter-pubkey) pubkey string required Valid base58-encoded address Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/kamino-lend-borrow-orders/get-borrow-order-fills-for-an-obligation#response-fills) fills object\[\] required Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Get farm transactions - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/farms/get-farm-transactions#content-area) Get farm transactions cURL curl --request GET \ --url https://api.kamino.finance/farms/{farmPubkey}/transactions const options = {method: 'GET'}; fetch('https://api.kamino.finance/farms/{farmPubkey}/transactions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/farms/{farmPubkey}/transactions" response = requests.get(url) print(response.text) false 200 400 500 { "result": [\ {\ "createdOn": "2023-12-25",\ "transactionSignature": "2XWcSQVtR4NoHBhzYpDkYkmYtEFkFXC5ZwrKiPok1kvA86GvnN15qP7RNP6eTeNWgJqgnR1GA2M3QPp1hucW7e1v",\ "instruction": "deposit",\ "tokenAmount": "1234.56789",\ "usdAmount": "1234.56789"\ }\ ], "paginationToken": "" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / farms / {farmPubkey} / transactions Try it Get farm transactions cURL curl --request GET \ --url https://api.kamino.finance/farms/{farmPubkey}/transactions const options = {method: 'GET'}; fetch('https://api.kamino.finance/farms/{farmPubkey}/transactions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/farms/{farmPubkey}/transactions" response = requests.get(url) print(response.text) false 200 400 500 { "result": [\ {\ "createdOn": "2023-12-25",\ "transactionSignature": "2XWcSQVtR4NoHBhzYpDkYkmYtEFkFXC5ZwrKiPok1kvA86GvnN15qP7RNP6eTeNWgJqgnR1GA2M3QPp1hucW7e1v",\ "instruction": "deposit",\ "tokenAmount": "1234.56789",\ "usdAmount": "1234.56789"\ }\ ], "paginationToken": "" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/farms/get-farm-transactions#parameter-farm-pubkey) farmPubkey string required Farm public key Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Query Parameters [​](https://kamino.com/docs/build/farms/get-farm-transactions#parameter-limit) limit integer default:100 Maximum number of results to return (1-1000) Required range: `1 <= x <= 1000` Example: `100` [​](https://kamino.com/docs/build/farms/get-farm-transactions#parameter-pagination-token) paginationToken string Token for fetching the next page of results Example: `"eyJsYXN0SWQiOiIxMjM0In0="` [​](https://kamino.com/docs/build/farms/get-farm-transactions#parameter-sort) sort enum default:desc Sort order (asc for oldest first, desc for newest first) Available options: `asc`, `desc` Example: `"desc"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/farms/get-farm-transactions#response-result) result object\[\] required Show child attributes [​](https://kamino.com/docs/build/farms/get-farm-transactions#response-pagination-token) paginationToken string Token for fetching the next page. Absent when no more results. Assistant Responses are generated using AI and may contain mistakes. --- # Get transaction to withdraw from a kvault - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-earn-withdraw/get-transaction-to-withdraw-from-a-kvault#content-area) Get transaction to withdraw from a kvault cURL curl --request POST \ --url https://api.kamino.finance/ktx/kvault/withdraw \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', kvault: 'HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/kvault/withdraw', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/kvault/withdraw" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } POST / ktx / kvault / withdraw Try it Get transaction to withdraw from a kvault cURL curl --request POST \ --url https://api.kamino.finance/ktx/kvault/withdraw \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', kvault: 'HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/kvault/withdraw', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/kvault/withdraw" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } #### Body application/json [​](https://kamino.com/docs/build/kamino-earn-withdraw/get-transaction-to-withdraw-from-a-kvault#body-wallet) wallet string required User wallet address (base58) that will also sign the transaction Required string length: `32 - 44` Example: `"KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9"` [​](https://kamino.com/docs/build/kamino-earn-withdraw/get-transaction-to-withdraw-from-a-kvault#body-kvault) kvault string required Target Kamino vault address Required string length: `32 - 44` Example: `"HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E"` [​](https://kamino.com/docs/build/kamino-earn-withdraw/get-transaction-to-withdraw-from-a-kvault#body-amount) amount string required Amount to withdraw (in decimal format, not lamports), use U64::MAX to withdraw all Example: `"0.1234"` #### Response 200 application/json Default Response [​](https://kamino.com/docs/build/kamino-earn-withdraw/get-transaction-to-withdraw-from-a-kvault#response-transaction) transaction string required Encoded transaction ready to send Example: `"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM="` Assistant Responses are generated using AI and may contain mistakes. --- # Get transaction to borrow liquidity from a klend reserve - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-lend-borrow/get-transaction-to-borrow-liquidity-from-a-klend-reserve#content-area) Get transaction to borrow liquidity from a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/borrow \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/borrow', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/borrow" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } POST / ktx / klend / borrow Try it Get transaction to borrow liquidity from a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/borrow \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/borrow', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/borrow" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } #### Body application/json [​](https://kamino.com/docs/build/kamino-lend-borrow/get-transaction-to-borrow-liquidity-from-a-klend-reserve#body-wallet) wallet string required User wallet address (base58) that will also sign the transaction Required string length: `32 - 44` Example: `"KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9"` [​](https://kamino.com/docs/build/kamino-lend-borrow/get-transaction-to-borrow-liquidity-from-a-klend-reserve#body-market) market string required Target Kamino Lend market address Required string length: `32 - 44` Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/kamino-lend-borrow/get-transaction-to-borrow-liquidity-from-a-klend-reserve#body-reserve) reserve string required Target Kamino Lend Reserve address. The reserve must belong to the specified market Required string length: `32 - 44` Example: `"D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59"` [​](https://kamino.com/docs/build/kamino-lend-borrow/get-transaction-to-borrow-liquidity-from-a-klend-reserve#body-amount) amount string required Amount of liquidity token to borrow (in decimal format, not lamports) Example: `"0.1234"` #### Response 200 application/json Default Response [​](https://kamino.com/docs/build/kamino-lend-borrow/get-transaction-to-borrow-liquidity-from-a-klend-reserve#response-transaction) transaction string required Encoded transaction ready to send Example: `"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM="` Assistant Responses are generated using AI and may contain mistakes. --- # Get instructions to withdraw from a klend reserve - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-lend-withdraw/get-instructions-to-withdraw-from-a-klend-reserve#content-area) Get instructions to withdraw from a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/withdraw-instructions \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/withdraw-instructions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/withdraw-instructions" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "instructions": [\ {\ "accounts": [\ {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT",\ "role": "WRITABLE_SIGNER",\ "signer": {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT"\ }\ }\ ],\ "data": "8iPGiVLh8rYA4fUFAAAAAA==",\ "programAddress": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd"\ }\ ], "lutsByAddress": { "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [\ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH",\ "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E",\ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"\ ] } } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } POST / ktx / klend / withdraw-instructions Try it Get instructions to withdraw from a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/withdraw-instructions \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/withdraw-instructions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/withdraw-instructions" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "instructions": [\ {\ "accounts": [\ {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT",\ "role": "WRITABLE_SIGNER",\ "signer": {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT"\ }\ }\ ],\ "data": "8iPGiVLh8rYA4fUFAAAAAA==",\ "programAddress": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd"\ }\ ], "lutsByAddress": { "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [\ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH",\ "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E",\ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"\ ] } } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } #### Body application/json [​](https://kamino.com/docs/build/kamino-lend-withdraw/get-instructions-to-withdraw-from-a-klend-reserve#body-wallet) wallet string required User wallet address (base58) that will also sign the transaction Required string length: `32 - 44` Example: `"KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9"` [​](https://kamino.com/docs/build/kamino-lend-withdraw/get-instructions-to-withdraw-from-a-klend-reserve#body-market) market string required Target Kamino Lend market address Required string length: `32 - 44` Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/kamino-lend-withdraw/get-instructions-to-withdraw-from-a-klend-reserve#body-reserve) reserve string required Target Kamino Lend Reserve address. The reserve must belong to the specified market Required string length: `32 - 44` Example: `"D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59"` [​](https://kamino.com/docs/build/kamino-lend-withdraw/get-instructions-to-withdraw-from-a-klend-reserve#body-amount) amount string required Amount of liquidity token to withdraw (in decimal format, not lamports) Example: `"0.1234"` #### Response 200 application/json Default Response [​](https://kamino.com/docs/build/kamino-lend-withdraw/get-instructions-to-withdraw-from-a-klend-reserve#response-instructions) instructions object\[\] required Show child attributes [​](https://kamino.com/docs/build/kamino-lend-withdraw/get-instructions-to-withdraw-from-a-klend-reserve#response-luts-by-address) lutsByAddress object required Show child attributes Example: `{ "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH", "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" ] }` Assistant Responses are generated using AI and may contain mistakes. --- # Get transaction to withdraw from a klend reserve - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-lend-withdraw/get-transaction-to-withdraw-from-a-klend-reserve#content-area) Get transaction to withdraw from a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/withdraw \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/withdraw', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/withdraw" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } POST / ktx / klend / withdraw Try it Get transaction to withdraw from a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/withdraw \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/withdraw', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/withdraw" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } #### Body application/json [​](https://kamino.com/docs/build/kamino-lend-withdraw/get-transaction-to-withdraw-from-a-klend-reserve#body-wallet) wallet string required User wallet address (base58) that will also sign the transaction Required string length: `32 - 44` Example: `"KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9"` [​](https://kamino.com/docs/build/kamino-lend-withdraw/get-transaction-to-withdraw-from-a-klend-reserve#body-market) market string required Target Kamino Lend market address Required string length: `32 - 44` Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/kamino-lend-withdraw/get-transaction-to-withdraw-from-a-klend-reserve#body-reserve) reserve string required Target Kamino Lend Reserve address. The reserve must belong to the specified market Required string length: `32 - 44` Example: `"D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59"` [​](https://kamino.com/docs/build/kamino-lend-withdraw/get-transaction-to-withdraw-from-a-klend-reserve#body-amount) amount string required Amount of liquidity token to withdraw (in decimal format, not lamports) Example: `"0.1234"` #### Response 200 application/json Default Response [​](https://kamino.com/docs/build/kamino-lend-withdraw/get-transaction-to-withdraw-from-a-klend-reserve#response-transaction) transaction string required Encoded transaction ready to send Example: `"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM="` Assistant Responses are generated using AI and may contain mistakes. --- # Get historical user metrics for a single KVault - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#content-area) Get historical user metrics for a single KVault cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/metrics/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/metrics/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/metrics/history" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "createdOn": "2025-03-01T12:00:00.000Z",\ "sharesAmount": "1234.56789",\ "usdAmount": "1234.56789",\ "solAmount": "1234.56789",\ "apy": "0.2",\ "cumulativeInterestEarned": "1234.56789",\ "cumulativeInterestEarnedUsd": "1234.56789",\ "cumulativeInterestEarnedSol": "1234.56789",\ "interestEarnedPerSecond": "1234.56789",\ "interestEarnedPerSecondUsd": "1234.56789",\ "interestEarnedPerSecondSol": "1234.56789"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / kvaults / users / {userPubkey} / vaults / {vaultPubkey} / metrics / history Try it Get historical user metrics for a single KVault cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/metrics/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/metrics/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/metrics/history" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "createdOn": "2025-03-01T12:00:00.000Z",\ "sharesAmount": "1234.56789",\ "usdAmount": "1234.56789",\ "solAmount": "1234.56789",\ "apy": "0.2",\ "cumulativeInterestEarned": "1234.56789",\ "cumulativeInterestEarnedUsd": "1234.56789",\ "cumulativeInterestEarnedSol": "1234.56789",\ "interestEarnedPerSecond": "1234.56789",\ "interestEarnedPerSecondUsd": "1234.56789",\ "interestEarnedPerSecondSol": "1234.56789"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#parameter-vault-pubkey) vaultPubkey string required Valid base58-encoded address of the vault Example: `"HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#parameter-user-pubkey) userPubkey string required Valid base58-encoded address of the user wallet Example: `"AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#parameter-one-of-0) start stringnumberstringnumber default:1970-01-01T00:00:00.000Z Start date of the range (defaults to Unix epoch). Accepts ISO string or epoch in ms. Example: `"1970-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#parameter-one-of-0) end stringnumberstringnumber End date of the range (defaults to current time). Accepts ISO string or epoch in ms. Example: `"2025-01-01T00:00:00.000Z"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#response-items-created-on) createdOn string required Timestamp when the snapshot was created (ISO 8601 format) Example: `"2025-03-01T12:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#response-items-shares-amount) sharesAmount string required User's total shares amount Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#response-items-usd-amount) usdAmount string required User's USD amount in kvault Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#response-items-sol-amount) solAmount string required User's SOL amount in kvault Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#response-items-apy) apy string required APY in decimal format (not percentage) represented as string. Multiply by 100 to get percentage (%) - 0.1 in API response is 10%. Example: `"0.2"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#response-items-cumulative-interest-earned) cumulativeInterestEarned string required Total interest earned in kvault token amount for kvault Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#response-items-cumulative-interest-earned-usd) cumulativeInterestEarnedUsd string required Total interest earned in USD for kvault Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#response-items-cumulative-interest-earned-sol) cumulativeInterestEarnedSol string required Total interest earned in SOL for kvault Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#response-items-interest-earned-per-second) interestEarnedPerSecond string required Interest earned per second at that specific moment in token Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#response-items-interest-earned-per-second-usd) interestEarnedPerSecondUsd string required Interest earned per second at that specific moment in USD Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-vault-metrics-history#response-items-interest-earned-per-second-sol) interestEarnedPerSecondSol string required Interest earned per second at that specific moment in SOL Example: `"1234.56789"` Assistant Responses are generated using AI and may contain mistakes. --- # Get KVault by address - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/earn/vault-data/vault-detail#content-area) Get KVault by address cURL curl --request GET \ --url https://api.kamino.finance/kvaults/vaults/{pubkey} const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/vaults/{pubkey}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/vaults/{pubkey}" response = requests.get(url) print(response.text) false 200 400 404 500 { "address": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "state": { "vaultAdminAuthority": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "baseVaultAuthority": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "baseVaultAuthorityBump": 123, "tokenMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "tokenMintDecimals": 123, "tokenVault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "tokenProgram": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "sharesMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "sharesMintDecimals": 123, "tokenAvailable": "1234.56789", "sharesIssued": "1234.56789", "availableCrankFunds": "1234.56789", "performanceFeeBps": 123, "managementFeeBps": 123, "lastFeeChargeTimestamp": 123, "prevAum": "1234.56789", "pendingFees": "1234.56789", "vaultAllocationStrategy": [\ {\ "reserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "ctokenVault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "targetAllocationWeight": 123,\ "tokenAllocationCap": "",\ "ctokenVaultBump": 123,\ "ctokenAllocation": "",\ "lastInvestSlot": "",\ "tokenTargetAllocation": "1234.56789"\ }\ ], "minDepositAmount": "1234.56789", "minWithdrawAmount": "1234.56789", "minInvestAmount": "1234.56789", "minInvestDelaySlots": 123, "crankFundFeePerReserve": "1234.56789", "pendingAdmin": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "cumulativeEarnedInterest": "1234.56789", "cumulativeMgmtFees": "1234.56789", "cumulativePerfFees": "1234.56789", "name": "", "vaultLookupTable": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "vaultFarm": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "creationTimestamp": 123, "allocationAdmin": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd" }, "programId": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } GET / kvaults / vaults / {pubkey} Try it Get KVault by address cURL curl --request GET \ --url https://api.kamino.finance/kvaults/vaults/{pubkey} const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/vaults/{pubkey}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/vaults/{pubkey}" response = requests.get(url) print(response.text) false 200 400 404 500 { "address": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "state": { "vaultAdminAuthority": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "baseVaultAuthority": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "baseVaultAuthorityBump": 123, "tokenMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "tokenMintDecimals": 123, "tokenVault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "tokenProgram": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "sharesMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "sharesMintDecimals": 123, "tokenAvailable": "1234.56789", "sharesIssued": "1234.56789", "availableCrankFunds": "1234.56789", "performanceFeeBps": 123, "managementFeeBps": 123, "lastFeeChargeTimestamp": 123, "prevAum": "1234.56789", "pendingFees": "1234.56789", "vaultAllocationStrategy": [\ {\ "reserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "ctokenVault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "targetAllocationWeight": 123,\ "tokenAllocationCap": "",\ "ctokenVaultBump": 123,\ "ctokenAllocation": "",\ "lastInvestSlot": "",\ "tokenTargetAllocation": "1234.56789"\ }\ ], "minDepositAmount": "1234.56789", "minWithdrawAmount": "1234.56789", "minInvestAmount": "1234.56789", "minInvestDelaySlots": 123, "crankFundFeePerReserve": "1234.56789", "pendingAdmin": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "cumulativeEarnedInterest": "1234.56789", "cumulativeMgmtFees": "1234.56789", "cumulativePerfFees": "1234.56789", "name": "", "vaultLookupTable": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "vaultFarm": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd", "creationTimestamp": 123, "allocationAdmin": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd" }, "programId": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vault-detail#parameter-pubkey) pubkey string required Valid base58-encoded address Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vault-detail#response-address) address string required Public key of the vault Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vault-detail#response-state) state object required Show child attributes [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vault-detail#response-program-id) programId string required Public key of the kvault program which owns the vault Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` Assistant Responses are generated using AI and may contain mistakes. --- # Get strategy fees and rewards - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#content-area) Get strategy fees and rewards cURL curl --request GET \ --url https://api.kamino.finance/strategies/fees-and-rewards const options = {method: 'GET'}; fetch('https://api.kamino.finance/strategies/fees-and-rewards', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/strategies/fees-and-rewards" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "strategyPubkey": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs",\ "feesAEarned": "0.123",\ "feesBEarned": "0.123",\ "totalUsd": "0.123",\ "lastCalculated": "2023-11-07T05:31:56Z",\ "rewards0Earned": "0.123",\ "rewards1Earned": "0.123",\ "rewards2Earned": "0.123",\ "kaminoRewards0Earned": "0.123",\ "kaminoRewards1Earned": "0.123",\ "kaminoRewards2Earned": "0.123",\ "feesAEarnedUsd": "0.123",\ "feesBEarnedUsd": "0.123",\ "rewards0EarnedUsd": "0.123",\ "rewards1EarnedUsd": "0.123",\ "rewards2EarnedUsd": "0.123",\ "kaminoRewards0EarnedUsd": "0.123",\ "kaminoRewards1EarnedUsd": "0.123",\ "kaminoRewards2EarnedUsd": "0.123"\ }\ ] { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } GET / strategies / fees-and-rewards Try it Get strategy fees and rewards cURL curl --request GET \ --url https://api.kamino.finance/strategies/fees-and-rewards const options = {method: 'GET'}; fetch('https://api.kamino.finance/strategies/fees-and-rewards', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/strategies/fees-and-rewards" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "strategyPubkey": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs",\ "feesAEarned": "0.123",\ "feesBEarned": "0.123",\ "totalUsd": "0.123",\ "lastCalculated": "2023-11-07T05:31:56Z",\ "rewards0Earned": "0.123",\ "rewards1Earned": "0.123",\ "rewards2Earned": "0.123",\ "kaminoRewards0Earned": "0.123",\ "kaminoRewards1Earned": "0.123",\ "kaminoRewards2Earned": "0.123",\ "feesAEarnedUsd": "0.123",\ "feesBEarnedUsd": "0.123",\ "rewards0EarnedUsd": "0.123",\ "rewards1EarnedUsd": "0.123",\ "rewards2EarnedUsd": "0.123",\ "kaminoRewards0EarnedUsd": "0.123",\ "kaminoRewards1EarnedUsd": "0.123",\ "kaminoRewards2EarnedUsd": "0.123"\ }\ ] { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#parameter-env) env string default:mainnet-beta Solana cluster environment. Defaults to mainnet-beta. Example: `"mainnet-beta"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#parameter-period) period enum default:24h Time period. Defaults to 24h. Available options: `24h`, `7d`, `30d` Example: `"24h"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-strategy-pubkey) strategyPubkey string required Public key of the strategy Example: `"9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-fees-a-earned) feesAEarned string required Token A fees earned Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-fees-b-earned) feesBEarned string required Token B fees earned Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-total-usd) totalUsd string required Total fees and rewards in USD Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-last-calculated) lastCalculated string required Timestamp of last calculation [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-rewards0-earned) rewards0Earned string DEX reward 0 earned Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-rewards1-earned) rewards1Earned string DEX reward 1 earned Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-rewards2-earned) rewards2Earned string DEX reward 2 earned Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-kamino-rewards0-earned) kaminoRewards0Earned string Kamino reward 0 earned Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-kamino-rewards1-earned) kaminoRewards1Earned string Kamino reward 1 earned Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-kamino-rewards2-earned) kaminoRewards2Earned string Kamino reward 2 earned Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-fees-a-earned-usd) feesAEarnedUsd string Token A fees in USD Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-fees-b-earned-usd) feesBEarnedUsd string Token B fees in USD Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-rewards0-earned-usd) rewards0EarnedUsd string DEX reward 0 in USD Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-rewards1-earned-usd) rewards1EarnedUsd string DEX reward 1 in USD Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-rewards2-earned-usd) rewards2EarnedUsd string DEX reward 2 in USD Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-kamino-rewards0-earned-usd) kaminoRewards0EarnedUsd string Kamino reward 0 in USD Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-kamino-rewards1-earned-usd) kaminoRewards1EarnedUsd string Kamino reward 1 in USD Example: `"0.123"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-fees-and-rewards#response-items-kamino-rewards2-earned-usd) kaminoRewards2EarnedUsd string Kamino reward 2 in USD Example: `"0.123"` Assistant Responses are generated using AI and may contain mistakes. --- # Oracle - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/oracle/overview#content-area) [​](https://kamino.com/docs/build/developers/oracle/overview#overview) Overview ---------------------------------------------------------------------------------- Scope is Kamino’s oracle aggregation framework for on-chain pricing. The Scope TypeScript SDK and REST endpoints provide direct access to price data, feed configuration, and refresh instructions. In leverage and flash-loan flows, price refreshes are commonly included before execution so reserves and strategies read the latest market data. A Scope feed is a fixed-size account: each `OraclePrices` account holds 512 slots, and a token’s USD price is resolved through a “scope chain” of up to 4 slot indices (padded with the sentinel `65535`). For the configuration side, read [Configure oracles](https://kamino.com/docs/curators/markets/configuring-oracles) and [Scope oracle types](https://kamino.com/docs/curators/markets/scope-oracle-types) . [​](https://kamino.com/docs/build/developers/oracle/overview#key-components-of-oracle-integration) Key Components of Oracle Integration ------------------------------------------------------------------------------------------------------------------------------------------ Prices ------ Read every populated slot in a feed, or resolve a single token via its scope chain. Feed Internals -------------- Inspect a feed’s configuration, per-hop chain metadata, and per-slot oracle mappings. Refresh ------- Build the permissionless refresh instruction that pushes fresh prices on-chain. [​](https://kamino.com/docs/build/developers/oracle/overview#integration-options) Integration Options -------------------------------------------------------------------------------------------------------- Scope TypeScript SDK -------------------- On-chain reads against the Scope program plus the refresh-instruction builder. TypeScript only. REST API -------- Off-chain aggregated Scope prices keyed by mint. Language-agnostic, no RPC required. ### [​](https://kamino.com/docs/build/developers/oracle/overview#read-all-prices) Read all prices * TypeScript import { createSolanaRpc } from '@solana/kit'; import { Scope, SCOPE_MAINNET_HUBBLE_FEED } from '@kamino-finance/scope-sdk'; import Decimal from 'decimal.js'; const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const scope = new Scope('mainnet-beta', rpc); const oraclePrices = await scope.getSingleOraclePrices({ config: SCOPE_MAINNET_HUBBLE_FEED.configuration, }); const populated = oraclePrices.prices .map((p, index) => ({ index, p })) .filter(({ p }) => p.price.value.toString() !== '0'); console.log(`${populated.length} populated of ${oraclePrices.prices.length} slots`); populated.slice(0, 5).forEach(({ index, p }) => { const price = new Decimal(p.price.value.toString()).div(new Decimal(10).pow(Number(p.price.exp))); console.log(` [${index}] ${price.toString()}`); }); [View Code](https://github.com/Kamino-Finance/scope-sdk) ### [​](https://kamino.com/docs/build/developers/oracle/overview#get-a-single-token-price) Get a single token price * TypeScript import { createSolanaRpc } from '@solana/kit'; import { Scope, SCOPE_MAINNET_HUBBLE_FEED } from '@kamino-finance/scope-sdk'; const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const scope = new Scope('mainnet-beta', rpc); // SOL/USD lives at slot 0 of the Hubble feed. Single-hop chain padded with 65535. const CHAIN = [0, 65535, 65535, 65535]; const oraclePrices = await scope.getSingleOraclePrices({ config: SCOPE_MAINNET_HUBBLE_FEED.configuration, }); const { price, timestamp } = await scope.getPriceFromChain(CHAIN, oraclePrices); console.log(`Price: ${price.toString()} (updated ${new Date(timestamp.toNumber() * 1000).toISOString()})`); [View Code](https://github.com/Kamino-Finance/scope-sdk) [​](https://kamino.com/docs/build/developers/oracle/overview#what%E2%80%99s-covered) What’s Covered ------------------------------------------------------------------------------------------------------ Prices ------ Read every populated slot in a feed, or resolve a single token via its scope chain. SDK plus REST. Feed Internals -------------- Feed configuration, per-hop chain metadata, and per-slot oracle mappings. Refresh Prices -------------- Build and send the permissionless refresh instruction for one or more slots. [​](https://kamino.com/docs/build/developers/oracle/overview#relevant-links) Relevant Links ---------------------------------------------------------------------------------------------- NPM SDK package --------------- Install the Scope TypeScript SDK to read feeds and build refresh instructions. Scope SDK repository -------------------- TypeScript SDK source and example scripts. Oracle Architecture ------------------- Scope, price protection, and manipulation resistance explained. Scope Oracle Types ------------------ Specialized Scope oracle entry types for fixed-income, multi-source, pegged, and LST assets. Assistant Responses are generated using AI and may contain mistakes. --- # Calculate Extra Farm Reward APY - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/borrow/rewards/extra-farm-reward-apy#content-area) Extra farms provide additional rewards to users who deposit specific collateral and borrow specific assets. [​](https://kamino.com/docs/build/developers/borrow/rewards/extra-farm-reward-apy#calculate-extra-farm-reward-apy) Calculate Extra Farm Reward APY ----------------------------------------------------------------------------------------------------------------------------------------------------- Calculate APY for extra farm rewards paid in stablecoins like CASH that are pegged to USD. 1 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/extra-farm-reward-apy#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, Kamino SDK operations, and decimal calculations. import { createSolanaRpc, address } from '@solana/kit'; import { FarmState, calculateCurrentRewardPerToken } from '@kamino-finance/farms-sdk'; import { KaminoMarket, PROGRAM_ID, lamportsToNumberDecimal } from '@kamino-finance/klend-sdk'; import Decimal from 'decimal.js'; type ExtraFarm = { market: string; farm: string; collMint: string; debtMint: string }; type Resources = { 'mainnet-beta': { extraFarms: ExtraFarm[] } }; 2 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/extra-farm-reward-apy#initialize-rpc-and-load-market) Initialize RPC and Load Market Set up the Solana RPC connection and load the Kamino market. const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const mainMarketAddress = address('7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'); // Load market and get CASH and SOL mints from reserves const market = await KaminoMarket.load(rpc, mainMarketAddress, 400, PROGRAM_ID); let cashReserve, solReserve; for (const reserve of market!.reserves.values()) { if (reserve.stats.symbol === 'CASH') cashReserve = reserve; if (reserve.stats.symbol === 'SOL') solReserve = reserve; } if (!cashReserve || !solReserve) { throw new Error('CASH or SOL reserve not found'); } const cashMint = cashReserve.getLiquidityMint().toString(); const solMint = solReserve.getLiquidityMint().toString(); This example targets the SOL/CASH extra farm pair where users deposit SOL collateral and borrow CASH to earn rewards. 3 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/extra-farm-reward-apy#get-and-filter-extra-farms) Get and Filter Extra Farms Fetch the list of extra farms from the CDN and filter by SOL collateral and CASH debt. // Get extraFarms from CDN API and filter by SOL/CASH pair const cdnRes = await fetch('https://cdn.kamino.finance/resources.json'); const allResources = (await cdnRes.json()) as Resources; const kaminoResources = allResources['mainnet-beta']; const extraFarmsForMarket = kaminoResources.extraFarms.filter((f) => f.market === mainMarketAddress.toString()); // Filter by collateral (SOL) and debt (CASH) mints const solCashFarms = extraFarmsForMarket.filter((f) => f.collMint === solMint && f.debtMint === cashMint); The CDN resources endpoint provides a list of all extra farms. We filter for farms that specifically reward SOL collateral deposits paired with CASH borrows. 4 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/extra-farm-reward-apy#fetch-all-farm-states-in-batch) Fetch All Farm States in Batch Fetch all farm states in a single batch request for better performance. // Fetch all farm states in batch const farmAddresses = solCashFarms.map((f) => address(f.farm)); const farmStates = await FarmState.fetchMultiple(rpc, farmAddresses); const farms = solCashFarms.flatMap((extraFarm, index) => { const farmState = farmStates[index]; return farmState ? [{ farm: extraFarm.farm, farmState }] : []; }); Using `FarmState.fetchMultiple` fetches all farm states in a single batch request. 5 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/extra-farm-reward-apy#calculate-apy-for-sol/cash-farms) Calculate APY for SOL/CASH Farms Loop through the fetched farms and calculate APY for CASH rewards. for (const { farm, farmState } of farms) { const totalStaked = lamportsToNumberDecimal( farmState.totalStakedAmount.toString(), farmState.token.decimals.toNumber() || 6 ); const cashReward = farmState.rewardInfos.find( (r) => r.token.mint.toString() === cashMint && r.rewardsAvailable.gtn(0) ); if (cashReward && !totalStaked.isZero()) { const currentTime = new Decimal(Date.now() / 1000); // Calculate APY from farm rewards const rewardPerTokenPerSecond = calculateCurrentRewardPerToken(cashReward, currentTime); // returns the raw value const divisor = new Decimal(10) .pow(cashReward.rewardsPerSecondDecimals.toString()) .mul(new Decimal(10).pow(cashReward.token.decimals.toString())); const adjustedRewardPerToken = new Decimal(rewardPerTokenPerSecond).div(divisor); const dailyRewards = adjustedRewardPerToken.mul(86400); const apy = Decimal.pow(dailyRewards.div(totalStaked).plus(1), 365).minus(1); console.log(`ExtraFarm: ${farm}`); console.log(` CASH APY: ${(apy.toNumber() * 100).toFixed(2)}%\n`); } } The script outputs the APY for SOL/CASH extra farms paying CASH rewards. The `calculateCurrentRewardPerToken` helper from farms-sdk handles the reward schedule logic. Since CASH is pegged to USD, no price lookup is required. Assistant Responses are generated using AI and may contain mistakes. --- # Get user farm transactions - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/rewards/user-transactions#content-area) Get user farms transactions cURL curl --request GET \ --url https://api.kamino.finance/farms/users/{pubkey}/transactions const options = {method: 'GET'}; fetch('https://api.kamino.finance/farms/users/{pubkey}/transactions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/farms/users/{pubkey}/transactions" response = requests.get(url) print(response.text) false 200 400 500 { "result": [\ {\ "createdOn": "2023-12-25",\ "transactionSignature": "2XWcSQVtR4NoHBhzYpDkYkmYtEFkFXC5ZwrKiPok1kvA86GvnN15qP7RNP6eTeNWgJqgnR1GA2M3QPp1hucW7e1v",\ "instruction": "claim",\ "tokenAmount": "1234.56789",\ "usdAmount": "1234.56789",\ "farm": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "token": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"\ }\ ], "paginationToken": "" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / farms / users / {pubkey} / transactions Try it Get user farms transactions cURL curl --request GET \ --url https://api.kamino.finance/farms/users/{pubkey}/transactions const options = {method: 'GET'}; fetch('https://api.kamino.finance/farms/users/{pubkey}/transactions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/farms/users/{pubkey}/transactions" response = requests.get(url) print(response.text) false 200 400 500 { "result": [\ {\ "createdOn": "2023-12-25",\ "transactionSignature": "2XWcSQVtR4NoHBhzYpDkYkmYtEFkFXC5ZwrKiPok1kvA86GvnN15qP7RNP6eTeNWgJqgnR1GA2M3QPp1hucW7e1v",\ "instruction": "claim",\ "tokenAmount": "1234.56789",\ "usdAmount": "1234.56789",\ "farm": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "token": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"\ }\ ], "paginationToken": "" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/rewards/user-transactions#parameter-pubkey) pubkey string required Valid base58-encoded address of the user wallet Example: `"AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/rewards/user-transactions#parameter-limit) limit integer default:100 Maximum number of results to return (1-1000) Required range: `1 <= x <= 1000` Example: `100` [​](https://kamino.com/docs/build/api-reference/rewards/user-transactions#parameter-pagination-token) paginationToken string Token for fetching the next page of results Example: `"eyJsYXN0SWQiOiIxMjM0In0="` [​](https://kamino.com/docs/build/api-reference/rewards/user-transactions#parameter-no-pagination) noPagination string When true, returns all transactions without pagination Example: `false` [​](https://kamino.com/docs/build/api-reference/rewards/user-transactions#parameter-sort) sort enum default:asc Sort order (asc for oldest first, desc for newest first) Available options: `asc`, `desc` Example: `"desc"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/rewards/user-transactions#response-result) result object\[\] required Show child attributes [​](https://kamino.com/docs/build/api-reference/rewards/user-transactions#response-pagination-token) paginationToken string Token for fetching the next page. Absent when no more results. Assistant Responses are generated using AI and may contain mistakes. --- # Get transaction to deposit into a klend reserve - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-lend-deposit/get-transaction-to-deposit-into-a-klend-reserve#content-area) Get transaction to deposit into a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/deposit \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/deposit', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/deposit" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } POST / ktx / klend / deposit Try it Get transaction to deposit into a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/deposit \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/deposit', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/deposit" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } #### Body application/json [​](https://kamino.com/docs/build/kamino-lend-deposit/get-transaction-to-deposit-into-a-klend-reserve#body-wallet) wallet string required User wallet address (base58) that will also sign the transaction Required string length: `32 - 44` Example: `"KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9"` [​](https://kamino.com/docs/build/kamino-lend-deposit/get-transaction-to-deposit-into-a-klend-reserve#body-market) market string required Target Kamino Lend market address Required string length: `32 - 44` Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/kamino-lend-deposit/get-transaction-to-deposit-into-a-klend-reserve#body-reserve) reserve string required Target Kamino Lend Reserve address. The reserve must belong to the specified market Required string length: `32 - 44` Example: `"D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59"` [​](https://kamino.com/docs/build/kamino-lend-deposit/get-transaction-to-deposit-into-a-klend-reserve#body-amount) amount string required Amount of liquidity token to deposit (in decimal format, not lamports) Example: `"0.1234"` #### Response 200 application/json Default Response [​](https://kamino.com/docs/build/kamino-lend-deposit/get-transaction-to-deposit-into-a-klend-reserve#response-transaction) transaction string required Encoded transaction ready to send Example: `"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM="` Assistant Responses are generated using AI and may contain mistakes. --- # Get all strategies - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-list#content-area) Get all strategies cURL curl --request GET \ --url https://api.kamino.finance/strategies const options = {method: 'GET'}; fetch('https://api.kamino.finance/strategies', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/strategies" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "address": "3VXtabCgrd3RYuHa6HisufMfiE4aUk84Hu5quDFhqECD",\ "type": "NON_PEGGED",\ "shareMint": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs",\ "status": "LIVE",\ "tokenAMint": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs",\ "tokenBMint": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs"\ }\ ] { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } GET / strategies Try it Get all strategies cURL curl --request GET \ --url https://api.kamino.finance/strategies const options = {method: 'GET'}; fetch('https://api.kamino.finance/strategies', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/strategies" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "address": "3VXtabCgrd3RYuHa6HisufMfiE4aUk84Hu5quDFhqECD",\ "type": "NON_PEGGED",\ "shareMint": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs",\ "status": "LIVE",\ "tokenAMint": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs",\ "tokenBMint": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs"\ }\ ] { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-list#parameter-env) env string default:mainnet-beta Solana cluster environment. Defaults to mainnet-beta. Example: `"mainnet-beta"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-list#parameter-status) status enum Filter strategies by status. Available options: `LIVE`, `SHADOW`, `DEPRECATED`, `IGNORED` Example: `"LIVE"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-list#response-items-address) address string required Public key of the strategy Example: `"3VXtabCgrd3RYuHa6HisufMfiE4aUk84Hu5quDFhqECD"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-list#response-items-type) type enum required Strategy type Available options: `NON_PEGGED`, `PEGGED` Example: `"NON_PEGGED"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-list#response-items-share-mint) shareMint string required Mint address of the strategy share token Example: `"9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-list#response-items-status) status enum required Strategy status Available options: `LIVE`, `SHADOW`, `DEPRECATED`, `IGNORED` Example: `"LIVE"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-list#response-items-token-a-mint) tokenAMint string required Mint address of token A Example: `"9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs"` [​](https://kamino.com/docs/build/api-reference/liquidity/strategy-data/strategies-list#response-items-token-b-mint) tokenBMint string required Mint address of token B Example: `"9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs"` Assistant Responses are generated using AI and may contain mistakes. --- # Get user rewards history - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-rewards-history#content-area) Get user rewards history cURL curl --request GET \ --url https://api.kamino.finance/strategies/shareholders/{walletPubkey}/rewards/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/strategies/shareholders/{walletPubkey}/rewards/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/strategies/shareholders/{walletPubkey}/rewards/history" response = requests.get(url) print(response.text) false 200 400 500 { "ownerPubkey": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs", "rewards": [\ {}\ ] } { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } GET / strategies / shareholders / {walletPubkey} / rewards / history Try it Get user rewards history cURL curl --request GET \ --url https://api.kamino.finance/strategies/shareholders/{walletPubkey}/rewards/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/strategies/shareholders/{walletPubkey}/rewards/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/strategies/shareholders/{walletPubkey}/rewards/history" response = requests.get(url) print(response.text) false 200 400 500 { "ownerPubkey": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs", "rewards": [\ {}\ ] } { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-rewards-history#parameter-wallet-pubkey) walletPubkey string required Wallet address of the user Example: `"AcNSmd5CxwLs21TYUmhWt7CW2v159TdYRkvQxb1iBYRj"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-rewards-history#parameter-env) env string default:mainnet-beta Solana cluster environment. Defaults to mainnet-beta. Example: `"mainnet-beta"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-rewards-history#response-owner-pubkey) ownerPubkey string required Wallet address of the user Example: `"9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs"` [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-rewards-history#response-rewards) rewards object\[\] required Historical reward entries across all strategies Assistant Responses are generated using AI and may contain mistakes. --- # Get user PnL history - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl-history#content-area) Get user PnL history cURL curl --request GET \ --url https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl/history" response = requests.get(url) print(response.text) false 200 400 500 { "strategy": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs", "wallet": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs", "totalPnl": { "usd": "0.123", "sol": "0.123", "a": "0.123", "b": "0.123" }, "totalCostBasis": { "usd": "0.123", "sol": "0.123", "a": "0.123", "b": "0.123" }, "history": [\ {}\ ] } { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } GET / v2 / strategies / {strategyPubkey} / shareholders / {walletPubkey} / pnl / history Try it Get user PnL history cURL curl --request GET \ --url https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl/history" response = requests.get(url) print(response.text) false 200 400 500 { "strategy": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs", "wallet": "9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs", "totalPnl": { "usd": "0.123", "sol": "0.123", "a": "0.123", "b": "0.123" }, "totalCostBasis": { "usd": "0.123", "sol": "0.123", "a": "0.123", "b": "0.123" }, "history": [\ {}\ ] } { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl-history#parameter-strategy-pubkey) strategyPubkey string required Public key of the strategy Example: `"3VXtabCgrd3RYuHa6HisufMfiE4aUk84Hu5quDFhqECD"` [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl-history#parameter-wallet-pubkey) walletPubkey string required Wallet address of the user Example: `"AcNSmd5CxwLs21TYUmhWt7CW2v159TdYRkvQxb1iBYRj"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl-history#parameter-env) env string default:mainnet-beta Solana cluster environment. Defaults to mainnet-beta. Example: `"mainnet-beta"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl-history#response-strategy) strategy string required Public key of the strategy Example: `"9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs"` [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl-history#response-wallet) wallet string required Wallet address of the user Example: `"9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs"` [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl-history#response-total-pnl) totalPnl object required Show child attributes [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl-history#response-total-cost-basis) totalCostBasis object required Show child attributes [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl-history#response-history) history object\[\] required Time-series PnL snapshots Assistant Responses are generated using AI and may contain mistakes. --- # Earn Withdraw with the SDK - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-sdk#content-area) [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-sdk#withdraw-from-earn-vault) Withdraw from Earn Vault -------------------------------------------------------------------------------------------------------------------------- Withdraw your vault shares to receive the underlying tokens plus accrued interest. 1 ### [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-sdk#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, Kamino SDK operations, and Kit transaction building. import { createSolanaRpc, createSolanaRpcSubscriptions, address, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { KaminoVault } from '@kamino-finance/klend-sdk'; import { parseKeypairFile } from '@kamino-finance/klend-sdk/dist/utils/signer.js'; import { Decimal } from 'decimal.js'; 2 ### [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-sdk#load-signer-and-initialize-vault) Load Signer and Initialize Vault Load your keypair from a file and initialize RPC connections and the vault instance. const KEYPAIR_FILE = '/path/to/your/keypair.json'; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const rpcSubscriptions = createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com'); const vault = new KaminoVault( rpc, address('HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E') ); Replace `/path/to/your/keypair.json` with the actual path to your keypair file. The `rpcSubscriptions` enables real-time transaction confirmation. 3 ### [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-sdk#build-withdraw-instructions) Build Withdraw Instructions Generate withdraw instructions including optional unstaking instructions. const withdrawAmount = new Decimal(1.0); const bundle = await vault.withdrawIxs(signer, withdrawAmount); const instructions = [...(bundle.unstakeFromFarmIfNeededIxs || []), ...(bundle.withdrawIxs || [])]; if (!instructions.length) { throw new Error('No instructions returned by Kamino SDK'); } The `withdrawIxs` method returns both unstaking and withdraw instructions. The amount represents **vault shares** to redeem, not the underlying token amount. 4 ### [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-sdk#build-and-sign-transaction) Build and Sign Transaction Use Kit’s functional pipe pattern to build and sign the transaction with a fresh blockhash. const { value: latestBlockhash } = await rpc.getLatestBlockhash().send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), (tx) => setTransactionMessageFeePayerSigner(signer, tx), (tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), (tx) => appendTransactionMessageInstructions(instructions, tx) ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); 5 ### [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-sdk#send-and-confirm-transaction) Send and Confirm Transaction Send the withdraw transaction and wait for confirmation. const signature = getSignatureFromTransaction(signedTransaction); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: 'confirmed', skipPreflight: true, }); console.log('Withdraw successful! Signature:', signature); Once the withdraw transaction is confirmed, your vault shares are burned and you receive the underlying tokens plus any accrued interest. Assistant Responses are generated using AI and may contain mistakes. --- # Building with LLMs - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/resources/building-with-llms#content-area) Kamino documentation is optimized for AI-powered development. Our machine-readable resources enable LLMs and AI agents to understand our APIs and build transactions on Solana. [​](https://kamino.com/docs/build/resources/building-with-llms#kamino-ai-resources) Kamino AI Resources ---------------------------------------------------------------------------------------------------------- skill.md -------- Structured capability reference with API endpoints, SDK methods, and integration workflows. Start here for agent tool use. llms.txt -------- Curated index of all documentation pages with one-line descriptions and direct URLs. llms-pages.json --------------- Machine-readable JSON mapping of every page with title, section, URL, and keywords. ### [​](https://kamino.com/docs/build/resources/building-with-llms#skill-md) skill.md The skill.md file provides a comprehensive, machine-readable reference of Kamino’s capabilities across all four products: Earn, Borrow, Multiply, and Liquidity. | Includes | Description | | --- | --- | | API endpoints | Complete REST endpoint reference for all products | | SDK methods | TypeScript method signatures with real code examples | | Workflows | Step-by-step operations: deposit, borrow, withdraw, repay, stake, harvest | | Integration patterns | Earn vaults, Borrow markets, Liquidity strategies, and Farms | | Use cases | Agent transaction building, API integration, automated DeFi strategies | ### [​](https://kamino.com/docs/build/resources/building-with-llms#llms-txt) llms.txt A structured navigation map of Kamino’s entire documentation, enabling LLMs to discover relevant pages and resources efficiently. | Includes | Description | | --- | --- | | Page directory | All documentation pages with direct URLs | | Tutorials | Organized by category: Earn, Borrow, Liquidity, Rewards, Oracle | | API reference | Endpoint navigation and documentation links | | Recipes | Code example locations and implementation guides | ### [​](https://kamino.com/docs/build/resources/building-with-llms#llms-pages-json) llms-pages.json A JSON file mapping every page path to its metadata: title, URL, section, description, and keywords. Useful for programmatic discovery and filtering. { "/products/lending-vaults": { "title": "Lending Vaults", "url": "https://kamino.com/docs/products/lending-vaults", "section": "Docs", "description": "Single-token managed yield aggregation across Kamino's lending markets", "keywords": ["kamino", "lending vaults", "yield", "vault shares", "auto-compounding"] } } Assistant Responses are generated using AI and may contain mistakes. --- # Multiply Repay with xStocks - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/borrow/multiply/multiply-repay-xstocks#content-area) Repaying debt on a multiply position reduces your outstanding debt balance, lowers your LTV (Loan-to-Value) ratio, and improves position health. This example shows how to repay USDC debt on a TSLAx multiply position using the Klend SDK. [​](https://kamino.com/docs/build/borrow/multiply/multiply-repay-xstocks#multiply-repay-with-xstocks) Multiply Repay with xStocks ------------------------------------------------------------------------------------------------------------------------------------ Repay debt on a TSLAx multiply position to reduce leverage and improve position health. 1 ### [​](https://kamino.com/docs/build/borrow/multiply/multiply-repay-xstocks#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, Kamino SDK operations, and transaction building. import { createSolanaRpc, createSolanaRpcSubscriptions, address, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { KaminoMarket, KaminoAction, MultiplyObligation, PROGRAM_ID, parseKeypairFile, DEFAULT_RECENT_SLOT_DURATION_MS, } from '@kamino-finance/klend-sdk'; import BN from 'bn.js'; 2 ### [​](https://kamino.com/docs/build/borrow/multiply/multiply-repay-xstocks#load-configuration-and-initialize-market) Load Configuration and Initialize Market Load the keypair and initialize 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 rpcSubscriptions = createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com'); const marketPubkey = address('5wJeMrUYECGq41fxRESKALVcHnNX26TAWy4W98yULsua'); // xStocks Market const market = await KaminoMarket.load(rpc, marketPubkey, DEFAULT_RECENT_SLOT_DURATION_MS); 3 ### [​](https://kamino.com/docs/build/borrow/multiply/multiply-repay-xstocks#find-tslax-reserve-in-market) Find TSLAx Reserve in Market Dynamically discover the TSLAx token mint by searching the market reserves by symbol. const tslaReserve = Array.from(market!.reserves.values()).find((reserve) => reserve.symbol === 'TSLAx'); if (!tslaReserve) { console.log('TSLAx reserve not found in xStocks market'); } const collTokenMint = tslaReserve.getLiquidityMint(); const debtTokenMint = address('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'); // USDC This dynamic discovery approach allows the code to work across different markets without hardcoding token mint addresses. 4 ### [​](https://kamino.com/docs/build/borrow/multiply/multiply-repay-xstocks#configure-repay-parameters) Configure Repay Parameters Set the amount of USDC to repay. This example repays $10 USDC. const repayAmount = new BN(10_000_000); // 10.00 USDC (6 decimals) const currentSlot = await rpc.getSlot().send(); You can repay any amount up to your total debt. After repaying, you are able to withdraw your collateral. 5 ### [​](https://kamino.com/docs/build/borrow/multiply/multiply-repay-xstocks#fetch-existing-multiply-obligation) Fetch Existing Multiply Obligation Create the multiply obligation type and fetch the existing position from the blockchain. const obligationType = new MultiplyObligation(collTokenMint, debtTokenMint, PROGRAM_ID); const obligation = await market!.getObligationByWallet(address(signer.address), obligationType); if (!obligation) { console.log('No obligation found for this wallet. You must have an active borrow to repay.'); } The `MultiplyObligation` type identifies this as a leveraged position rather than a standard borrow. The obligation must exist before you can repay debt. 6 ### [​](https://kamino.com/docs/build/borrow/multiply/multiply-repay-xstocks#build-repay-transaction) Build Repay Transaction Use `KaminoAction.buildRepayTxns` to generate the repay instructions. const repayAction = await KaminoAction.buildRepayTxns( market!, repayAmount, debtTokenMint, signer, obligationType, true, // useV2Ixs undefined, // scopeRefreshConfig currentSlot, signer, // payer 1_000_000, // extraComputeBudget true, // includeAtaIxs false // requestElevationGroup ); const allInstructions = [\ ...(repayAction.setupIxs || []),\ ...(repayAction.lendingIxs || []),\ ...(repayAction.cleanupIxs || []),\ ]; `buildRepayTxns` handles all the complexity of repaying multiply positions, including ATA creation, scope price refreshes, and obligation updates. 7 ### [​](https://kamino.com/docs/build/borrow/multiply/multiply-repay-xstocks#send-transaction) Send Transaction Get a fresh blockhash, build the transaction, sign it, and send it to the network. const { value: latestBlockhash } = await rpc.getLatestBlockhash({ commitment: 'finalized' }).send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), (tx) => setTransactionMessageFeePayerSigner(signer, tx), (tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), (tx) => appendTransactionMessageInstructions(allInstructions, tx) ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); const signature = getSignatureFromTransaction(signedTransaction); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: 'confirmed', skipPreflight: true, }); console.log(`Multiply repay successful! Repaid $10 USDC debt on TSLAx multiply position.`); console.log(`Transaction signature: ${signature}`); The repay transaction is complete, reducing your debt balance and improving your position’s health factor. ### [​](https://kamino.com/docs/build/borrow/multiply/multiply-repay-xstocks#borrow-and-multiply-sdk-methods) Borrow and Multiply SDK Methods | Method | Operation | When to Use | | --- | --- | --- | | `getDepositWithLeverageIxs` | Open position or add collateral | Creating or adding to a leveraged position | | `buildRepayTxns` | Repay with wallet funds | Reducing debt using USDC, SOL, etc. from wallet | | `buildWithdrawTxns` | Withdraw collateral | Withdrawing collateral after debt is repaid | | `getWithdrawWithLeverageIxs` | Deleverage and withdraw | Sell collateral to repay debt and receive remaining value in wallet | | `getRepayWithCollIxs` | Repay debt with collateral | Sell collateral to repay debt without withdrawing (value stays in position) | **Multiply operations** use `MultiplyObligation`. **Vanilla operations** use `VanillaObligation`. The obligation type determines which PDA is derived for your position. Assistant Responses are generated using AI and may contain mistakes. --- # Get Market Reserve APYs - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/borrow/get-market-reserve-apys#content-area) [​](https://kamino.com/docs/build/borrow/get-market-reserve-apys#borrow-&-supply-apy-calculation) Borrow & Supply APY Calculation ------------------------------------------------------------------------------------------------------------------------------------ A reserve is a single asset lending pool within a market. All deposits of an asset enter the same reserve, and all borrowing draws from that pool. Variable rates are driven by utilization, the fraction of deposits currently borrowed: Utilization = Borrowed / Total Deposited As utilization increases, borrow rates rise. As utilization decreases, borrow rates fall. Supply APY is derived from borrower interest and depends on both the borrow rate and utilization: Supply APY ≈ Borrow Rate × Utilization × (1 − Protocol Spread) Not all deposited capital is borrowed at any given time, so supply APY is always lower than the borrow rate. Higher utilization means more of the pool is earning interest, which increases lender yield. Reserves are isolated pools. The same asset in different markets has different borrowers, collateral, and risk profiles, and therefore different rates. * API * SDK 1 ### [​](https://kamino.com/docs/build/borrow/get-market-reserve-apys#fetch-all-markets) Fetch All Markets Retrieve the list of all lending markets on Kamino. const API_BASE_URL = 'https://api.kamino.finance'; const response = await fetch(`${API_BASE_URL}/v2/kamino-market`); const markets = await response.json(); The `/v2/kamino-market` endpoint returns all lending markets including SOL/BTC Market, JLP Market, Altcoins Market, and Prime Market. 2 ### [​](https://kamino.com/docs/build/borrow/get-market-reserve-apys#get-reserve-apys-for-each-market) Get Reserve APYs for Each Market For each market, fetch the APY metrics for all reserves (USDC, SOL, wETH, etc.). const allMarketReserves = await Promise.all( markets.map(async (market) => { const response = await fetch( `${API_BASE_URL}/kamino-market/${market.lendingMarket}/reserves/metrics` ); const reserves = await response.json(); return { market, reserves }; }) ); allMarketReserves.forEach(({ market, reserves }) => { console.log(`\n${market.name}:`); reserves.forEach((reserve) => { console.log(`\n${reserve.liquidityToken}:`); console.log(` Supply APY: ${(reserve.supplyApy * 100).toFixed(2)}%`); console.log(` Borrow APY: ${(reserve.borrowApy * 100).toFixed(2)}%`); console.log(` Total Deposits: $${reserve.totalSupplyUsd}`); console.log(` Total Borrowed: $${reserve.totalBorrowUsd}`); }); }); The `/kamino-market/{pubkey}/reserves/metrics` endpoint returns comprehensive metrics for each reserve including APYs, total deposits, and borrows. 1 ### [​](https://kamino.com/docs/build/borrow/get-market-reserve-apys#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication and Kamino SDK. import { createSolanaRpc } from '@solana/kit'; import { address } from '@solana/kit'; import { KaminoMarket, DEFAULT_RECENT_SLOT_DURATION_MS } from '@kamino-finance/klend-sdk'; 2 ### [​](https://kamino.com/docs/build/borrow/get-market-reserve-apys#get-current-slot) Get Current Slot Fetch the current Solana slot (block number) for APY calculations. const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const slot = await rpc.getSlot().send(); console.log(`Current slot: ${slot}`); **What is a slot?**A slot is Solana’s block number — like a timestamp but for blockchain state. The SDK uses it to calculate APY based on the current on-chain state. Think of it as “calculate APY as of right now.” 3 ### [​](https://kamino.com/docs/build/borrow/get-market-reserve-apys#load-a-market) Load a Market Load a specific lending market using its public key. const marketAddress = address('7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'); const market = await KaminoMarket.load(rpc, marketAddress, DEFAULT_RECENT_SLOT_DURATION_MS); 4 ### [​](https://kamino.com/docs/build/borrow/get-market-reserve-apys#get-all-reserves) Get All Reserves Retrieve all reserves (asset pools) in the market. const reserves = market.getReserves(); 5 ### [​](https://kamino.com/docs/build/borrow/get-market-reserve-apys#calculate-apys-for-each-reserve) Calculate APYs for Each Reserve Loop through each reserve and calculate its borrow and supply APYs. for (const reserve of reserves) { // Get the reserve's token symbol const symbol = reserve.stats.symbol || reserve.stats.mintAddress.toString().slice(0, 8); // Calculate APYs using current slot (convert to percentage form) const borrowAPY = reserve.totalBorrowAPY(slot) * 100; const supplyAPY = reserve.totalSupplyAPY(slot) * 100; // Get additional metrics (utilization as a percentage) const utilization = reserve.calculateUtilizationRatio(); const totalDeposits = reserve.getDepositTvl(); const totalBorrows = reserve.getBorrowTvl(); console.log(`\n${symbol}:`); console.log(` Supply APY: ${supplyAPY.toFixed(2)}%`); console.log(` Borrow APY: ${borrowAPY.toFixed(2)}%`); console.log(` Utilization: ${utilization.toFixed(2)}%`); console.log(` Total Deposits: ${totalDeposits.toFixed(2)}`); console.log(` Total Borrowed: ${totalBorrows.toFixed(2)}`); } The `reserve.totalBorrowAPY(slot)` and `reserve.totalSupplyAPY(slot)` methods calculate APY based on the current interest rate, utilization, and compounding frequency at the specified slot. You’ve successfully calculated borrow and supply APYs across all reserves using the Kamino SDK. Assistant Responses are generated using AI and may contain mistakes. --- # Get recent Solana slot duration - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/other/get-recent-solana-slot-duration#content-area) Get recent Solana slot duration cURL curl --request GET \ --url https://api.kamino.finance/slots/duration const options = {method: 'GET'}; fetch('https://api.kamino.finance/slots/duration', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/slots/duration" response = requests.get(url) print(response.text) false 200 500 { "recentSlotDurationInMs": 400 } { "error": "An internal error occurred" } GET / slots / duration Try it Get recent Solana slot duration cURL curl --request GET \ --url https://api.kamino.finance/slots/duration const options = {method: 'GET'}; fetch('https://api.kamino.finance/slots/duration', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/slots/duration" response = requests.get(url) print(response.text) false 200 500 { "recentSlotDurationInMs": 400 } { "error": "An internal error occurred" } #### Response 200 application/json OK [​](https://kamino.com/docs/build/other/get-recent-solana-slot-duration#response-recent-slot-duration-in-ms) recentSlotDurationInMs number required Slot duration in milliseconds derived from recent RPC performance samples over approximately the last hour Example: `400` Assistant Responses are generated using AI and may contain mistakes. --- # Calculate Reserve Reward APY - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/borrow/rewards/calculate-reserve-reward-apy#content-area) **Reserve Farms vs Extra Farms**Reserve farms are attached directly to a reserve and reward all users who deposit or borrow that reserve asset. Depositors earn rewards through collateral farms, while borrowers earn rewards through debt farms.Extra farms reward users only when specific collateral and debt combinations are used. Rewards are conditional on holding qualifying positions rather than simply depositing or borrowing a single reserve.This tutorial focuses on reserve farms. [​](https://kamino.com/docs/build/developers/borrow/rewards/calculate-reserve-reward-apy#calculate-reserve-reward-apy) Calculate Reserve Reward APY ------------------------------------------------------------------------------------------------------------------------------------------------------ Calculate APY for both collateral and debt farm rewards on a specific reserve. 1 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/calculate-reserve-reward-apy#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, Kamino SDK operations, and decimal calculations. import { createSolanaRpc, address, type Address } from '@solana/kit'; import { KaminoMarket, PROGRAM_ID, lamportsToNumberDecimal } from '@kamino-finance/klend-sdk'; import { FarmState, calculateCurrentRewardPerToken } from '@kamino-finance/farms-sdk'; import Decimal from 'decimal.js'; type PriceData = { mint: string; price: string }; const DEFAULT_PUBKEY = '11111111111111111111111111111111'; 2 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/calculate-reserve-reward-apy#initialize-rpc-and-fetch-prices) Initialize RPC and Fetch Prices Set up the Solana RPC connection and fetch token prices from the Kamino API. const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const mainMarket = address('7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'); const usdsMint = address('USDSwr9ApdHk5bvJKMjzff41FfuX8bSxdKcR81vTwcA'); // Fetch token prices from Kamino API const pricesRes = await fetch('https://api.kamino.finance/oracles/prices?markets=main'); const pricesData = (await pricesRes.json()) as PriceData[]; const priceMap = new Map(); for (const p of pricesData) { priceMap.set(p.mint, parseFloat(p.price)); } Creating a price map allows quick lookups for multiple reward tokens. The example uses USDS reserve which has both collateral and debt farm rewards active. 3 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/calculate-reserve-reward-apy#load-market-and-reserve) Load Market and Reserve Load the Kamino market and get the reserve by its mint address. // Load market and reserve const market = await KaminoMarket.load(rpc, mainMarket, 400, PROGRAM_ID); const reserve = market!.getReserveByMint(usdsMint); if (!reserve) { console.log('Reserve not found'); } else { The `getReserveByMint` method retrieves the reserve configuration including references to both the collateral farm and debt farm addresses. 4 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/calculate-reserve-reward-apy#collect-and-fetch-farm-addresses) Collect and Fetch Farm Addresses Collect both collateral and debt farm addresses, checking they’re not the default pubkey, then fetch all farms in parallel. // Collect debt and collateral farm addresses const farmsToFetch: { name: string; address: Address }[] = []; if (reserve.state.farmCollateral.toString() !== DEFAULT_PUBKEY) { farmsToFetch.push({ name: 'Collateral Farm Rewards', address: reserve.state.farmCollateral }); } if (reserve.state.farmDebt.toString() !== DEFAULT_PUBKEY) { farmsToFetch.push({ name: 'Debt Farm Rewards', address: reserve.state.farmDebt }); } // Fetch all farms in batch const farmAddresses = farmsToFetch.map((f) => f.address); const farmStates = await FarmState.fetchMultiple(rpc, farmAddresses); const farms = farmsToFetch.flatMap((farmInfo, index) => { const state = farmStates[index]; return state ? [{ name: farmInfo.name, state }] : []; }); Checking for the default pubkey ensures we only fetch farms that are actually configured on the reserve. Using `FarmState.fetchMultiple` fetches all farm states in a single batch request, which is more efficient than individual fetches. 5 ### [​](https://kamino.com/docs/build/developers/borrow/rewards/calculate-reserve-reward-apy#calculate-farm-reward-apy) Calculate Farm Reward APY Calculate APY for each active reward on both collateral and debt farms. for (const farm of farms) { const totalStaked = lamportsToNumberDecimal( farm.state.totalStakedAmount.toString(), farm.state.token.decimals.toNumber() || 6 ); console.log(farm.name + ':'); for (const rewardInfo of farm.state.rewardInfos) { if (rewardInfo.rewardsAvailable.gtn(0) && !totalStaked.isZero()) { const rewardMint = rewardInfo.token.mint.toString(); const rewardPrice = priceMap.get(rewardMint) || 1; const currentTime = new Decimal(Date.now() / 1000); // Calculate APY from farm rewards const rewardPerTokenPerSecond = calculateCurrentRewardPerToken(rewardInfo, currentTime); // returns the raw value const divisor = new Decimal(10) .pow(rewardInfo.rewardsPerSecondDecimals.toString()) .mul(new Decimal(10).pow(rewardInfo.token.decimals.toString())); const adjustedRewardPerToken = new Decimal(rewardPerTokenPerSecond).div(divisor); const dailyRewards = adjustedRewardPerToken.mul(86400).mul(rewardPrice); const apy = Decimal.pow(dailyRewards.div(totalStaked).plus(1), 365).minus(1); console.log(` Reward Token: ${rewardMint}`); console.log(` APY: ${(apy.toNumber() * 100).toFixed(2)}%\n`); } } } } The script outputs APY for all active rewards on both the collateral and debt farms. The `calculateCurrentRewardPerToken` helper from farms-sdk handles the reward schedule logic. Each reward is priced in USD and the total staked amount represents the value of all positions earning that reward. Assistant Responses are generated using AI and may contain mistakes. --- # Refresh Prices - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/oracle/operations/refresh#content-area) [​](https://kamino.com/docs/build/developers/oracle/operations/refresh#refresh-prices) Refresh Prices -------------------------------------------------------------------------------------------------------- Scope prices are pushed on-chain by permissionless “crank” transactions: anyone can sign and send a refresh, no admin authority required. The Scope SDK builds one instruction that refreshes the specified token slots for a feed. This is the instruction Multiply and flash-loan flows bundle in front of a leverage operation so reserves read fresh prices. 1 ### [​](https://kamino.com/docs/build/developers/oracle/operations/refresh#import-dependencies) Import Dependencies Import the Scope SDK plus the Solana Kit transaction-building helpers and a keypair loader. import { createSolanaRpc, createSolanaRpcSubscriptions, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, getSignatureFromTransaction, assertIsTransactionWithinSizeLimit, sendAndConfirmTransactionFactory, } from "@solana/kit"; import { parseKeypairFile } from "@kamino-finance/klend-sdk/dist/utils/signer"; import { Scope, SCOPE_MAINNET_HUBBLE_FEED } from "@kamino-finance/scope-sdk"; 2 ### [​](https://kamino.com/docs/build/developers/oracle/operations/refresh#configure-constants-and-initialize-scope) Configure Constants and Initialize Scope Set the keypair path, RPC endpoints, and the slot indices to refresh. const KEYPAIR_FILE = "/path/to/your/keypair.json"; const RPC_ENDPOINT = "https://api.mainnet-beta.solana.com"; const WS_ENDPOINT = "wss://api.mainnet-beta.solana.com"; // Slot indices to refresh (e.g. SOL, ETH, BTC on the Hubble feed). const TOKENS = [0, 1, 2]; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc(RPC_ENDPOINT); const rpcSubscriptions = createSolanaRpcSubscriptions(WS_ENDPOINT); const scope = new Scope("mainnet-beta", rpc); 3 ### [​](https://kamino.com/docs/build/developers/oracle/operations/refresh#build-the-refresh-instruction) Build the Refresh Instruction `refreshPriceListIx` returns one instruction that refreshes the listed slots, or `null` if there is nothing to refresh. const ix = await scope.refreshPriceListIx( { config: SCOPE_MAINNET_HUBBLE_FEED.configuration }, TOKENS, ); if (!ix) console.log(`Nothing to refresh for tokens [${TOKENS}]`); console.log(`Built refresh ix: program ${ix.programAddress}, ${ix.accounts?.length ?? 0} accounts`); The refresh is permissionless: any wallet can pay fees and send it. The Scope program writes the new dated prices to the feed’s `OraclePrices` account. 4 ### [​](https://kamino.com/docs/build/developers/oracle/operations/refresh#build-sign-and-send-transaction) Build, Sign, and Send Transaction Compose the v0 transaction, sign, verify it fits the size limit, then send and confirm. const { value: blockhash } = await rpc .getLatestBlockhash({ commitment: "finalized" }) .send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayerSigner(signer, m), (m) => setTransactionMessageLifetimeUsingBlockhash(blockhash, m), (m) => appendTransactionMessageInstructions([ix], m), ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); assertIsTransactionWithinSizeLimit(signedTransaction); const signature = getSignatureFromTransaction(signedTransaction); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: "confirmed", skipPreflight: true, }); console.log("Refresh successful! Signature:", signature); The refresh is complete. The targeted slots now have fresh prices and timestamps on-chain. #### [​](https://kamino.com/docs/build/developers/oracle/operations/refresh#full-code-example) Full Code Example import { createSolanaRpc, createSolanaRpcSubscriptions, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, getSignatureFromTransaction, assertIsTransactionWithinSizeLimit, sendAndConfirmTransactionFactory, } from "@solana/kit"; import { parseKeypairFile } from "@kamino-finance/klend-sdk/dist/utils/signer"; import { Scope, SCOPE_MAINNET_HUBBLE_FEED } from "@kamino-finance/scope-sdk"; const KEYPAIR_FILE = "/path/to/your/keypair.json"; const RPC_ENDPOINT = "https://api.mainnet-beta.solana.com"; const WS_ENDPOINT = "wss://api.mainnet-beta.solana.com"; const TOKENS = [0, 1, 2]; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc(RPC_ENDPOINT); const rpcSubscriptions = createSolanaRpcSubscriptions(WS_ENDPOINT); const scope = new Scope("mainnet-beta", rpc); const ix = await scope.refreshPriceListIx( { config: SCOPE_MAINNET_HUBBLE_FEED.configuration }, TOKENS, ); if (!ix) console.log(`Nothing to refresh for tokens [${TOKENS}]`); const { value: blockhash } = await rpc .getLatestBlockhash({ commitment: "finalized" }) .send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayerSigner(signer, m), (m) => setTransactionMessageLifetimeUsingBlockhash(blockhash, m), (m) => appendTransactionMessageInstructions([ix], m), ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); assertIsTransactionWithinSizeLimit(signedTransaction); const signature = getSignatureFromTransaction(signedTransaction); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: "confirmed", skipPreflight: true, }); console.log("Refresh successful! Signature:", signature); See all 54 lines Assistant Responses are generated using AI and may contain mistakes. --- # Harvest - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/rewards/operations/harvest#content-area) [​](https://kamino.com/docs/build/developers/rewards/operations/harvest#harvest) Harvest ------------------------------------------------------------------------------------------- Claim every pending reward token accrued on a farm to your wallet in one call. `claimForUserForFarmAllRewardsIx` walks every reward slot, skips any still under its claim cooldown, and returns one harvest instruction per claimable reward, plus an idempotent ATA-create instruction if the reward token account is missing. It reads on-chain Scope prices itself, so there is nothing to refresh. If the returned array is empty, nothing is past its cooldown to claim. 1 ### [​](https://kamino.com/docs/build/developers/rewards/operations/harvest#import-dependencies) Import Dependencies Import the packages for Solana RPC communication, Kit transaction building, the keypair loader, and the Farms SDK. import { createSolanaRpc, createSolanaRpcSubscriptions, address, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, getSignatureFromTransaction, assertIsTransactionWithinSizeLimit, sendAndConfirmTransactionFactory, } from "@solana/kit"; import { parseKeypairFile } from "@kamino-finance/klend-sdk/dist/utils/signer"; import { Farms } from "@kamino-finance/farms-sdk"; 2 ### [​](https://kamino.com/docs/build/developers/rewards/operations/harvest#configure-constants-and-initialize) Configure Constants and Initialize Set the keypair path, RPC endpoints, and target farm. Load the signer and initialize the farms client. const KEYPAIR_FILE = "/path/to/your/keypair.json"; const RPC_ENDPOINT = "https://api.mainnet-beta.solana.com"; const WS_ENDPOINT = "wss://api.mainnet-beta.solana.com"; const FARM = address("DXGwU8Ah7v6TBcc9ZjVmFxiLCMPgrxnsj4ZF7F8sWFxi"); // non-delegated farm const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc(RPC_ENDPOINT); const rpcSubscriptions = createSolanaRpcSubscriptions(WS_ENDPOINT); const farms = new Farms(rpc); 3 ### [​](https://kamino.com/docs/build/developers/rewards/operations/harvest#build-harvest-instructions) Build Harvest Instructions Build one harvest instruction per claimable reward. The payer signs and pays fees; the rewards land in the user’s wallet. const instructions = await farms.claimForUserForFarmAllRewardsIx( signer, // payer signer.address, // user (owner of the position) FARM, false, // isDelegated ); if (instructions.length === 0) console.log("Nothing to claim for", signer.address); Pass `isDelegated: false` for a non-delegated farm. For a delegated klend or kvault farm, pass `true` and the obligation as a delegatee in the optional `delegatees` argument. See [Claim user rewards](https://kamino.com/docs/build/developers/borrow/rewards/claim-user-rewards) for the delegated case. 4 ### [​](https://kamino.com/docs/build/developers/rewards/operations/harvest#build-sign-and-send-transaction) Build, Sign, and Send Transaction Compose the v0 transaction, sign, verify it fits the size limit, then send and confirm. const { value: blockhash } = await rpc .getLatestBlockhash({ commitment: "finalized" }) .send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayerSigner(signer, m), (m) => setTransactionMessageLifetimeUsingBlockhash(blockhash, m), (m) => appendTransactionMessageInstructions(instructions, m), ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); assertIsTransactionWithinSizeLimit(signedTransaction); const signature = getSignatureFromTransaction(signedTransaction); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: "confirmed", skipPreflight: true, }); console.log("Claim successful! Signature:", signature); The harvest is complete. Every reward token past its claim cooldown has been transferred to your wallet. #### [​](https://kamino.com/docs/build/developers/rewards/operations/harvest#full-code-example) Full Code Example import { createSolanaRpc, createSolanaRpcSubscriptions, address, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, getSignatureFromTransaction, assertIsTransactionWithinSizeLimit, sendAndConfirmTransactionFactory, } from "@solana/kit"; import { parseKeypairFile } from "@kamino-finance/klend-sdk/dist/utils/signer"; import { Farms } from "@kamino-finance/farms-sdk"; const KEYPAIR_FILE = "/path/to/your/keypair.json"; const RPC_ENDPOINT = "https://api.mainnet-beta.solana.com"; const WS_ENDPOINT = "wss://api.mainnet-beta.solana.com"; const FARM = address("DXGwU8Ah7v6TBcc9ZjVmFxiLCMPgrxnsj4ZF7F8sWFxi"); const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc(RPC_ENDPOINT); const rpcSubscriptions = createSolanaRpcSubscriptions(WS_ENDPOINT); const farms = new Farms(rpc); const instructions = await farms.claimForUserForFarmAllRewardsIx( signer, signer.address, FARM, false, ); if (instructions.length === 0) console.log("Nothing to claim for", signer.address); const { value: blockhash } = await rpc .getLatestBlockhash({ commitment: "finalized" }) .send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayerSigner(signer, m), (m) => setTransactionMessageLifetimeUsingBlockhash(blockhash, m), (m) => appendTransactionMessageInstructions(instructions, m), ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); assertIsTransactionWithinSizeLimit(signedTransaction); const signature = getSignatureFromTransaction(signedTransaction); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: "confirmed", skipPreflight: true, }); console.log("Claim successful! Signature:", signature); See all 57 lines Assistant Responses are generated using AI and may contain mistakes. --- # Get transaction to deposit into a kvault - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-earn-deposit/get-transaction-to-deposit-into-a-kvault#content-area) Get transaction to deposit into a kvault cURL curl --request POST \ --url https://api.kamino.finance/ktx/kvault/deposit \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', kvault: 'HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/kvault/deposit', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/kvault/deposit" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } POST / ktx / kvault / deposit Try it Get transaction to deposit into a kvault cURL curl --request POST \ --url https://api.kamino.finance/ktx/kvault/deposit \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', kvault: 'HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/kvault/deposit', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/kvault/deposit" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } #### Body application/json [​](https://kamino.com/docs/build/kamino-earn-deposit/get-transaction-to-deposit-into-a-kvault#body-wallet) wallet string required User wallet address (base58) that will also sign the transaction Required string length: `32 - 44` Example: `"KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9"` [​](https://kamino.com/docs/build/kamino-earn-deposit/get-transaction-to-deposit-into-a-kvault#body-kvault) kvault string required Target Kamino vault address Required string length: `32 - 44` Example: `"HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E"` [​](https://kamino.com/docs/build/kamino-earn-deposit/get-transaction-to-deposit-into-a-kvault#body-amount) amount string required Amount to deposit (in decimal format, not lamports) Example: `"0.1234"` [​](https://kamino.com/docs/build/kamino-earn-deposit/get-transaction-to-deposit-into-a-kvault#body-memo) memo string Memo to include with the deposit transaction (maximum 64 UTF-8 bytes) Required string length: `1 - 64` #### Response 200 application/json Default Response [​](https://kamino.com/docs/build/kamino-earn-deposit/get-transaction-to-deposit-into-a-kvault#response-transaction) transaction string required Encoded transaction ready to send Example: `"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM="` Assistant Responses are generated using AI and may contain mistakes. --- # Get instructions to deposit into a klend reserve - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-lend-deposit/get-instructions-to-deposit-into-a-klend-reserve#content-area) Get instructions to deposit into a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/deposit-instructions \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/deposit-instructions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/deposit-instructions" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "instructions": [\ {\ "accounts": [\ {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT",\ "role": "WRITABLE_SIGNER",\ "signer": {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT"\ }\ }\ ],\ "data": "8iPGiVLh8rYA4fUFAAAAAA==",\ "programAddress": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd"\ }\ ], "lutsByAddress": { "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [\ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH",\ "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E",\ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"\ ] } } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } POST / ktx / klend / deposit-instructions Try it Get instructions to deposit into a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/deposit-instructions \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/deposit-instructions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/deposit-instructions" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "instructions": [\ {\ "accounts": [\ {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT",\ "role": "WRITABLE_SIGNER",\ "signer": {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT"\ }\ }\ ],\ "data": "8iPGiVLh8rYA4fUFAAAAAA==",\ "programAddress": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd"\ }\ ], "lutsByAddress": { "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [\ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH",\ "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E",\ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"\ ] } } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } #### Body application/json [​](https://kamino.com/docs/build/kamino-lend-deposit/get-instructions-to-deposit-into-a-klend-reserve#body-wallet) wallet string required User wallet address (base58) that will also sign the transaction Required string length: `32 - 44` Example: `"KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9"` [​](https://kamino.com/docs/build/kamino-lend-deposit/get-instructions-to-deposit-into-a-klend-reserve#body-market) market string required Target Kamino Lend market address Required string length: `32 - 44` Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/kamino-lend-deposit/get-instructions-to-deposit-into-a-klend-reserve#body-reserve) reserve string required Target Kamino Lend Reserve address. The reserve must belong to the specified market Required string length: `32 - 44` Example: `"D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59"` [​](https://kamino.com/docs/build/kamino-lend-deposit/get-instructions-to-deposit-into-a-klend-reserve#body-amount) amount string required Amount of liquidity token to deposit (in decimal format, not lamports) Example: `"0.1234"` #### Response 200 application/json Default Response [​](https://kamino.com/docs/build/kamino-lend-deposit/get-instructions-to-deposit-into-a-klend-reserve#response-instructions) instructions object\[\] required Show child attributes [​](https://kamino.com/docs/build/kamino-lend-deposit/get-instructions-to-deposit-into-a-klend-reserve#response-luts-by-address) lutsByAddress object required Show child attributes Example: `{ "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH", "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" ] }` Assistant Responses are generated using AI and may contain mistakes. --- # Get user PnL - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl#content-area) Get user PnL cURL curl --request GET \ --url https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl" response = requests.get(url) print(response.text) false 200 400 500 { "totalPnl": { "usd": "0.123", "sol": "0.123", "a": "0.123", "b": "0.123" }, "totalCostBasis": { "usd": "0.123", "sol": "0.123", "a": "0.123", "b": "0.123" } } { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } GET / v2 / strategies / {strategyPubkey} / shareholders / {walletPubkey} / pnl Try it Get user PnL cURL curl --request GET \ --url https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/strategies/{strategyPubkey}/shareholders/{walletPubkey}/pnl" response = requests.get(url) print(response.text) false 200 400 500 { "totalPnl": { "usd": "0.123", "sol": "0.123", "a": "0.123", "b": "0.123" }, "totalCostBasis": { "usd": "0.123", "sol": "0.123", "a": "0.123", "b": "0.123" } } { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl#parameter-strategy-pubkey) strategyPubkey string required Public key of the strategy Example: `"3VXtabCgrd3RYuHa6HisufMfiE4aUk84Hu5quDFhqECD"` [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl#parameter-wallet-pubkey) walletPubkey string required Wallet address of the user Example: `"AcNSmd5CxwLs21TYUmhWt7CW2v159TdYRkvQxb1iBYRj"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl#parameter-env) env string default:mainnet-beta Solana cluster environment. Defaults to mainnet-beta. Example: `"mainnet-beta"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl#response-total-pnl) totalPnl object required Show child attributes [​](https://kamino.com/docs/build/api-reference/liquidity/user-data/user-pnl#response-total-cost-basis) totalCostBasis object required Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Get all kvaults - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-list#content-area) Get all kvaults cURL curl --request GET \ --url https://api.kamino.finance/kvaults/vaults const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/vaults', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/vaults" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "address": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "state": {\ "vaultAdminAuthority": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "baseVaultAuthority": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "baseVaultAuthorityBump": 123,\ "tokenMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "tokenMintDecimals": 123,\ "tokenVault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "tokenProgram": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "sharesMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "sharesMintDecimals": 123,\ "tokenAvailable": "1234.56789",\ "sharesIssued": "1234.56789",\ "availableCrankFunds": "1234.56789",\ "performanceFeeBps": 123,\ "managementFeeBps": 123,\ "lastFeeChargeTimestamp": 123,\ "prevAum": "1234.56789",\ "pendingFees": "1234.56789",\ "vaultAllocationStrategy": [\ {\ "reserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "ctokenVault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "targetAllocationWeight": 123,\ "tokenAllocationCap": "",\ "ctokenVaultBump": 123,\ "ctokenAllocation": "",\ "lastInvestSlot": "",\ "tokenTargetAllocation": "1234.56789"\ }\ ],\ "minDepositAmount": "1234.56789",\ "minWithdrawAmount": "1234.56789",\ "minInvestAmount": "1234.56789",\ "minInvestDelaySlots": 123,\ "crankFundFeePerReserve": "1234.56789",\ "pendingAdmin": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "cumulativeEarnedInterest": "1234.56789",\ "cumulativeMgmtFees": "1234.56789",\ "cumulativePerfFees": "1234.56789",\ "name": "",\ "vaultLookupTable": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "vaultFarm": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "creationTimestamp": 123,\ "allocationAdmin": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"\ },\ "programId": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / kvaults / vaults Try it Get all kvaults cURL curl --request GET \ --url https://api.kamino.finance/kvaults/vaults const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/vaults', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/vaults" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "address": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "state": {\ "vaultAdminAuthority": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "baseVaultAuthority": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "baseVaultAuthorityBump": 123,\ "tokenMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "tokenMintDecimals": 123,\ "tokenVault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "tokenProgram": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "sharesMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "sharesMintDecimals": 123,\ "tokenAvailable": "1234.56789",\ "sharesIssued": "1234.56789",\ "availableCrankFunds": "1234.56789",\ "performanceFeeBps": 123,\ "managementFeeBps": 123,\ "lastFeeChargeTimestamp": 123,\ "prevAum": "1234.56789",\ "pendingFees": "1234.56789",\ "vaultAllocationStrategy": [\ {\ "reserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "ctokenVault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "targetAllocationWeight": 123,\ "tokenAllocationCap": "",\ "ctokenVaultBump": 123,\ "ctokenAllocation": "",\ "lastInvestSlot": "",\ "tokenTargetAllocation": "1234.56789"\ }\ ],\ "minDepositAmount": "1234.56789",\ "minWithdrawAmount": "1234.56789",\ "minInvestAmount": "1234.56789",\ "minInvestDelaySlots": 123,\ "crankFundFeePerReserve": "1234.56789",\ "pendingAdmin": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "cumulativeEarnedInterest": "1234.56789",\ "cumulativeMgmtFees": "1234.56789",\ "cumulativePerfFees": "1234.56789",\ "name": "",\ "vaultLookupTable": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "vaultFarm": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "creationTimestamp": 123,\ "allocationAdmin": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"\ },\ "programId": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-list#parameter-one-of-0) type enumenum\[\]enumenum\[\] Vault types. Multiple values return all vaults matching any of the specified types. Omit this parameter to return all on-chain vaults. Available options: `live`, `privateCredit` Example: `"live"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-list#response-items-address) address string required Public key of the vault Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-list#response-items-state) state object required Show child attributes [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vaults-list#response-items-program-id) programId string required Public key of the kvault program which owns the vault Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` Assistant Responses are generated using AI and may contain mistakes. --- # Get historical user metrics for all KVault positions - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#content-area) Get historical user metrics for all KVault positions cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{pubkey}/metrics/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{pubkey}/metrics/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{pubkey}/metrics/history" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "createdOn": "2025-03-01T12:00:00.000Z",\ "usdAmount": "1234.56789",\ "solAmount": "1234.56789",\ "weightedApy": "0.2",\ "cumulativeInterestEarnedUsd": "1234.56789",\ "cumulativeInterestEarnedSol": "1234.56789",\ "interestEarnedPerSecondUsd": "1234.56789",\ "interestEarnedPerSecondSol": "1234.56789"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / kvaults / users / {pubkey} / metrics / history Try it Get historical user metrics for all KVault positions cURL curl --request GET \ --url https://api.kamino.finance/kvaults/users/{pubkey}/metrics/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/users/{pubkey}/metrics/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/users/{pubkey}/metrics/history" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "createdOn": "2025-03-01T12:00:00.000Z",\ "usdAmount": "1234.56789",\ "solAmount": "1234.56789",\ "weightedApy": "0.2",\ "cumulativeInterestEarnedUsd": "1234.56789",\ "cumulativeInterestEarnedSol": "1234.56789",\ "interestEarnedPerSecondUsd": "1234.56789",\ "interestEarnedPerSecondSol": "1234.56789"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#parameter-pubkey) pubkey string required Valid base58-encoded address of the user wallet Example: `"AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#parameter-one-of-0) start stringnumberstringnumber default:1970-01-01T00:00:00.000Z Start date of the range (defaults to Unix epoch). Accepts ISO string or epoch in ms. Example: `"1970-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#parameter-one-of-0) end stringnumberstringnumber End date of the range (defaults to current time). Accepts ISO string or epoch in ms. Example: `"2025-01-01T00:00:00.000Z"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#response-items-created-on) createdOn string required Timestamp when the snapshot was created (ISO 8601 format) Example: `"2025-03-01T12:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#response-items-usd-amount) usdAmount string required User's total amount across all vaults in USD Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#response-items-sol-amount) solAmount string required User's total amount across all vaults in SOL Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#response-items-weighted-apy) weightedApy string required Weighted average APY across all vaults in decimal format Example: `"0.2"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#response-items-cumulative-interest-earned-usd) cumulativeInterestEarnedUsd string required Total interest earned in USD across all vaults Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#response-items-cumulative-interest-earned-sol) cumulativeInterestEarnedSol string required Total interest earned in SOL across all vaults Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#response-items-interest-earned-per-second-usd) interestEarnedPerSecondUsd string required Interest earned per second at that specific moment in USD Example: `"1234.56789"` [​](https://kamino.com/docs/build/api-reference/earn/user-data/user-metrics-history#response-items-interest-earned-per-second-sol) interestEarnedPerSecondSol string required Interest earned per second at that specific moment in SOL Example: `"1234.56789"` Assistant Responses are generated using AI and may contain mistakes. --- # Deposit with the API - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/recipes/borrow/deposit-via-api#content-area) Deposit collateral into a Kamino reserve using the API. The API builds the transaction, and you sign it locally keeping your keys secure. [​](https://kamino.com/docs/build/recipes/borrow/deposit-via-api#deposit-via-the-api) Deposit via the API ------------------------------------------------------------------------------------------------------------ 1 ### [​](https://kamino.com/docs/build/recipes/borrow/deposit-via-api#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, transaction handling, and Kamino SDK utilities. import { createSolanaRpc, createSolanaRpcSubscriptions, getTransactionDecoder, getCompiledTransactionMessageDecoder, decompileTransactionMessageFetchingLookupTables, pipe, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, addSignersToTransactionMessage, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { parseKeypairFile } from '@kamino-finance/klend-sdk/dist/utils/signer'; 2 ### [​](https://kamino.com/docs/build/recipes/borrow/deposit-via-api#configure-and-initialize) Configure and Initialize Set up the configuration and initialize RPC connections. const KEYPAIR_FILE = '/path/to/your/keypair.json'; const API_BASE_URL = 'https://api.kamino.finance'; const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com'; const WS_ENDPOINT = 'wss://api.mainnet-beta.solana.com'; const MAIN_MARKET = '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'; const CASH_RESERVE = 'ApQkX32ULJUzszZDe986aobLDLMNDoGQK8tRm6oD6SsA'; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc(RPC_ENDPOINT); const rpcSubscriptions = createSolanaRpcSubscriptions(WS_ENDPOINT); 3 ### [​](https://kamino.com/docs/build/recipes/borrow/deposit-via-api#call-the-kamino-api) Call the Kamino API Make a POST request to the Kamino API to build the deposit transaction. const res = await fetch(`${API_BASE_URL}/ktx/klend/deposit`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ wallet: signer.address, market: MAIN_MARKET, reserve: CASH_RESERVE, amount: '2.0', }), }); const data = await res.json(); if (!res.ok) { console.error('Response error:', data); } const encodedTransaction = data.transaction; The API returns a pre-built transaction encoded in base64 format ready for signing. 4 ### [​](https://kamino.com/docs/build/recipes/borrow/deposit-via-api#decode-transaction) Decode Transaction Decode the base64-encoded transaction and extract the message bytes. const txBuffer = Buffer.from(encodedTransaction, 'base64'); const txMessageBytes = getTransactionDecoder().decode(txBuffer).messageBytes; const compiledMessage = getCompiledTransactionMessageDecoder().decode(txMessageBytes); 5 ### [​](https://kamino.com/docs/build/recipes/borrow/deposit-via-api#resolve-address-lookup-tables-and-sign) Resolve Address Lookup Tables and Sign Fetch the latest blockhash, decompile the transaction to resolve Address Lookup Tables, and sign. const { value: latestBlockhash } = await rpc.getLatestBlockhash({ commitment: 'finalized' }).send(); const signedTransaction = await pipe( await decompileTransactionMessageFetchingLookupTables(compiledMessage, rpc), tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), tx => setTransactionMessageFeePayerSigner(signer, tx), tx => addSignersToTransactionMessage([signer], tx), tx => signTransactionMessageWithSigners(tx) ); const signature = getSignatureFromTransaction(signedTransaction); `decompileTransactionMessageFetchingLookupTables` fetches the lookup table data from the blockchain and resolves all address references. This is required for transactions that use ALTs. 6 ### [​](https://kamino.com/docs/build/recipes/borrow/deposit-via-api#send-and-confirm-transaction) Send and Confirm Transaction Submit the signed transaction to the Solana network. const sendAndConfirm = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions, }); await sendAndConfirm(signedTransaction, { commitment: 'confirmed', skipPreflight: false, }); console.log('Success! Signature:', signature); Your deposit is complete! The API built the transaction, you signed it locally (keeping your keys secure), and it was successfully submitted to the network. Assistant Responses are generated using AI and may contain mistakes. --- # Get token prices - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/oracle/token-prices#content-area) Get token prices cURL curl --request GET \ --url https://api.kamino.finance/prices const options = {method: 'GET'}; fetch('https://api.kamino.finance/prices', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/prices" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",\ "token": "USDC",\ "usdPrice": "0.9996"\ }\ ] { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } GET / prices Try it Get token prices cURL curl --request GET \ --url https://api.kamino.finance/prices const options = {method: 'GET'}; fetch('https://api.kamino.finance/prices', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/prices" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",\ "token": "USDC",\ "usdPrice": "0.9996"\ }\ ] { "error": "Invalid query params", "details": [\ {}\ ] } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/oracle/token-prices#parameter-source) source string default:scope Price source. Defaults to scope. Example: `"scope"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/oracle/token-prices#response-items-mint) mint string required Token mint address Example: `"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"` [​](https://kamino.com/docs/build/api-reference/oracle/token-prices#response-items-token) token string required Token symbol Example: `"USDC"` [​](https://kamino.com/docs/build/api-reference/oracle/token-prices#response-items-usd-price) usdPrice string required Token price in USD Example: `"0.9996"` Assistant Responses are generated using AI and may contain mistakes. --- # Feeds - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/oracle/data/feeds#content-area) [​](https://kamino.com/docs/build/developers/oracle/data/feeds#reading-feed-internals) Reading Feed Internals ---------------------------------------------------------------------------------------------------------------- Beyond prices, the Scope SDK exposes the wiring behind a feed: its top-level `Configuration` account, the per-hop metadata for a scope chain (provider plus oracle type), and the raw per-slot oracle mappings. ### [​](https://kamino.com/docs/build/developers/oracle/data/feeds#feed-configuration) Feed Configuration A feed’s `Configuration` holds the admin and the accounts it owns: `oraclePrices`, `oracleMappings`, `tokensMetadata`, and `oracleTwaps`. feedConfiguration import { createSolanaRpc } from '@solana/kit'; import { Scope, SCOPE_MAINNET_HUBBLE_FEED } from '@kamino-finance/scope-sdk'; const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com'; const rpc = createSolanaRpc(RPC_ENDPOINT); const scope = new Scope('mainnet-beta', rpc); const [configAddress, config] = await scope.getSingleFeedConfiguration({ config: SCOPE_MAINNET_HUBBLE_FEED.configuration, }); console.log('Config account:', configAddress); console.log({ admin: config.admin.toString(), adminCached: config.adminCached.toString(), oraclePrices: config.oraclePrices.toString(), oracleMappings: config.oracleMappings.toString(), tokensMetadata: config.tokensMetadata.toString(), oracleTwaps: config.oracleTwaps.toString(), }); [View Code](https://github.com/Kamino-Finance/scope-sdk) List every feed on the Scope program with `scope.getAllConfigurations()`. ### [​](https://kamino.com/docs/build/developers/oracle/data/feeds#chain-metadata-what-backs-a-price) Chain Metadata (what backs a price) `getChainMetadata` returns one entry per hop of a scope chain, telling you which provider serves the price and which oracle type produces it (one of about 40 kinds, including `PythPull`, `ScopeTwap`, `SplStake`, `DiscountToMaturity`, `MostRecentOf`, and `CappedFloored`). chainMetadata import { createSolanaRpc } from '@solana/kit'; import { Scope, SCOPE_MAINNET_HUBBLE_FEED } from '@kamino-finance/scope-sdk'; const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com'; const CHAIN = [0, 65535, 65535, 65535]; // SOL/USD, single-hop const rpc = createSolanaRpc(RPC_ENDPOINT); const scope = new Scope('mainnet-beta', rpc); const metadata = await scope.getChainMetadata( { config: SCOPE_MAINNET_HUBBLE_FEED.configuration }, CHAIN, ); metadata.forEach((m, hop) => { console.log(`hop ${hop}: ${m.name} (${m.simpleName})`); console.log(` provider: ${m.provider} | oracleType: ${m.oracleType}`); console.log(` nestedOracles: ${JSON.stringify(m.nestedOracles)}`); }); The oracle type is chosen by the feed admin at config time (`updateFeedMapping`). This call only inspects what is already set. For the curator-facing configuration side, see [Scope Oracle Types](https://kamino.com/docs/curators/markets/scope-oracle-types) . ### [​](https://kamino.com/docs/build/developers/oracle/data/feeds#oracle-mappings-raw-per-slot-wiring) Oracle Mappings (raw per-slot wiring) `getOracleMappings` returns the raw per-slot wiring behind every price in the feed. Where `getChainMetadata` humanizes one chain’s hops, the mappings expose every slot: the source account Scope reads, the oracle type discriminant, TWAP smoothing config, and the Reference Price Check slot. oracleMappings import { createSolanaRpc } from '@solana/kit'; import { Scope, SCOPE_MAINNET_HUBBLE_FEED } from '@kamino-finance/scope-sdk'; const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com'; const NONE = 65535; const rpc = createSolanaRpc(RPC_ENDPOINT); const scope = new Scope('mainnet-beta', rpc); const m = await scope.getOracleMappings({ config: SCOPE_MAINNET_HUBBLE_FEED.configuration, }); // First 6 slots. m.priceInfoAccounts.slice(0, 6).forEach((acct, slot) => { console.log({ slot, source: acct.toString(), oracleType: m.priceTypes[slot], twapEnabled: m.twapEnabled[slot] === 1, refPriceSlot: m.refPrice[slot] === NONE ? 'none' : m.refPrice[slot], }); }); `65535` is the unset sentinel throughout. `refPrice` is the slot an incoming price is sanity-checked against, the Reference Price Check feature described in [Scope Oracle Types](https://kamino.com/docs/curators/markets/scope-oracle-types) . [​](https://kamino.com/docs/build/developers/oracle/data/feeds#additional-resources) Additional Resources ------------------------------------------------------------------------------------------------------------ SDK Repository -------------- Scope Oracle Types ------------------ Assistant Responses are generated using AI and may contain mistakes. --- # Monitor Position Health - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/multiply/data/health-metrics#content-area) 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. ### [​](https://kamino.com/docs/build/developers/multiply/data/health-metrics#position-health-metrics) Position Health Metrics | Metric | Description | | --- | --- | | **Total Deposit** | The total USD value of all collateral deposited into the position | | **Total Borrow** | The total USD value of debt owed on the position | | **Net Value** | Equity in the position. Calculated as Total Deposit - Total Borrow. Represents the value that would be received if all debt were repaid and collateral withdrawn | | **Leverage** | Capital amplification multiplier. 1x = no leverage (collateral only), 2x = borrowed amount equals deposit, 3x = borrowed twice the deposit amount | | **Borrow Limit** | Maximum borrowing capacity before approaching liquidation threshold. Total Borrow must remain below this value | | **Liquidation LTV** | The 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. * * * [​](https://kamino.com/docs/build/developers/multiply/data/health-metrics#get-position-health-metrics) Get Position Health Metrics ------------------------------------------------------------------------------------------------------------------------------------- * SDK * API 1 ### [​](https://kamino.com/docs/build/developers/multiply/data/health-metrics#import-dependencies) 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 ### [​](https://kamino.com/docs/build/developers/multiply/data/health-metrics#load-market-and-initialize-rpc) 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 ### [​](https://kamino.com/docs/build/developers/multiply/data/health-metrics#fetch-multiply-obligations) 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:** | Type | Value & Description | | --- | --- | | `ObligationTypeTag.Vanilla` | 0: Cross-collateral mode positions | | `ObligationTypeTag.Multiply` | 1: Leveraged positions created via Multiply | | `ObligationTypeTag.Lending` | 2: Lending-only positions | | `ObligationTypeTag.Leverage` | 3: Legacy leverage positions | 4 ### [​](https://kamino.com/docs/build/developers/multiply/data/health-metrics#read-position-health-metrics) 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. const walletAddress = 'your-wallet-address-here'; const marketAddress = '5wJeMrUYECGq41fxRESKALVcHnNX26TAWy4W98yULsua'; // xStocks Market const response = await fetch( `https://api.kamino.finance/kamino-market/${marketAddress}/users/${walletAddress}/obligations` ); const data = await response.json(); if (data.length === 0) { console.log('No obligations found.'); } data.forEach((obligation) => { console.log(`\nObligation Address: ${obligation.obligationAddress}`); console.log(`Type: ${obligation.humanTag}`); const stats = obligation.refreshedStats; console.log(`Stats:`); console.log(` Total Deposit: $${parseFloat(stats.userTotalDeposit).toFixed(2)}`); console.log(` Total Borrow: $${parseFloat(stats.userTotalBorrow).toFixed(2)}`); console.log(` Net Value: $${(parseFloat(stats.userTotalDeposit) - parseFloat(stats.userTotalBorrow)).toFixed(2)}`); console.log(` Leverage: ${parseFloat(stats.leverage).toFixed(2)}x`); console.log(` Borrow Limit: $${parseFloat(stats.borrowLimit).toFixed(2)}`); console.log(` Liquidation LTV: ${(parseFloat(stats.liquidationLtv) * 100).toFixed(2)}%`); }); * * * [​](https://kamino.com/docs/build/developers/multiply/data/health-metrics#liquidation-ltv-by-asset-pair) Liquidation LTV by Asset Pair ----------------------------------------------------------------------------------------------------------------------------------------- | Mode | Asset Pair | Liquidation LTV | Max Leverage | | --- | --- | --- | --- | | **Standard** | SOL / USDC | 75% | 4x | | **Standard** | TSLAx / USDC | 65% | ~2.9x | | **eMode (Main)** | mSOL, bSOL, JupSOL / SOL | ~87% | ~7.7x | | **eMode (Jito)** | JitoSOL / SOL | 90% | 10x | | **No eMode** | JLP / USDC | 67% | ~3.2x | For detailed leverage calculations and eMode mechanics, see [LTV and Leverage Concepts](https://kamino.com/docs/build/developers/multiply/data/concepts) . Assistant Responses are generated using AI and may contain mistakes. --- # Multiply - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/multiply/overview#content-area) [​](https://kamino.com/docs/build/developers/multiply/overview#what-is-multiply) What is Multiply? ----------------------------------------------------------------------------------------------------- Multiply creates leveraged positions in a single atomic transaction by automating the looping process through flash loans. Instead of manually executing 8-10 separate deposit-borrow-swap cycles, Multiply collapses the entire leverage-building process into one transaction that either succeeds completely or reverts with no state changes. ### [​](https://kamino.com/docs/build/developers/multiply/overview#borrow-and-multiply-sdk-methods) Borrow and Multiply SDK Methods | Method | Operation | When to Use | | --- | --- | --- | | `getDepositWithLeverageIxs` | Open position or add collateral | Creating or adding to a leveraged position | | `buildRepayTxns` | Repay with wallet funds | Reducing debt using USDC, SOL, etc. from wallet | | `buildWithdrawTxns` | Withdraw collateral | Withdrawing collateral after debt is repaid | | `getWithdrawWithLeverageIxs` | Deleverage and withdraw | Sell collateral to repay debt and receive remaining value in wallet | | `getRepayWithCollIxs` | Repay debt with collateral | Sell collateral to repay debt without withdrawing (value stays in position) | **Multiply operations** use `MultiplyObligation`. **Standard borrow operations** use `VanillaObligation`. The obligation type determines which PDA is derived for your position. ### [​](https://kamino.com/docs/build/developers/multiply/overview#borrow-and-multiply-rust-crate-helpers) Borrow and Multiply: Rust Crate Helpers The Rust [`klend-interface`](https://crates.io/crates/klend-interface) crate exposes the lending primitives and flash loans, but does not include leveraged combo helpers. | Helper | Operation | When to Use | | --- | --- | --- | | `helpers::flash::flash_loan` | Atomic flash borrow + repay pair | Building any flash-loan-based flow | | `ObligationContext.repay` | Repay with wallet funds | Reducing debt using USDC, SOL, etc. from wallet | | `ObligationContext.withdraw` | Withdraw collateral | Withdrawing collateral after debt is repaid | Leveraged combo operations (`getDepositWithLeverageIxs`, `getWithdrawWithLeverageIxs`, `getRepayWithCollIxs`) are **not** available in the Rust crate — they bundle flash loans with KSwap routing, which only the TypeScript SDK builds. * * * [​](https://kamino.com/docs/build/developers/multiply/overview#sdk-vs-api-vs-rust-crate-what%E2%80%99s-available) SDK vs API vs Rust Crate: What’s Available --------------------------------------------------------------------------------------------------------------------------------------------------------------- Understanding which operations are reachable from the SDK, the API, and the Rust crate is critical for building Multiply integrations. | Operation | SDK | API | Rust Crate | Notes | | --- | --- | --- | --- | --- | | **Flash Loans** | Available | Not available | Available | Atomic transactions — SDK or Rust crate | | **Multiply Deposit (with KSwap)** | Required | Not available | Not available | Leveraged positions with swap routing — SDK only | | **Standard Borrow Operations** | Available | Available | Available | Deposit, borrow, repay, withdraw across SDK / API / Rust | | **Position Data** | Available | Available | Available | Read obligation data via any path | | **Market Reserve Data** | Available | Available | Limited | APYs, utilization, liquidity via SDK or API | [​](https://kamino.com/docs/build/developers/multiply/overview#flash-loans) Flash Loans ------------------------------------------------------------------------------------------ A flash loan is an uncollateralized loan that must be borrowed and fully repaid within the same transaction block. This atomic property makes flash loans risk-free for the protocol. ### [​](https://kamino.com/docs/build/developers/multiply/overview#flash-loan-properties) Flash Loan Properties | Property | Description | | --- | --- | | **Collateral Required** | None — uncollateralized | | **Repayment Window** | Same transaction block | | **Failure Behavior** | Entire transaction reverts (no state changes) | | **Fee** | 0.001% per transaction | | **Risk to Protocol** | Zero — atomicity guarantees repayment or reversion | If a flash loan cannot be repaid — due to slippage, insufficient liquidity, or any other failure — the entire transaction reverts. No intermediate state is committed to the blockchain. * * * [​](https://kamino.com/docs/build/developers/multiply/overview#looping-manual-vs-atomic) Looping: Manual vs Atomic --------------------------------------------------------------------------------------------------------------------- Looping is the process of repeatedly depositing collateral, borrowing against it, and reinvesting the borrowed funds to amplify exposure. The method determines risk, cost, and execution complexity. ### [​](https://kamino.com/docs/build/developers/multiply/overview#comparison-table) Comparison Table | Aspect | Manual Looping | Atomic Looping (Multiply) | | --- | --- | --- | | **Transaction Count** | 8-10 separate transactions | 1 atomic transaction | | **Price Exposure** | Exposed to price changes between each step | No exposure — all steps execute atomically | | **Slippage Risk** | Slippage on each swap individually | Single consolidated slippage check | | **Gas Costs** | Higher — multiple transactions | Lower — single transaction | | **Execution Risk** | High — any step can fail independently | Low — all-or-nothing execution | | **Time to Complete** | Minutes (dependent on block confirmations) | Single block (~400ms on Solana) | | **Complexity** | Requires manual coordination of steps | Fully automated | Manual looping exposes you to market price movements between transactions. If the collateral asset price drops or borrow rates spike mid-loop, you may end up with a worse position than intended — or fail to complete the loop entirely. * * * [​](https://kamino.com/docs/build/developers/multiply/overview#the-multiply-transaction-flow) The Multiply Transaction Flow ------------------------------------------------------------------------------------------------------------------------------ Multiply executes leverage creation in a precise sequence of steps within a single atomic transaction. 1 Flash Borrow Protocol borrows the required debt token amount (e.g., SOL) via flash loan. No collateral is required. 2 Swap to Collateral Flash-borrowed funds are swapped into the target collateral asset (e.g., SOL → JitoSOL) using Kamino Swap (KSwap) with multi-DEX routing for optimal execution. 3 Deposit Collateral The full collateral amount (user deposit + swapped amount) is deposited into Kamino Lend as collateral. 4 Borrow Against Collateral With collateral deposited, the protocol borrows the debt token against the collateral position. 5 Repay Flash Loan Borrowed funds are used to repay the flash loan plus the 0.001% fee. 6 Position Established Net result: Leveraged position with amplified collateral exposure and outstanding debt balance recorded on Kamino Lend. All steps execute in a single transaction. If any step fails (slippage exceeds tolerance, insufficient liquidity, etc.), the entire transaction reverts and no position is created. * * * [​](https://kamino.com/docs/build/developers/multiply/overview#emode-elevation-mode) eMode (Elevation Mode) -------------------------------------------------------------------------------------------------------------- eMode enables significantly higher leverage for correlated asset pairs by raising the maximum permitted LTV ratio. ### [​](https://kamino.com/docs/build/developers/multiply/overview#how-emode-works) How eMode Works Standard lending markets limit LTV to protect against price divergence between collateral and debt. When both assets are highly correlated (e.g., JitoSOL and SOL), price divergence risk is minimal — both assets move together. eMode reflects this reduced risk by permitting higher LTV ratios. ### [​](https://kamino.com/docs/build/developers/multiply/overview#emode-leverage-comparison) eMode Leverage Comparison | Mode | Asset Pair | Max LTV | Max Leverage | Use Case | | --- | --- | --- | --- | --- | | **Standard** | SOL / USDC | 75% | 4x | Uncorrelated assets | | **eMode (Main)** | mSOL, bSOL, JupSOL / SOL | ~87% | ~7.7x | Correlated LST/SOL pairs | | **eMode (Jito)** | JitoSOL / SOL | 90% | 10x | JitoSOL-specific correlation | | **No eMode** | JLP / USDC | 67% | ~3.2x | Uncorrelated (JLP is basket of assets) | Higher LTV from eMode means a smaller buffer between your operating LTV and liquidation threshold. Operating near maximum eMode leverage requires continuous monitoring of the yield spread (collateral yield minus borrow rate). ### [​](https://kamino.com/docs/build/developers/multiply/overview#why-correlation-matters) Why Correlation Matters **Correlated pairs (LST/SOL)**: When SOL price moves, both JitoSOL and SOL debt move proportionally. Your LTV ratio stays relatively stable regardless of SOL’s USD price. **Uncorrelated pairs (JLP/USDC)**: JLP value fluctuates with crypto markets while USDC stays flat. Price drops in SOL/ETH/BTC directly increase your LTV, creating liquidation risk independent of borrow rates. Assistant Responses are generated using AI and may contain mistakes. --- # Withdraw - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/rewards/operations/withdraw-unstaked#content-area) [​](https://kamino.com/docs/build/developers/rewards/operations/withdraw-unstaked#withdraw) Withdraw ------------------------------------------------------------------------------------------------------- The second half of unwinding a position. After you [unstake](https://kamino.com/docs/build/developers/rewards/operations/unstake) and the farm’s withdrawal cooldown elapses, the stake sits as pending withdrawal. This moves those tokens out of the farm vault back to your token account. This flow requires a non-delegated farm, since the instruction needs the stake token mint. No Scope prices or refresh are needed here, because it moves already-unstaked tokens and does not touch reward accounting. The instruction only succeeds on-chain once the withdrawal cooldown has elapsed; if there is nothing past cooldown, it fails. 1 ### [​](https://kamino.com/docs/build/developers/rewards/operations/withdraw-unstaked#import-dependencies) Import Dependencies Import the packages for Solana RPC communication, Kit transaction building, the keypair loader, and the Farms SDK. import { createSolanaRpc, createSolanaRpcSubscriptions, address, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, getSignatureFromTransaction, assertIsTransactionWithinSizeLimit, sendAndConfirmTransactionFactory, } from "@solana/kit"; import { parseKeypairFile } from "@kamino-finance/klend-sdk/dist/utils/signer"; import { Farms } from "@kamino-finance/farms-sdk"; 2 ### [​](https://kamino.com/docs/build/developers/rewards/operations/withdraw-unstaked#configure-constants-and-initialize) Configure Constants and Initialize Set the keypair path, RPC endpoints, target farm, and stake token mint. Load the signer and initialize the farms client. const KEYPAIR_FILE = "/path/to/your/keypair.json"; const RPC_ENDPOINT = "https://api.mainnet-beta.solana.com"; const WS_ENDPOINT = "wss://api.mainnet-beta.solana.com"; const FARM = address("DXGwU8Ah7v6TBcc9ZjVmFxiLCMPgrxnsj4ZF7F8sWFxi"); // non-delegated farm const STAKE_MINT = address("AYUjc3a3QQUiLE6jP7V29UMeUZGADdtiVxhSjoLcqYwr"); // the farm's stake token const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc(RPC_ENDPOINT); const rpcSubscriptions = createSolanaRpcSubscriptions(WS_ENDPOINT); const farms = new Farms(rpc); 3 ### [​](https://kamino.com/docs/build/developers/rewards/operations/withdraw-unstaked#build-withdraw-instruction) Build Withdraw Instruction Resolve the user-state key, then build the withdraw-unstaked instruction. The third argument is the farm address. const { key: userState } = await farms.getUserStateKeyForUndelegatedFarm( signer.address, FARM, ); const instructions = [\ await farms.withdrawUnstakedDepositIx(signer, userState, FARM, STAKE_MINT),\ ]; 4 ### [​](https://kamino.com/docs/build/developers/rewards/operations/withdraw-unstaked#build-sign-and-send-transaction) Build, Sign, and Send Transaction Compose the v0 transaction, sign, verify it fits the size limit, then send and confirm. const { value: blockhash } = await rpc .getLatestBlockhash({ commitment: "finalized" }) .send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayerSigner(signer, m), (m) => setTransactionMessageLifetimeUsingBlockhash(blockhash, m), (m) => appendTransactionMessageInstructions(instructions, m), ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); assertIsTransactionWithinSizeLimit(signedTransaction); const signature = getSignatureFromTransaction(signedTransaction); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: "confirmed", skipPreflight: true, }); console.log("Withdraw-unstaked successful! Signature:", signature); The withdrawal is complete. Your unstaked tokens have been transferred back to your wallet. #### [​](https://kamino.com/docs/build/developers/rewards/operations/withdraw-unstaked#full-code-example) Full Code Example import { createSolanaRpc, createSolanaRpcSubscriptions, address, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, getSignatureFromTransaction, assertIsTransactionWithinSizeLimit, sendAndConfirmTransactionFactory, } from "@solana/kit"; import { parseKeypairFile } from "@kamino-finance/klend-sdk/dist/utils/signer"; import { Farms } from "@kamino-finance/farms-sdk"; const KEYPAIR_FILE = "/path/to/your/keypair.json"; const RPC_ENDPOINT = "https://api.mainnet-beta.solana.com"; const WS_ENDPOINT = "wss://api.mainnet-beta.solana.com"; const FARM = address("DXGwU8Ah7v6TBcc9ZjVmFxiLCMPgrxnsj4ZF7F8sWFxi"); const STAKE_MINT = address("AYUjc3a3QQUiLE6jP7V29UMeUZGADdtiVxhSjoLcqYwr"); const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc(RPC_ENDPOINT); const rpcSubscriptions = createSolanaRpcSubscriptions(WS_ENDPOINT); const farms = new Farms(rpc); const { key: userState } = await farms.getUserStateKeyForUndelegatedFarm( signer.address, FARM, ); const instructions = [\ await farms.withdrawUnstakedDepositIx(signer, userState, FARM, STAKE_MINT),\ ]; const { value: blockhash } = await rpc .getLatestBlockhash({ commitment: "finalized" }) .send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), (m) => setTransactionMessageFeePayerSigner(signer, m), (m) => setTransactionMessageLifetimeUsingBlockhash(blockhash, m), (m) => appendTransactionMessageInstructions(instructions, m), ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); assertIsTransactionWithinSizeLimit(signedTransaction); const signature = getSignatureFromTransaction(signedTransaction); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: "confirmed", skipPreflight: true, }); console.log("Withdraw-unstaked successful! Signature:", signature); See all 59 lines Assistant Responses are generated using AI and may contain mistakes. --- # Get token price history - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/oracle/token-prices-history#content-area) Get token price history cURL curl --request GET \ --url https://api.kamino.finance/prices/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/prices/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/prices/history" response = requests.get(url) print(response.text) false 200 400 500 [\ [\ "0.99978779",\ 1780272000\ ]\ ] { "error": "Token query parameter missing", "details": [\ {}\ ] } { "error": "An internal error occurred" } GET / prices / history Try it Get token price history cURL curl --request GET \ --url https://api.kamino.finance/prices/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/prices/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/prices/history" response = requests.get(url) print(response.text) false 200 400 500 [\ [\ "0.99978779",\ 1780272000\ ]\ ] { "error": "Token query parameter missing", "details": [\ {}\ ] } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/oracle/token-prices-history#parameter-token) token string required Token identifier. Accepts either the token mint address or its symbol (for example `USDC`). Example: `"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"` [​](https://kamino.com/docs/build/api-reference/oracle/token-prices-history#parameter-frequency) frequency enum Sampling interval for the returned series. One of `minute`, `hour`, or `day`. If omitted, raw price ticks are returned. Available options: `minute`, `hour`, `day` Example: `"day"` [​](https://kamino.com/docs/build/api-reference/oracle/token-prices-history#parameter-start) start string Start of the time range, as an ISO 8601 timestamp. Example: `"2026-06-01T00:00:00Z"` [​](https://kamino.com/docs/build/api-reference/oracle/token-prices-history#parameter-end) end string End of the time range, as an ISO 8601 timestamp. Example: `"2026-06-10T00:00:00Z"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/oracle/token-prices-history#response-items-0) \[0\] string Token price in USD Example: `"0.99978779"` [​](https://kamino.com/docs/build/api-reference/oracle/token-prices-history#response-items-1) \[1\] integer Unix timestamp in seconds Example: `1780272000` Assistant Responses are generated using AI and may contain mistakes. --- # Get private credit metrics - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/private-credit/get-private-credit-metrics#content-area) Get private credit metrics cURL curl --request GET \ --url https://api.kamino.finance/kvaults/private-credit/metrics const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/private-credit/metrics', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/private-credit/metrics" response = requests.get(url) print(response.text) false 200 400 404 500 { "metrics": { "activeLoans": "1234.56789", "totalBorrowedUsd": "1234.56789", "totalDepositedUsd": "1234.56789", "weightedAvgLtv": "1234.56789", "avgLtv": "1234.56789", "maxLtv": "1234.56789", "updatedOn": "2025-03-01T12:00:00.000Z" }, "loans": [\ {\ "totalBorrowedUsd": "1234.56789",\ "totalDepositedUsd": "1234.56789",\ "ltv": "1234.56789",\ "createdOn": "2025-03-01T12:00:00.000Z",\ "collateralAsset": "",\ "maxLtv": "1234.56789",\ "liquidationStatus": ""\ }\ ] } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } GET / kvaults / private-credit / metrics Try it Get private credit metrics cURL curl --request GET \ --url https://api.kamino.finance/kvaults/private-credit/metrics const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/private-credit/metrics', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/private-credit/metrics" response = requests.get(url) print(response.text) false 200 400 404 500 { "metrics": { "activeLoans": "1234.56789", "totalBorrowedUsd": "1234.56789", "totalDepositedUsd": "1234.56789", "weightedAvgLtv": "1234.56789", "avgLtv": "1234.56789", "maxLtv": "1234.56789", "updatedOn": "2025-03-01T12:00:00.000Z" }, "loans": [\ {\ "totalBorrowedUsd": "1234.56789",\ "totalDepositedUsd": "1234.56789",\ "ltv": "1234.56789",\ "createdOn": "2025-03-01T12:00:00.000Z",\ "collateralAsset": "",\ "maxLtv": "1234.56789",\ "liquidationStatus": ""\ }\ ] } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/private-credit/get-private-credit-metrics#parameter-kvault) kvault string Valid base58-encoded address Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/private-credit/get-private-credit-metrics#response-metrics) metrics object required Show child attributes [​](https://kamino.com/docs/build/private-credit/get-private-credit-metrics#response-loans) loans object\[\] required Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Get private credit metrics history - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/private-credit/get-private-credit-metrics-history#content-area) Get private credit metrics history cURL curl --request GET \ --url https://api.kamino.finance/kvaults/private-credit/metrics/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/private-credit/metrics/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/private-credit/metrics/history" response = requests.get(url) print(response.text) false 200 400 404 500 [\ {\ "createdOn": "2025-03-01T12:00:00.000Z",\ "weightedAvgLtv": "1234.56789",\ "maxLtv": "1234.56789",\ "statusDistribution": [\ {\ "status": "",\ "share": "1234.56789"\ }\ ]\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } GET / kvaults / private-credit / metrics / history Try it Get private credit metrics history cURL curl --request GET \ --url https://api.kamino.finance/kvaults/private-credit/metrics/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/private-credit/metrics/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/private-credit/metrics/history" response = requests.get(url) print(response.text) false 200 400 404 500 [\ {\ "createdOn": "2025-03-01T12:00:00.000Z",\ "weightedAvgLtv": "1234.56789",\ "maxLtv": "1234.56789",\ "statusDistribution": [\ {\ "status": "",\ "share": "1234.56789"\ }\ ]\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/private-credit/get-private-credit-metrics-history#parameter-one-of-0) start stringnumberstringnumber default:1970-01-01T00:00:00.000Z Start date of the range (defaults to Unix epoch). Accepts ISO string or epoch in ms. Example: `"1970-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/private-credit/get-private-credit-metrics-history#parameter-one-of-0) end stringnumberstringnumber End date of the range (defaults to current time). Accepts ISO string or epoch in ms. Example: `"2025-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/private-credit/get-private-credit-metrics-history#parameter-kvault) kvault string Valid base58-encoded address Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/private-credit/get-private-credit-metrics-history#response-items-created-on) createdOn string required Timestamp when the snapshot was created (ISO 8601 format) Example: `"2025-03-01T12:00:00.000Z"` [​](https://kamino.com/docs/build/private-credit/get-private-credit-metrics-history#response-items-weighted-avg-ltv) weightedAvgLtv string required Decimal value represented as string Example: `"1234.56789"` [​](https://kamino.com/docs/build/private-credit/get-private-credit-metrics-history#response-items-max-ltv) maxLtv string required Decimal value represented as string Example: `"1234.56789"` [​](https://kamino.com/docs/build/private-credit/get-private-credit-metrics-history#response-items-status-distribution) statusDistribution object\[\] required Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Get a wallet earn summary - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/earn/get-a-wallet-earn-summary#content-area) Get a wallet earn summary cURL curl --request GET \ --url https://api.kamino.finance/v3/earn/users/{userPubkey}/summary const options = {method: 'GET'}; fetch('https://api.kamino.finance/v3/earn/users/{userPubkey}/summary', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v3/earn/users/{userPubkey}/summary" response = requests.get(url) print(response.text) false 200 400 500 { "totalUsd": "1234.56789", "earningUsd": "1234.56789", "idleUsd": "1234.56789", "blendedApy": "0.2", "earnedToDateUsd": "1234.56789", "interestEarnedPerSecondUsd": "1234.56789", "tokens": [\ {\ "mint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "symbol": "",\ "decimals": 1,\ "totalUsd": "1234.56789",\ "earningUsd": "1234.56789",\ "idleUsd": "1234.56789",\ "tokenAmounts": {\ "earning": "1234.56789",\ "idle": "1234.56789"\ },\ "blendedApy": "0.2",\ "bestApy": "0.2",\ "bestApyVault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "earnedToDateUsd": "1234.56789",\ "positions": [\ {\ "tokenAmount": "1234.56789",\ "usd": "1234.56789",\ "apy": "0.2",\ "earnedToDateUsd": "1234.56789",\ "shareOfToken": "1234.56789",\ "type": "vault",\ "vault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "name": ""\ }\ ]\ }\ ] } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / v3 / earn / users / {userPubkey} / summary Try it Get a wallet earn summary cURL curl --request GET \ --url https://api.kamino.finance/v3/earn/users/{userPubkey}/summary const options = {method: 'GET'}; fetch('https://api.kamino.finance/v3/earn/users/{userPubkey}/summary', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v3/earn/users/{userPubkey}/summary" response = requests.get(url) print(response.text) false 200 400 500 { "totalUsd": "1234.56789", "earningUsd": "1234.56789", "idleUsd": "1234.56789", "blendedApy": "0.2", "earnedToDateUsd": "1234.56789", "interestEarnedPerSecondUsd": "1234.56789", "tokens": [\ {\ "mint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "symbol": "",\ "decimals": 1,\ "totalUsd": "1234.56789",\ "earningUsd": "1234.56789",\ "idleUsd": "1234.56789",\ "tokenAmounts": {\ "earning": "1234.56789",\ "idle": "1234.56789"\ },\ "blendedApy": "0.2",\ "bestApy": "0.2",\ "bestApyVault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "earnedToDateUsd": "1234.56789",\ "positions": [\ {\ "tokenAmount": "1234.56789",\ "usd": "1234.56789",\ "apy": "0.2",\ "earnedToDateUsd": "1234.56789",\ "shareOfToken": "1234.56789",\ "type": "vault",\ "vault": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "name": ""\ }\ ]\ }\ ] } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/earn/get-a-wallet-earn-summary#parameter-user-pubkey) userPubkey string required User wallet address Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Query Parameters [​](https://kamino.com/docs/build/earn/get-a-wallet-earn-summary#parameter-program-id) programId string default:KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD KLend program ID Example: `"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/earn/get-a-wallet-earn-summary#response-total-usd) totalUsd string required Known earning and idle USD value across all tokens Example: `"1234.56789"` [​](https://kamino.com/docs/build/earn/get-a-wallet-earn-summary#response-earning-usd) earningUsd string required Known USD value in earning positions Example: `"1234.56789"` [​](https://kamino.com/docs/build/earn/get-a-wallet-earn-summary#response-idle-usd) idleUsd string required Known USD value held idle Example: `"1234.56789"` [​](https://kamino.com/docs/build/earn/get-a-wallet-earn-summary#response-blended-apy) blendedApy string required USD-weighted APY across all earning positions Example: `"0.2"` [​](https://kamino.com/docs/build/earn/get-a-wallet-earn-summary#response-earned-to-date-usd) earnedToDateUsd string required Lifetime vault and lending interest earned in USD Example: `"1234.56789"` [​](https://kamino.com/docs/build/earn/get-a-wallet-earn-summary#response-interest-earned-per-second-usd) interestEarnedPerSecondUsd string required Current estimated interest earned per second in USD Example: `"1234.56789"` [​](https://kamino.com/docs/build/earn/get-a-wallet-earn-summary#response-tokens) tokens object\[\] required Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Get instructions to deposit into a kvault - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-earn-deposit/get-instructions-to-deposit-into-a-kvault#content-area) Get instructions to deposit into a kvault cURL curl --request POST \ --url https://api.kamino.finance/ktx/kvault/deposit-instructions \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', kvault: 'HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/kvault/deposit-instructions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/kvault/deposit-instructions" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "instructions": [\ {\ "accounts": [\ {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT",\ "role": "WRITABLE_SIGNER",\ "signer": {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT"\ }\ }\ ],\ "data": "8iPGiVLh8rYA4fUFAAAAAA==",\ "programAddress": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd"\ }\ ], "lutsByAddress": { "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [\ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH",\ "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E",\ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"\ ] } } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } POST / ktx / kvault / deposit-instructions Try it Get instructions to deposit into a kvault cURL curl --request POST \ --url https://api.kamino.finance/ktx/kvault/deposit-instructions \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', kvault: 'HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/kvault/deposit-instructions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/kvault/deposit-instructions" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "kvault": "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "instructions": [\ {\ "accounts": [\ {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT",\ "role": "WRITABLE_SIGNER",\ "signer": {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT"\ }\ }\ ],\ "data": "8iPGiVLh8rYA4fUFAAAAAA==",\ "programAddress": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd"\ }\ ], "lutsByAddress": { "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [\ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH",\ "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E",\ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"\ ] } } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } #### Body application/json [​](https://kamino.com/docs/build/kamino-earn-deposit/get-instructions-to-deposit-into-a-kvault#body-wallet) wallet string required User wallet address (base58) that will also sign the transaction Required string length: `32 - 44` Example: `"KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9"` [​](https://kamino.com/docs/build/kamino-earn-deposit/get-instructions-to-deposit-into-a-kvault#body-kvault) kvault string required Target Kamino vault address Required string length: `32 - 44` Example: `"HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E"` [​](https://kamino.com/docs/build/kamino-earn-deposit/get-instructions-to-deposit-into-a-kvault#body-amount) amount string required Amount to deposit (in decimal format, not lamports) Example: `"0.1234"` [​](https://kamino.com/docs/build/kamino-earn-deposit/get-instructions-to-deposit-into-a-kvault#body-memo) memo string Memo to include with the deposit transaction (maximum 64 UTF-8 bytes) Required string length: `1 - 64` #### Response 200 application/json Default Response [​](https://kamino.com/docs/build/kamino-earn-deposit/get-instructions-to-deposit-into-a-kvault#response-instructions) instructions object\[\] required Show child attributes [​](https://kamino.com/docs/build/kamino-earn-deposit/get-instructions-to-deposit-into-a-kvault#response-luts-by-address) lutsByAddress object required Show child attributes Example: `{ "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH", "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" ] }` Assistant Responses are generated using AI and may contain mistakes. --- # Get instructions to repay debt of a klend reserve - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-lend-repay/get-instructions-to-repay-debt-of-a-klend-reserve#content-area) Get instructions to repay debt of a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/repay-instructions \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/repay-instructions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/repay-instructions" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "instructions": [\ {\ "accounts": [\ {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT",\ "role": "WRITABLE_SIGNER",\ "signer": {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT"\ }\ }\ ],\ "data": "8iPGiVLh8rYA4fUFAAAAAA==",\ "programAddress": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd"\ }\ ], "lutsByAddress": { "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [\ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH",\ "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E",\ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"\ ] } } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } POST / ktx / klend / repay-instructions Try it Get instructions to repay debt of a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/repay-instructions \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/repay-instructions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/repay-instructions" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "instructions": [\ {\ "accounts": [\ {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT",\ "role": "WRITABLE_SIGNER",\ "signer": {\ "address": "9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT"\ }\ }\ ],\ "data": "8iPGiVLh8rYA4fUFAAAAAA==",\ "programAddress": "KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd"\ }\ ], "lutsByAddress": { "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [\ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH",\ "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E",\ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"\ ] } } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } #### Body application/json [​](https://kamino.com/docs/build/kamino-lend-repay/get-instructions-to-repay-debt-of-a-klend-reserve#body-wallet) wallet string required User wallet address (base58) that will also sign the transaction Required string length: `32 - 44` Example: `"KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9"` [​](https://kamino.com/docs/build/kamino-lend-repay/get-instructions-to-repay-debt-of-a-klend-reserve#body-market) market string required Target Kamino Lend market address Required string length: `32 - 44` Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/kamino-lend-repay/get-instructions-to-repay-debt-of-a-klend-reserve#body-reserve) reserve string required Target Kamino Lend Reserve address. The reserve must belong to the specified market Required string length: `32 - 44` Example: `"D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59"` [​](https://kamino.com/docs/build/kamino-lend-repay/get-instructions-to-repay-debt-of-a-klend-reserve#body-amount) amount string required Amount of debt to repay (in decimal format, not lamports) Example: `"0.1234"` #### Response 200 application/json Default Response [​](https://kamino.com/docs/build/kamino-lend-repay/get-instructions-to-repay-debt-of-a-klend-reserve#response-instructions) instructions object\[\] required Show child attributes [​](https://kamino.com/docs/build/kamino-lend-repay/get-instructions-to-repay-debt-of-a-klend-reserve#response-luts-by-address) lutsByAddress object required Show child attributes Example: `{ "9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu": [ "sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH", "HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" ] }` Assistant Responses are generated using AI and may contain mistakes. --- # Get transaction to repay debt of a klend reserve - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-lend-repay/get-transaction-to-repay-debt-of-a-klend-reserve#content-area) Get transaction to repay debt of a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/repay \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/repay', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/repay" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } POST / ktx / klend / repay Try it Get transaction to repay debt of a klend reserve cURL curl --request POST \ --url https://api.kamino.finance/ktx/klend/repay \ --header 'Content-Type: application/json' \ --data ' { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } ' const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ wallet: 'KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9', market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59', amount: '0.1234' }) }; fetch('https://api.kamino.finance/ktx/klend/repay', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/ktx/klend/repay" payload = { "wallet": "KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9", "market": "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF", "reserve": "D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59", "amount": "0.1234" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) false 200 400 { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=" } { "statusCode": 400, "message": "", "error": "Bad Request", "code": "DECIMAL_TO_LAMPORTS_OVERFLOW" } #### Body application/json [​](https://kamino.com/docs/build/kamino-lend-repay/get-transaction-to-repay-debt-of-a-klend-reserve#body-wallet) wallet string required User wallet address (base58) that will also sign the transaction Required string length: `32 - 44` Example: `"KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9"` [​](https://kamino.com/docs/build/kamino-lend-repay/get-transaction-to-repay-debt-of-a-klend-reserve#body-market) market string required Target Kamino Lend market address Required string length: `32 - 44` Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/kamino-lend-repay/get-transaction-to-repay-debt-of-a-klend-reserve#body-reserve) reserve string required Target Kamino Lend Reserve address. The reserve must belong to the specified market Required string length: `32 - 44` Example: `"D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59"` [​](https://kamino.com/docs/build/kamino-lend-repay/get-transaction-to-repay-debt-of-a-klend-reserve#body-amount) amount string required Amount of debt to repay (in decimal format, not lamports) Example: `"0.1234"` #### Response 200 application/json Default Response [​](https://kamino.com/docs/build/kamino-lend-repay/get-transaction-to-repay-debt-of-a-klend-reserve#response-transaction) transaction string required Encoded transaction ready to send Example: `"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM="` Assistant Responses are generated using AI and may contain mistakes. --- # Get user KLend rewards - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/user-rewards#content-area) Get user KLend rewards cURL curl --request GET \ --url https://api.kamino.finance/klend/users/{pubkey}/rewards const options = {method: 'GET'}; fetch('https://api.kamino.finance/klend/users/{pubkey}/rewards', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/klend/users/{pubkey}/rewards" response = requests.get(url) print(response.text) false 200 400 500 { "avgBaseApy": "0.2", "avgBoostedApy": "0.2", "avgMaxApy": "0.2", "rewards": [\ {\ "depositReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "borrowReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "market": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "lastCalculated": "2023-12-25",\ "tokensEarned": "1234.56789",\ "tokensPerSecond": "1234.56789",\ "stakingBoost": "1234.56789",\ "effectiveStakingBoost": "1234.56789",\ "baseApy": "0.2",\ "boostedApy": "0.2",\ "maxApy": "0.2",\ "usdAmount": "1234.56789",\ "usdAmountBoosted": "1234.56789"\ }\ ] } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / klend / users / {pubkey} / rewards Try it Get user KLend rewards cURL curl --request GET \ --url https://api.kamino.finance/klend/users/{pubkey}/rewards const options = {method: 'GET'}; fetch('https://api.kamino.finance/klend/users/{pubkey}/rewards', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/klend/users/{pubkey}/rewards" response = requests.get(url) print(response.text) false 200 400 500 { "avgBaseApy": "0.2", "avgBoostedApy": "0.2", "avgMaxApy": "0.2", "rewards": [\ {\ "depositReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "borrowReserve": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "market": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardMint": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "lastCalculated": "2023-12-25",\ "tokensEarned": "1234.56789",\ "tokensPerSecond": "1234.56789",\ "stakingBoost": "1234.56789",\ "effectiveStakingBoost": "1234.56789",\ "baseApy": "0.2",\ "boostedApy": "0.2",\ "maxApy": "0.2",\ "usdAmount": "1234.56789",\ "usdAmountBoosted": "1234.56789"\ }\ ] } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/user-rewards#parameter-pubkey) pubkey string required Valid base58-encoded address Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/user-rewards#parameter-source) source string Points source identifier Examples: `"Season1"` `"Season2"` `"Season3"` `"Season4"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/user-rewards#response-avg-base-apy) avgBaseApy string required Weighted average Base Annual Percentage Yield for the user Example: `"0.2"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/user-rewards#response-avg-boosted-apy) avgBoostedApy string required Weighted average Boosted Annual Percentage Yield for the user Example: `"0.2"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/user-rewards#response-avg-max-apy) avgMaxApy string required Weighted average Max Annual Percentage Yield for the user Example: `"0.2"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/user-rewards#response-rewards) rewards object\[\] required List of klend user reward metrics Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Get all user obligations - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/user-obligations#content-area) Get all user obligations cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations" response = requests.get(url) print(response.text) false 500 503 { "error": "An internal error occurred" } { "error": "" } GET / kamino-market / {marketPubkey} / users / {userPubkey} / obligations Try it Get all user obligations cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations" response = requests.get(url) print(response.text) false 500 503 { "error": "An internal error occurred" } { "error": "" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/user-obligations#parameter-market-pubkey) marketPubkey string required Kamino Lend market public key Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/user-obligations#parameter-user-pubkey) userPubkey string required User wallet public key Example: `"AcNSmd5CxwLs21TYUmhWt7CW2v159TdYRkvQxb1iBYRj"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/borrow/user-and-loans-data/user-obligations#parameter-env) env enum default:mainnet-beta Solana cluster environment Available options: `mainnet-beta`, `devnet`, `localnet` Example: `"mainnet-beta"` #### Response 200 application/json OK Assistant Responses are generated using AI and may contain mistakes. --- # Get historical KVault allocation volume - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/earn/vault-data/vault-allocation-history#content-area) Get historical KVault allocation volume cURL curl --request GET \ --url https://api.kamino.finance/kvaults/vaults/{pubkey}/allocation-volume/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/vaults/{pubkey}/allocation-volume/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/vaults/{pubkey}/allocation-volume/history" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "timestamp": "2023-12-25",\ "volumeUsd": "1234.56789"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / kvaults / vaults / {pubkey} / allocation-volume / history Try it Get historical KVault allocation volume cURL curl --request GET \ --url https://api.kamino.finance/kvaults/vaults/{pubkey}/allocation-volume/history const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/vaults/{pubkey}/allocation-volume/history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/vaults/{pubkey}/allocation-volume/history" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "timestamp": "2023-12-25",\ "volumeUsd": "1234.56789"\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vault-allocation-history#parameter-pubkey) pubkey string required Valid base58-encoded address Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Query Parameters [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vault-allocation-history#parameter-one-of-0) start stringnumberstringnumber Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vault-allocation-history#parameter-one-of-0) end stringnumberstringnumber Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vault-allocation-history#response-items-timestamp) timestamp string required Timestamp of the investment volume data point [​](https://kamino.com/docs/build/api-reference/earn/vault-data/vault-allocation-history#response-items-volume-usd) volumeUsd string required Investment volume in USD Example: `"1234.56789"` Assistant Responses are generated using AI and may contain mistakes. --- # Earn Withdraw with the API - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-api#content-area) [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-api#earn-withdraw-with-api) Earn Withdraw with API ---------------------------------------------------------------------------------------------------------------------- 1 ### [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-api#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, transaction handling, and Kamino SDK utilities. import { createSolanaRpc, createSolanaRpcSubscriptions, pipe, getTransactionDecoder, getCompiledTransactionMessageDecoder, decompileTransactionMessageFetchingLookupTables, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, addSignersToTransactionMessage, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { parseKeypairFile } from '@kamino-finance/klend-sdk/dist/utils/signer.js'; 2 ### [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-api#configure-and-initialize) Configure and Initialize Set up the configuration and initialize RPC connections. const KEYPAIR_FILE = '/path/to/your/keypair.json'; const API_BASE_URL = 'https://api.kamino.finance'; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const rpcSubscriptions = createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com'); 3 ### [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-api#call-kamino-api) Call Kamino API Make a POST request to the Kamino API to build the withdrawal transaction. const response = await fetch(`${API_BASE_URL}/ktx/kvault/withdraw`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ wallet: signer.address, kvault: 'HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E', amount: '1.0', }), }); if (!response.ok) { const error = await response.json(); throw new Error(`API error: ${error.message}`); } const { transaction: encodedTransaction } = await response.json(); The API returns a pre-built transaction encoded in base64 format. This transaction includes Address Lookup Tables (ALTs) for efficiency. 4 ### [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-api#decode-transaction) Decode Transaction Decode the base64-encoded transaction and extract the message bytes. const txBuffer = Buffer.from(encodedTransaction, 'base64'); const txMessageBytes = getTransactionDecoder().decode(txBuffer).messageBytes; const compiledMessage = getCompiledTransactionMessageDecoder().decode(txMessageBytes); 5 ### [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-api#resolve-address-lookup-tables) Resolve Address Lookup Tables Fetch and resolve the Address Lookup Tables from the blockchain. const { value: latestBlockhash } = await rpc.getLatestBlockhash({ commitment: 'finalized' }).send(); const signedTransaction = await pipe( await decompileTransactionMessageFetchingLookupTables(compiledMessage, rpc), (tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), (tx) => setTransactionMessageFeePayerSigner(signer, tx), (tx) => addSignersToTransactionMessage([signer], tx), (tx) => signTransactionMessageWithSigners(tx) ); `decompileTransactionMessageFetchingLookupTables` fetches the lookup table data from the blockchain and resolves all address references. This is required for transactions that use ALTs. A fresh blockhash is fetched and set to ensure the transaction remains valid. 6 ### [​](https://kamino.com/docs/build/recipes/earn/earn-withdraw-via-api#send-and-confirm-transaction) Send and Confirm Transaction Submit the signed transaction to the Solana network. const signature = getSignatureFromTransaction(signedTransaction); console.log(`Sending transaction with signature: ${signature}`); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: 'confirmed', skipPreflight: true, }); console.log('Withdrawal successful! Signature:', signature); Your withdrawal is complete! The API built the transaction, you signed it locally (keeping your keys secure), and it was successfully submitted to the network. Assistant Responses are generated using AI and may contain mistakes. --- # Get Vault APYs - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/recipes/earn/get-vault-apys#content-area) [​](https://kamino.com/docs/build/recipes/earn/get-vault-apys#how-vault-apy-is-calculated) 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 SOL/BTC 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. * API * SDK 1 ### [​](https://kamino.com/docs/build/recipes/earn/get-vault-apys#fetch-all-vaults) 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. 2 ### [​](https://kamino.com/docs/build/recipes/earn/get-vault-apys#get-apy-for-each-vault) 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. 1 ### [​](https://kamino.com/docs/build/recipes/earn/get-vault-apys#import-dependencies) 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'; 2 ### [​](https://kamino.com/docs/build/recipes/earn/get-vault-apys#initialize-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); 3 ### [​](https://kamino.com/docs/build/recipes/earn/get-vault-apys#get-all-vaults) Get All Vaults Retrieve all available vaults using the Kamino Manager. const vaults = await kaminoManager.getAllVaults(); 4 ### [​](https://kamino.com/docs/build/recipes/earn/get-vault-apys#get-apys-for-each-vault) 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. [​](https://kamino.com/docs/build/recipes/earn/get-vault-apys#related-resources) Related Resources ----------------------------------------------------------------------------------------------------- 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 Assistant Responses are generated using AI and may contain mistakes. --- # Borrow with the API - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/recipes/borrow/borrow-via-api#content-area) Borrow assets from a Kamino reserve using the API. The API builds the transaction, and you sign it locally keeping your keys secure. [​](https://kamino.com/docs/build/recipes/borrow/borrow-via-api#borrow-via-the-api) Borrow via the API --------------------------------------------------------------------------------------------------------- 1 ### [​](https://kamino.com/docs/build/recipes/borrow/borrow-via-api#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, transaction handling, and Kamino SDK utilities. import { createSolanaRpc, createSolanaRpcSubscriptions, getTransactionDecoder, getCompiledTransactionMessageDecoder, decompileTransactionMessageFetchingLookupTables, pipe, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, addSignersToTransactionMessage, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { parseKeypairFile } from '@kamino-finance/klend-sdk/dist/utils/signer'; 2 ### [​](https://kamino.com/docs/build/recipes/borrow/borrow-via-api#configure-and-initialize) Configure and Initialize Set up the configuration and initialize RPC connections. const KEYPAIR_FILE = '/path/to/your/keypair.json'; const API_BASE_URL = 'https://api.kamino.finance'; const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com'; const WS_ENDPOINT = 'wss://api.mainnet-beta.solana.com'; const MAIN_MARKET = '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'; const SOL_RESERVE = 'd4A2prbA2whesmvHaL88BH6Ewn5N4bTSU2Ze8P6Bc4Q'; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc(RPC_ENDPOINT); const rpcSubscriptions = createSolanaRpcSubscriptions(WS_ENDPOINT); 3 ### [​](https://kamino.com/docs/build/recipes/borrow/borrow-via-api#call-the-kamino-api) Call the Kamino API Make a POST request to the Kamino API to build the borrow transaction. const res = await fetch(`${API_BASE_URL}/ktx/klend/borrow`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ wallet: signer.address, market: MAIN_MARKET, reserve: SOL_RESERVE, amount: '0.02', }), }); const data = await res.json(); if (!res.ok) { console.error('Response error:', data); } const encodedTransaction = data.transaction; The API returns a pre-built transaction encoded in base64 format ready for signing. 4 ### [​](https://kamino.com/docs/build/recipes/borrow/borrow-via-api#decode-transaction) Decode Transaction Decode the base64-encoded transaction and extract the message bytes. const txBuffer = Buffer.from(encodedTransaction, 'base64'); const txMessageBytes = getTransactionDecoder().decode(txBuffer).messageBytes; const compiledMessage = getCompiledTransactionMessageDecoder().decode(txMessageBytes); 5 ### [​](https://kamino.com/docs/build/recipes/borrow/borrow-via-api#resolve-address-lookup-tables-and-sign) Resolve Address Lookup Tables and Sign Fetch the latest blockhash, decompile the transaction to resolve Address Lookup Tables, and sign. const { value: latestBlockhash } = await rpc.getLatestBlockhash({ commitment: 'finalized' }).send(); const signedTransaction = await pipe( await decompileTransactionMessageFetchingLookupTables(compiledMessage, rpc), tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), tx => setTransactionMessageFeePayerSigner(signer, tx), tx => addSignersToTransactionMessage([signer], tx), tx => signTransactionMessageWithSigners(tx) ); const signature = getSignatureFromTransaction(signedTransaction); `decompileTransactionMessageFetchingLookupTables` fetches the lookup table data from the blockchain and resolves all address references. This is required for transactions that use ALTs. 6 ### [​](https://kamino.com/docs/build/recipes/borrow/borrow-via-api#send-and-confirm-transaction) Send and Confirm Transaction Submit the signed transaction to the Solana network. const sendAndConfirm = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions, }); await sendAndConfirm(signedTransaction, { commitment: 'confirmed', skipPreflight: false, }); console.log('Borrow successful! Signature:', signature); Your borrow is complete! The API built the transaction, you signed it locally (keeping your keys secure), and it was successfully submitted to the network. Assistant Responses are generated using AI and may contain mistakes. --- # Withdraw via the API - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/recipes/borrow/withdraw-via-api#content-area) Withdraw collateral from Kamino reserve using the API. The API builds the transaction, and you sign it locally keeping your keys secure. [​](https://kamino.com/docs/build/recipes/borrow/withdraw-via-api#withdraw-via-the-api) Withdraw via the API --------------------------------------------------------------------------------------------------------------- 1 ### [​](https://kamino.com/docs/build/recipes/borrow/withdraw-via-api#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, transaction handling, and Kamino SDK utilities. import { createSolanaRpc, createSolanaRpcSubscriptions, getTransactionDecoder, getCompiledTransactionMessageDecoder, decompileTransactionMessageFetchingLookupTables, pipe, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, addSignersToTransactionMessage, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { parseKeypairFile } from '@kamino-finance/klend-sdk/dist/utils/signer'; 2 ### [​](https://kamino.com/docs/build/recipes/borrow/withdraw-via-api#configure-and-initialize) Configure and Initialize Set up the configuration and initialize RPC connections. const KEYPAIR_FILE = '/path/to/your/keypair.json'; const API_BASE_URL = 'https://api.kamino.finance'; const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com'; const WS_ENDPOINT = 'wss://api.mainnet-beta.solana.com'; const MAIN_MARKET = '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'; const CASH_RESERVE = 'ApQkX32ULJUzszZDe986aobLDLMNDoGQK8tRm6oD6SsA'; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc(RPC_ENDPOINT); const rpcSubscriptions = createSolanaRpcSubscriptions(WS_ENDPOINT); 3 ### [​](https://kamino.com/docs/build/recipes/borrow/withdraw-via-api#call-the-kamino-api) Call the Kamino API Make a POST request to the Kamino API to build the withdraw transaction. const res = await fetch(`${API_BASE_URL}/ktx/klend/withdraw`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ wallet: signer.address, market: MAIN_MARKET, reserve: CASH_RESERVE, amount: '2.0', }), }); const data = await res.json(); if (!res.ok) { console.error('Response error:', data); } const encodedTransaction = data.transaction; The API returns a pre-built transaction encoded in base64 format ready for signing. 4 ### [​](https://kamino.com/docs/build/recipes/borrow/withdraw-via-api#decode-transaction) Decode Transaction Decode the base64-encoded transaction and extract the message bytes. const txBuffer = Buffer.from(encodedTransaction, 'base64'); const txMessageBytes = getTransactionDecoder().decode(txBuffer).messageBytes; const compiledMessage = getCompiledTransactionMessageDecoder().decode(txMessageBytes); 5 ### [​](https://kamino.com/docs/build/recipes/borrow/withdraw-via-api#resolve-address-lookup-tables-and-sign) Resolve Address Lookup Tables and Sign Fetch the latest blockhash, decompile the transaction to resolve Address Lookup Tables, and sign. const { value: latestBlockhash } = await rpc.getLatestBlockhash({ commitment: 'finalized' }).send(); const signedTransaction = await pipe( await decompileTransactionMessageFetchingLookupTables(compiledMessage, rpc), tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), tx => setTransactionMessageFeePayerSigner(signer, tx), tx => addSignersToTransactionMessage([signer], tx), tx => signTransactionMessageWithSigners(tx) ); const signature = getSignatureFromTransaction(signedTransaction); `decompileTransactionMessageFetchingLookupTables` fetches the lookup table data from the blockchain and resolves all address references. This is required for transactions that use ALTs. 6 ### [​](https://kamino.com/docs/build/recipes/borrow/withdraw-via-api#send-and-confirm-transaction) Send and Confirm Transaction Submit the signed transaction to the Solana network. const sendAndConfirm = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions, }); await sendAndConfirm(signedTransaction, { commitment: 'confirmed', skipPreflight: false, }); console.log('Withdraw successful! Signature:', signature); Your withdrawal is complete! The API built the transaction, you signed it locally (keeping your keys secure), and it was successfully submitted to the network. Assistant Responses are generated using AI and may contain mistakes. --- # Repay with the API - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/recipes/borrow/repay-via-api#content-area) Repay borrowed assets into a Kamino reserve using the API. The API builds the transaction, and you sign it locally keeping your keys secure. [​](https://kamino.com/docs/build/recipes/borrow/repay-via-api#repay-via-the-api) Repay via the API ------------------------------------------------------------------------------------------------------ 1 ### [​](https://kamino.com/docs/build/recipes/borrow/repay-via-api#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, transaction handling, and Kamino SDK utilities. import { createSolanaRpc, createSolanaRpcSubscriptions, getTransactionDecoder, getCompiledTransactionMessageDecoder, decompileTransactionMessageFetchingLookupTables, pipe, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, addSignersToTransactionMessage, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { parseKeypairFile } from '@kamino-finance/klend-sdk'; 2 ### [​](https://kamino.com/docs/build/recipes/borrow/repay-via-api#configure-and-initialize) Configure and Initialize Set up the configuration and initialize RPC connections. const KEYPAIR_FILE = '/path/to/your/keypair.json'; const API_BASE_URL = 'https://api.kamino.finance'; const RPC_ENDPOINT = 'https://api.mainnet-beta.solana.com'; const WS_ENDPOINT = 'wss://api.mainnet-beta.solana.com'; const MAIN_MARKET = '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'; const SOL_RESERVE = 'd4A2prbA2whesmvHaL88BH6Ewn5N4bTSU2Ze8P6Bc4Q'; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc(RPC_ENDPOINT); const rpcSubscriptions = createSolanaRpcSubscriptions(WS_ENDPOINT); 3 ### [​](https://kamino.com/docs/build/recipes/borrow/repay-via-api#call-the-kamino-api) Call the Kamino API Make a POST request to the Kamino API to build the repay transaction. const res = await fetch(`${API_BASE_URL}/ktx/klend/repay`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ wallet: signer.address, market: MAIN_MARKET, reserve: SOL_RESERVE, amount: '0.02', }), }); const data = await res.json(); if (!res.ok) { console.error('Response error:', data); } const encodedTransaction = data.transaction; The API returns a pre-built transaction encoded in base64 format ready for signing. 4 ### [​](https://kamino.com/docs/build/recipes/borrow/repay-via-api#decode-transaction) Decode Transaction Decode the base64-encoded transaction and extract the message bytes. const txBuffer = Buffer.from(encodedTransaction, 'base64'); const txMessageBytes = getTransactionDecoder().decode(txBuffer).messageBytes; const compiledMessage = getCompiledTransactionMessageDecoder().decode(txMessageBytes); 5 ### [​](https://kamino.com/docs/build/recipes/borrow/repay-via-api#resolve-address-lookup-tables-and-sign) Resolve Address Lookup Tables and Sign Fetch the latest blockhash, decompile the transaction to resolve Address Lookup Tables, and sign. const { value: latestBlockhash } = await rpc.getLatestBlockhash({ commitment: 'finalized' }).send(); const signedTransaction = await pipe( await decompileTransactionMessageFetchingLookupTables(compiledMessage, rpc), tx => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), tx => setTransactionMessageFeePayerSigner(signer, tx), tx => addSignersToTransactionMessage([signer], tx), tx => signTransactionMessageWithSigners(tx) ); const signature = getSignatureFromTransaction(signedTransaction); `decompileTransactionMessageFetchingLookupTables` fetches the lookup table data from the blockchain and resolves all address references. This is required for transactions that use ALTs. 6 ### [​](https://kamino.com/docs/build/recipes/borrow/repay-via-api#send-and-confirm-transaction) Send and Confirm Transaction Submit the signed transaction to the Solana network. const sendAndConfirm = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions, }); await sendAndConfirm(signedTransaction, { commitment: 'confirmed', skipPreflight: false, }); console.log('Repay successful! Signature:', signature); Your repayment is complete! The API built the transaction, you signed it locally (keeping your keys secure), and it was successfully submitted to the network. Assistant Responses are generated using AI and may contain mistakes. --- # Monitor Position Health - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/borrow/multiply/monitor-position-health#content-area) 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. ### [​](https://kamino.com/docs/build/borrow/multiply/monitor-position-health#position-health-metrics) Position Health Metrics | Metric | Description | | --- | --- | | **Total Deposit** | The total USD value of all collateral deposited into the position | | **Total Borrow** | The total USD value of debt owed on the position | | **Net Value** | Equity in the position. Calculated as Total Deposit - Total Borrow. Represents the value that would be received if all debt were repaid and collateral withdrawn | | **Leverage** | Capital amplification multiplier. 1x = no leverage (collateral only), 2x = borrowed amount equals deposit, 3x = borrowed twice the deposit amount | | **Borrow Limit** | Maximum borrowing capacity before approaching liquidation threshold. Total Borrow must remain below this value | | **Liquidation LTV** | The 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. * * * [​](https://kamino.com/docs/build/borrow/multiply/monitor-position-health#get-position-health-metrics) Get Position Health Metrics ------------------------------------------------------------------------------------------------------------------------------------- * SDK * API 1 ### [​](https://kamino.com/docs/build/borrow/multiply/monitor-position-health#import-dependencies) 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 ### [​](https://kamino.com/docs/build/borrow/multiply/monitor-position-health#load-market-and-initialize-rpc) 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 ### [​](https://kamino.com/docs/build/borrow/multiply/monitor-position-health#fetch-multiply-obligations) 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:** | Type | Value & Description | | --- | --- | | `ObligationTypeTag.Vanilla` | 0: Cross-collateral mode positions | | `ObligationTypeTag.Multiply` | 1: Leveraged positions created via Multiply | | `ObligationTypeTag.Lending` | 2: Lending-only positions | | `ObligationTypeTag.Leverage` | 3: Legacy leverage positions | 4 ### [​](https://kamino.com/docs/build/borrow/multiply/monitor-position-health#read-position-health-metrics) 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. const walletAddress = 'your-wallet-address-here'; const marketAddress = '5wJeMrUYECGq41fxRESKALVcHnNX26TAWy4W98yULsua'; // xStocks Market const response = await fetch( `https://api.kamino.finance/kamino-market/${marketAddress}/users/${walletAddress}/obligations` ); const data = await response.json(); if (data.length === 0) { console.log('No obligations found.'); } data.forEach((obligation) => { console.log(`\nObligation Address: ${obligation.obligationAddress}`); console.log(`Type: ${obligation.humanTag}`); const stats = obligation.refreshedStats; console.log(`Stats:`); console.log(` Total Deposit: $${parseFloat(stats.userTotalDeposit).toFixed(2)}`); console.log(` Total Borrow: $${parseFloat(stats.userTotalBorrow).toFixed(2)}`); console.log(` Net Value: $${(parseFloat(stats.userTotalDeposit) - parseFloat(stats.userTotalBorrow)).toFixed(2)}`); console.log(` Leverage: ${parseFloat(stats.leverage).toFixed(2)}x`); console.log(` Borrow Limit: $${parseFloat(stats.borrowLimit).toFixed(2)}`); console.log(` Liquidation LTV: ${(parseFloat(stats.liquidationLtv) * 100).toFixed(2)}%`); }); * * * [​](https://kamino.com/docs/build/borrow/multiply/monitor-position-health#liquidation-ltv-by-asset-pair) Liquidation LTV by Asset Pair ----------------------------------------------------------------------------------------------------------------------------------------- | Mode | Asset Pair | Liquidation LTV | Max Leverage | | --- | --- | --- | --- | | **Standard** | SOL / USDC | 75% | 4x | | **Standard** | TSLAx / USDC | 65% | ~2.9x | | **eMode (Main)** | mSOL, bSOL, JupSOL / SOL | ~87% | ~7.7x | | **eMode (Jito)** | JitoSOL / SOL | 90% | 10x | | **No eMode** | JLP / USDC | 67% | ~3.2x | For detailed leverage calculations and eMode mechanics, see [LTV and Leverage Concepts](https://kamino.com/docs/build/developers/multiply/data/concepts) . Assistant Responses are generated using AI and may contain mistakes. --- # Earn Vaults: Deposit and Withdraw - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#content-area) [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#deposit-to-earn-vault) Deposit to Earn Vault ------------------------------------------------------------------------------------------------------------------ Deposit assets to start earning yield. 1 ### [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#import-dependencies) Import Dependencies Import the required packages for Solana RPC communication, Kamino SDK operations, and Kit transaction building. import { createSolanaRpc, createSolanaRpcSubscriptions, address, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { KaminoVault } from '@kamino-finance/klend-sdk'; import { parseKeypairFile } from '@kamino-finance/klend-sdk/dist/utils/signer.js'; import { Decimal } from 'decimal.js'; 2 ### [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#load-signer-and-initialize-vault) Load Signer and Initialize Vault Load your keypair from a file and initialize RPC connections and the vault instance. const KEYPAIR_FILE = '/path/to/your/keypair.json'; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const rpcSubscriptions = createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com'); const vault = new KaminoVault( rpc, address('HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E') ); Replace `/path/to/your/keypair.json` with the actual path to your keypair file. The `rpcSubscriptions` enables real-time transaction confirmation. 3 ### [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#build-deposit-instructions) Build Deposit Instructions Generate deposit instructions for the vault. const depositAmount = new Decimal(1.0); const bundle = await vault.depositIxs(signer, depositAmount); const instructions = [...(bundle.depositIxs || [])]; if (!instructions.length) { throw new Error('No instructions returned by Kamino SDK'); } The `depositIxs` method returns deposit instructions to add your assets to the vault and mint vault shares. 4 ### [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#build-and-sign-transaction) Build and Sign Transaction Use Kit’s functional pipe pattern to build and sign the transaction with a fresh blockhash. const { value: latestBlockhash } = await rpc.getLatestBlockhash().send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), (tx) => setTransactionMessageFeePayerSigner(signer, tx), (tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), (tx) => appendTransactionMessageInstructions(instructions, tx) ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); 5 ### [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#send-and-confirm-transaction) Send and Confirm Transaction Send the deposit transaction and wait for confirmation. const signature = getSignatureFromTransaction(signedTransaction); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: 'confirmed', skipPreflight: true, }); console.log('Deposit successful! Signature:', signature); Once the deposit transaction is confirmed, your assets are deposited into the vault and you start earning yield. Vault shares are minted to represent your position. [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#withdraw-from-earn-vault) Withdraw from Earn Vault ------------------------------------------------------------------------------------------------------------------------ Withdraw your vault shares to receive the underlying tokens plus accrued interest. 1 ### [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#import-dependencies-2) Import Dependencies Import the required packages for Solana RPC communication, Kamino SDK operations, and Kit transaction building. import { createSolanaRpc, createSolanaRpcSubscriptions, address, pipe, createTransactionMessage, setTransactionMessageFeePayerSigner, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, sendAndConfirmTransactionFactory, getSignatureFromTransaction, } from '@solana/kit'; import { KaminoVault } from '@kamino-finance/klend-sdk'; import { parseKeypairFile } from '@kamino-finance/klend-sdk/dist/utils/signer.js'; import { Decimal } from 'decimal.js'; 2 ### [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#load-signer-and-initialize-vault-2) Load Signer and Initialize Vault Load your keypair from a file and initialize RPC connections and the vault instance. const KEYPAIR_FILE = '/path/to/your/keypair.json'; const signer = await parseKeypairFile(KEYPAIR_FILE); const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const rpcSubscriptions = createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com'); const vault = new KaminoVault( rpc, address('HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E') ); Replace `/path/to/your/keypair.json` with the actual path to your keypair file. The `rpcSubscriptions` enables real-time transaction confirmation. 3 ### [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#build-withdraw-instructions) Build Withdraw Instructions Generate withdraw instructions including optional unstaking instructions. const withdrawAmount = new Decimal(1.0); const bundle = await vault.withdrawIxs(signer, withdrawAmount); const instructions = [...(bundle.unstakeFromFarmIfNeededIxs || []), ...(bundle.withdrawIxs || [])]; if (!instructions.length) { throw new Error('No instructions returned by Kamino SDK'); } The `withdrawIxs` method returns both unstaking and withdraw instructions. The amount represents **vault shares** to redeem, not the underlying token amount. 4 ### [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#build-and-sign-transaction-2) Build and Sign Transaction Use Kit’s functional pipe pattern to build and sign the transaction with a fresh blockhash. const { value: latestBlockhash } = await rpc.getLatestBlockhash().send(); const transactionMessage = pipe( createTransactionMessage({ version: 0 }), (tx) => setTransactionMessageFeePayerSigner(signer, tx), (tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx), (tx) => appendTransactionMessageInstructions(instructions, tx) ); const signedTransaction = await signTransactionMessageWithSigners(transactionMessage); 5 ### [​](https://kamino.com/docs/build/earn/tutorials/earn-and-withdraw#send-and-confirm-transaction-2) Send and Confirm Transaction Send the withdraw transaction and wait for confirmation. const signature = getSignatureFromTransaction(signedTransaction); await sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions })(signedTransaction, { commitment: 'confirmed', skipPreflight: true, }); console.log('Withdraw successful! Signature:', signature); Once the withdraw transaction is confirmed, your vault shares are burned and you receive the underlying tokens plus any accrued interest. What Happens When You Deposit? 1. You deposit USDC (or another token) into the vault 2. You receive vault share tokens (like kVUSDC or similar) in your wallet 3. These shares represent your proportional ownership of the vault 4. The shares appreciate in value as the vault earns yield What Happens When You Withdraw? 1. You burn the vault share tokens from your wallet 2. You receive back the underlying tokens (USDC) based on the current exchange rate Assistant Responses are generated using AI and may contain mistakes. --- # Get managed LUTs for multiple products - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/api-reference/luts/managed-batch#content-area) Get managed LUTs for multiple products cURL curl --request GET \ --url https://api.kamino.finance/luts/managed/batch const options = {method: 'GET'}; fetch('https://api.kamino.finance/luts/managed/batch', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/luts/managed/batch" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "productIdentifierAddress": "6KhEbVjFg8bNkpTSyEfGJhMGtv2bRQiAKKbKZLPvrBFm",\ "lutAddresses": [\ "3Kz4sMiBCxg7JdCCjwRTHtFsQRqJCSKh5pVERhPfMzYF"\ ]\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / luts / managed / batch Try it Get managed LUTs for multiple products cURL curl --request GET \ --url https://api.kamino.finance/luts/managed/batch const options = {method: 'GET'}; fetch('https://api.kamino.finance/luts/managed/batch', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/luts/managed/batch" response = requests.get(url) print(response.text) false 200 400 500 [\ {\ "productIdentifierAddress": "6KhEbVjFg8bNkpTSyEfGJhMGtv2bRQiAKKbKZLPvrBFm",\ "lutAddresses": [\ "3Kz4sMiBCxg7JdCCjwRTHtFsQRqJCSKh5pVERhPfMzYF"\ ]\ }\ ] { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Query Parameters [​](https://kamino.com/docs/build/api-reference/luts/managed-batch#parameter-one-of-0) productIdentifierAddress stringstring\[\]stringstring\[\] required One or more product identifier addresses Example: `"6KhEbVjFg8bNkpTSyEfGJhMGtv2bRQiAKKbKZLPvrBFm"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/api-reference/luts/managed-batch#response-items-product-identifier-address) productIdentifierAddress string required The product identifier address Example: `"6KhEbVjFg8bNkpTSyEfGJhMGtv2bRQiAKKbKZLPvrBFm"` [​](https://kamino.com/docs/build/api-reference/luts/managed-batch#response-items-lut-addresses) lutAddresses string\[\] required Active lookup table addresses Valid base58-encoded address Example: `[ "3Kz4sMiBCxg7JdCCjwRTHtFsQRqJCSKh5pVERhPfMzYF" ]` Assistant Responses are generated using AI and may contain mistakes. --- # Farms - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/developers/rewards/overview#content-area) [​](https://kamino.com/docs/build/developers/rewards/overview#overview) Overview ----------------------------------------------------------------------------------- Kamino Farms is the rewards distribution layer for Kamino products. Farms distribute incentive tokens to depositors, suppliers, and borrowers across the protocol, including KMNO emissions on vaults and lending positions. The TypeScript SDK provides access to farm and user state, along with instructions to stake, unstake, and harvest rewards. Farms attached to lending positions and kvaults are **delegated**: position accounting lives in the parent program (klend or kvault), and unstake is a two-step flow gated by a cooldown. Read [Farm rewards](https://kamino.com/docs/curators/vaults/concepts/yield-and-fees#farm-rewards) for the conceptual model before integrating. [​](https://kamino.com/docs/build/developers/rewards/overview#key-components-of-farms-integration) Key Components of Farms Integration ----------------------------------------------------------------------------------------------------------------------------------------- Farm State ---------- Decode a farm’s reward tokens, per-second emission rates, total staked amount, cooldown period, and scope-oracle binding. User Positions -------------- Read a wallet’s stake across one or many farms, pending rewards per reward token, and pending-unstake cooldown status. Stake & Claim ------------- Initialize user state, stake / unstake (with cooldown handling), and harvest accrued rewards in one or all reward tokens. [​](https://kamino.com/docs/build/developers/rewards/overview#locating-a-farm-address) Locating a Farm Address ----------------------------------------------------------------------------------------------------------------- The SDK reads any farm given its pubkey. Three places that pubkey can come from: | Source | Where to look | | --- | --- | | **CDN** | `https://cdn.kamino.finance/resources.json`, under `mainnet-beta.extraFarms`. | | **Klend reserve fields** | A reserve account’s `state.farmCollateral` (supply side) or `state.farmDebt` (borrow side) field. | | **Kvault state** | A kvault account’s `state.vaultFarm` field. List vaults at `https://api.kamino.finance/kvaults/vaults`. | [​](https://kamino.com/docs/build/developers/rewards/overview#integration-options) Integration Options --------------------------------------------------------------------------------------------------------- TypeScript SDK -------------- On-chain reads and transaction building for stake, unstake, harvest, and user-state management. TS/JS only. ### [​](https://kamino.com/docs/build/developers/rewards/overview#stake) Stake * TypeScript import { createSolanaRpc, address } from '@solana/kit'; import { Farms, FarmState } from '@kamino-finance/farms-sdk'; import { getScopePricesFromFarm } from '@kamino-finance/farms-sdk/dist/utils/option'; import Decimal from 'decimal.js'; const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const farms = new Farms(rpc); const FARM = address('9wSacmF3KBr4HmgncxXeBhDdw4Shi2X9ETAFzWJS6pG6'); const STAKE_MINT = address('3EmfhZ3KUaYdwKZ9CwfGoKRqQqUV1MhSCVL5Ch7szX7e'); const farmState = await FarmState.fetch(rpc, FARM); if (!farmState) console.log(`Farm not found: ${FARM}`); const scopePrices = getScopePricesFromFarm(farmState); const amountLamports = new Decimal(0.02).mul( new Decimal(10).pow(farmState.token.decimals.toNumber()), ); // Refresh the farm so reward accounting is current, then stake. const instructions = [\ await farms.refreshFarmIx(FARM, scopePrices),\ await farms.stakeIx(signer, FARM, amountLamports, STAKE_MINT, scopePrices),\ ]; console.log('Stake Instructions:', instructions); [View Code](https://github.com/Kamino-Finance/farms-sdk) For the full stake flow including first-time user-state creation and transaction confirmation, see [Stake](https://kamino.com/docs/build/developers/rewards/operations/stake) . ### [​](https://kamino.com/docs/build/developers/rewards/overview#unstake) Unstake * TypeScript import { createSolanaRpc, address } from '@solana/kit'; import { Farms, FarmState } from '@kamino-finance/farms-sdk'; import { getScopePricesFromFarm } from '@kamino-finance/farms-sdk/dist/utils/option'; import { WAD } from '@kamino-finance/farms-sdk/dist/utils/utils'; import Decimal from 'decimal.js'; const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com'); const farms = new Farms(rpc); const FARM = address('9wSacmF3KBr4HmgncxXeBhDdw4Shi2X9ETAFzWJS6pG6'); const farmState = await FarmState.fetch(rpc, FARM); if (!farmState) console.log(`Farm not found: ${FARM}`); const scopePrices = getScopePricesFromFarm(farmState); const { key: userStateKey } = await farms.getUserStateKeyForUndelegatedFarm(signer.address, FARM); // unstakeIx takes WAD-scaled shares. Refresh the farm and user, then unstake. const amountScaled = new Decimal(0.02) .mul(new Decimal(10).pow(farmState.token.decimals.toNumber())) .mul(WAD); const instructions = [\ await farms.refreshFarmIx(FARM, scopePrices),\ await farms.refreshUserIx(userStateKey, FARM, scopePrices),\ await farms.unstakeIx(signer, FARM, amountScaled, scopePrices),\ ]; console.log('Unstake Instructions:', instructions); [View Code](https://github.com/Kamino-Finance/farms-sdk) Unstaking starts the withdrawal cooldown. After it elapses, withdraw the tokens back to your wallet. See [Unstake](https://kamino.com/docs/build/developers/rewards/operations/unstake) . [​](https://kamino.com/docs/build/developers/rewards/overview#what%E2%80%99s-covered) What’s Covered ------------------------------------------------------------------------------------------------------- Farms ----- Read farm state, discover farms, and compute or simulate incentive APY. User Position Data ------------------ Fetch a wallet’s stake, lockup and cooldown status, and pending rewards. Stake ----- Initialize user state and stake share tokens into a farm. Unstake ------- Unstake into pending withdrawal and start the cooldown. Withdraw -------- Move unstaked tokens back to your wallet after the cooldown. Harvest ------- Claim all pending reward tokens in one transaction. [​](https://kamino.com/docs/build/developers/rewards/overview#relevant-links) Relevant Links ----------------------------------------------------------------------------------------------- Farms SDK repository -------------------- TypeScript SDK source, on-chain program docs, and example scripts. KFarms program -------------- Rust source for the on-chain farms program. NPM SDK package --------------- Install the TypeScript SDK to integrate reward operations. Farm Rewards Concepts --------------------- Vault Farm, Autocompound, Insurance Pool farm, and cooldowns explained. Assistant Responses are generated using AI and may contain mistakes. --- # Get all user obligations - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-lend-user-loans/get-all-user-obligations#content-area) Get all user obligations cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations" response = requests.get(url) print(response.text) false 500 503 { "error": "An internal error occurred" } { "error": "" } GET / kamino-market / {marketPubkey} / users / {userPubkey} / obligations Try it Get all user obligations cURL curl --request GET \ --url https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations const options = {method: 'GET'}; fetch('https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kamino-market/{marketPubkey}/users/{userPubkey}/obligations" response = requests.get(url) print(response.text) false 500 503 { "error": "An internal error occurred" } { "error": "" } #### Path Parameters [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-all-user-obligations#parameter-market-pubkey) marketPubkey string required Kamino Lend market public key Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-all-user-obligations#parameter-user-pubkey) userPubkey string required User wallet public key Example: `"AcNSmd5CxwLs21TYUmhWt7CW2v159TdYRkvQxb1iBYRj"` #### Query Parameters [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-all-user-obligations#parameter-env) env enum default:mainnet-beta Solana cluster environment Available options: `mainnet-beta`, `devnet`, `localnet` Example: `"mainnet-beta"` #### Response 200 application/json OK Assistant Responses are generated using AI and may contain mistakes. --- # Get farm management history - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/farms/get-farm-management-history#content-area) Get farm management history cURL curl --request GET \ --url https://api.kamino.finance/farms/{farmPubkey}/management-history const options = {method: 'GET'}; fetch('https://api.kamino.finance/farms/{farmPubkey}/management-history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/farms/{farmPubkey}/management-history" response = requests.get(url) print(response.text) false 200 400 500 { "result": [\ {\ "createdOn": "2023-12-25",\ "transactionSignature": "2XWcSQVtR4NoHBhzYpDkYkmYtEFkFXC5ZwrKiPok1kvA86GvnN15qP7RNP6eTeNWgJqgnR1GA2M3QPp1hucW7e1v",\ "instruction": "",\ "farm": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "signer": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "tokenAmount": "1234.56789",\ "usdAmount": "1234.56789",\ "token": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardIndex": 123,\ "configMode": "",\ "details": {}\ }\ ], "paginationToken": "" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } GET / farms / {farmPubkey} / management-history Try it Get farm management history cURL curl --request GET \ --url https://api.kamino.finance/farms/{farmPubkey}/management-history const options = {method: 'GET'}; fetch('https://api.kamino.finance/farms/{farmPubkey}/management-history', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/farms/{farmPubkey}/management-history" response = requests.get(url) print(response.text) false 200 400 500 { "result": [\ {\ "createdOn": "2023-12-25",\ "transactionSignature": "2XWcSQVtR4NoHBhzYpDkYkmYtEFkFXC5ZwrKiPok1kvA86GvnN15qP7RNP6eTeNWgJqgnR1GA2M3QPp1hucW7e1v",\ "instruction": "",\ "farm": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "signer": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "tokenAmount": "1234.56789",\ "usdAmount": "1234.56789",\ "token": "VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd",\ "rewardIndex": 123,\ "configMode": "",\ "details": {}\ }\ ], "paginationToken": "" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/farms/get-farm-management-history#parameter-farm-pubkey) farmPubkey string required Farm public key Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Query Parameters [​](https://kamino.com/docs/build/farms/get-farm-management-history#parameter-limit) limit integer default:100 Maximum number of results to return (1-1000) Required range: `1 <= x <= 1000` Example: `100` [​](https://kamino.com/docs/build/farms/get-farm-management-history#parameter-pagination-token) paginationToken string Token for fetching the next page of results Example: `"eyJsYXN0SWQiOiIxMjM0In0="` [​](https://kamino.com/docs/build/farms/get-farm-management-history#parameter-sort) sort enum default:desc Sort order (asc for oldest first, desc for newest first) Available options: `asc`, `desc` Example: `"desc"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/farms/get-farm-management-history#response-result) result object\[\] required Show child attributes [​](https://kamino.com/docs/build/farms/get-farm-management-history#response-pagination-token) paginationToken string Token for fetching the next page. Absent when no more results. Assistant Responses are generated using AI and may contain mistakes. --- # Get charts for a reserve - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-lend-reserves/get-charts-for-a-reserve#content-area) Get charts for a reserve cURL curl --request GET \ --url https://api.kamino.finance/reserves/{reservePubkey}/charts const options = {method: 'GET'}; fetch('https://api.kamino.finance/reserves/{reservePubkey}/charts', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/reserves/{reservePubkey}/charts" response = requests.get(url) print(response.text) false 200 400 404 500 { "borrowCurve": [\ {\ "utilizationRateBps": "8000",\ "borrowRateBps": "500"\ }\ ], "history": [\ {\ "timestamp": "2025-03-01T12:00:00.000Z",\ "supplyApy": "0.0412",\ "borrowApy": "0.0621",\ "totalSupply": "125000.5",\ "totalSupplyUsd": "250001",\ "totalBorrow": "50000.2",\ "totalBorrowUsd": "100000.4",\ "utilization": "0.4"\ }\ ] } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } GET / reserves / {reservePubkey} / charts Try it Get charts for a reserve cURL curl --request GET \ --url https://api.kamino.finance/reserves/{reservePubkey}/charts const options = {method: 'GET'}; fetch('https://api.kamino.finance/reserves/{reservePubkey}/charts', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/reserves/{reservePubkey}/charts" response = requests.get(url) print(response.text) false 200 400 404 500 { "borrowCurve": [\ {\ "utilizationRateBps": "8000",\ "borrowRateBps": "500"\ }\ ], "history": [\ {\ "timestamp": "2025-03-01T12:00:00.000Z",\ "supplyApy": "0.0412",\ "borrowApy": "0.0621",\ "totalSupply": "125000.5",\ "totalSupplyUsd": "250001",\ "totalBorrow": "50000.2",\ "totalBorrowUsd": "100000.4",\ "utilization": "0.4"\ }\ ] } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/kamino-lend-reserves/get-charts-for-a-reserve#parameter-reserve-pubkey) reservePubkey string required Kamino Lend reserve public key Example: `"FBSyPnxtHKLBZ4UeeUyAnbtFuAmTHLtso9YtsqRDRWpM"` #### Query Parameters [​](https://kamino.com/docs/build/kamino-lend-reserves/get-charts-for-a-reserve#parameter-program-id) programId string default:KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD KLend program ID Example: `"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"` [​](https://kamino.com/docs/build/kamino-lend-reserves/get-charts-for-a-reserve#parameter-frequency) frequency enum default:hour Frequency of the snapshots Available options: `hour`, `day` Example: `"hour"` [​](https://kamino.com/docs/build/kamino-lend-reserves/get-charts-for-a-reserve#parameter-one-of-0) start stringnumberstringnumber default:1970-01-01T00:00:00.000Z Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` [​](https://kamino.com/docs/build/kamino-lend-reserves/get-charts-for-a-reserve#parameter-one-of-0) end stringnumberstringnumber Date input (ISO 8601 string or epoch in ms) Example: `"2024-01-01T00:00:00.000Z"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/kamino-lend-reserves/get-charts-for-a-reserve#response-borrow-curve) borrowCurve object\[\] required Show child attributes [​](https://kamino.com/docs/build/kamino-lend-reserves/get-charts-for-a-reserve#response-history) history object\[\] required Show child attributes Assistant Responses are generated using AI and may contain mistakes. --- # Get profit and loss for an obligation - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-lend-user-loans/get-profit-and-loss-for-an-obligation#content-area) Get profit and loss for an obligation cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl" response = requests.get(url) print(response.text) false 200 422 500 503 { "usd": "25.21", "sol": "1.0", "invested": { "usd": "1234.56789", "sol": "1234.56789" }, "truncatedHistory": true } { "error": "The requested calculation is not supported for this asset" } { "error": "An internal error occurred" } { "error": "" } GET / v2 / kamino-market / {marketPubkey} / obligations / {obligationPubkey} / pnl Try it Get profit and loss for an obligation cURL curl --request GET \ --url https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl const options = {method: 'GET'}; fetch('https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl" response = requests.get(url) print(response.text) false 200 422 500 503 { "usd": "25.21", "sol": "1.0", "invested": { "usd": "1234.56789", "sol": "1234.56789" }, "truncatedHistory": true } { "error": "The requested calculation is not supported for this asset" } { "error": "An internal error occurred" } { "error": "" } #### Path Parameters [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-profit-and-loss-for-an-obligation#parameter-market-pubkey) marketPubkey string required Kamino Lend market public key Example: `"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"` [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-profit-and-loss-for-an-obligation#parameter-obligation-pubkey) obligationPubkey string required Kamino Lend obligation public key Example: `"63QrAB1okxCc4FpsgcKYHjYTp1ua8ch6mLReyKRdc22o"` #### Query Parameters [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-profit-and-loss-for-an-obligation#parameter-env) env enum default:mainnet-beta Solana cluster environment Available options: `mainnet-beta`, `devnet`, `localnet` Example: `"mainnet-beta"` [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-profit-and-loss-for-an-obligation#parameter-program-id) programId string default:KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD KLend program ID Example: `"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"` [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-profit-and-loss-for-an-obligation#parameter-use-stake-rate) useStakeRate enum default:false For xSOL pairs, calculate the PnL using the stake rate Available options: `true`, `false` Example: `"true"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-profit-and-loss-for-an-obligation#response-usd) usd string required PnL in USD Example: `"25.21"` [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-profit-and-loss-for-an-obligation#response-sol) sol string required PnL in SOL Example: `"1.0"` [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-profit-and-loss-for-an-obligation#response-invested) invested object Invested amounts Show child attributes [​](https://kamino.com/docs/build/kamino-lend-user-loans/get-profit-and-loss-for-an-obligation#response-truncated-history) truncatedHistory boolean Set when the obligation transaction history exceeded the computation cap and older transactions were dropped from the PnL calculation Assistant Responses are generated using AI and may contain mistakes. --- # Get metadata for KVault token - Kamino Docs > Documentation Index > ------------------- > > Fetch the complete documentation index at: [/docs/llms.txt](https://kamino.com/docs/llms.txt) > > Use this file to discover all available pages before exploring further. [Skip to main content](https://kamino.com/docs/build/kamino-earn-vault-metadata/get-metadata-for-kvault-token#content-area) Get metadata for KVault token cURL curl --request GET \ --url https://api.kamino.finance/kvaults/mints/{pubkey}/metadata const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/mints/{pubkey}/metadata', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/mints/{pubkey}/metadata" response = requests.get(url) print(response.text) false 200 400 404 500 { "name": "", "symbol": "", "description": "", "image": "" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } GET / kvaults / mints / {pubkey} / metadata Try it Get metadata for KVault token cURL curl --request GET \ --url https://api.kamino.finance/kvaults/mints/{pubkey}/metadata const options = {method: 'GET'}; fetch('https://api.kamino.finance/kvaults/mints/{pubkey}/metadata', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); import requests url = "https://api.kamino.finance/kvaults/mints/{pubkey}/metadata" response = requests.get(url) print(response.text) false 200 400 404 500 { "name": "", "symbol": "", "description": "", "image": "" } { "error": "Invalid query request", "details": [\ {\ "code": "invalid_union",\ "errors": [\ [\ {\ "code": "custom",\ "path": [],\ "message": "Invalid date string"\ }\ ],\ [\ {\ "expected": "number",\ "code": "invalid_type",\ "path": [],\ "message": "Invalid input: expected number, received string"\ }\ ]\ ],\ "path": [\ "start"\ ],\ "message": "Invalid input"\ }\ ] } { "metadata": "Account could not be found" } { "error": "An internal error occurred" } #### Path Parameters [​](https://kamino.com/docs/build/kamino-earn-vault-metadata/get-metadata-for-kvault-token#parameter-pubkey) pubkey string required Valid base58-encoded address Example: `"VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd"` #### Query Parameters [​](https://kamino.com/docs/build/kamino-earn-vault-metadata/get-metadata-for-kvault-token#parameter-env) env enum default:mainnet-beta Solana cluster environment Available options: `mainnet-beta`, `devnet`, `localnet` Example: `"mainnet-beta"` #### Response 200 application/json OK [​](https://kamino.com/docs/build/kamino-earn-vault-metadata/get-metadata-for-kvault-token#response-name) name string required The name of the token [​](https://kamino.com/docs/build/kamino-earn-vault-metadata/get-metadata-for-kvault-token#response-symbol) symbol string required The symbol of the token [​](https://kamino.com/docs/build/kamino-earn-vault-metadata/get-metadata-for-kvault-token#response-description) description string required A description of the token [​](https://kamino.com/docs/build/kamino-earn-vault-metadata/get-metadata-for-kvault-token#response-image) image string required A URL pointing to an image of the token Assistant Responses are generated using AI and may contain mistakes. ---