# Kamino API The Kamino API provides a comprehensive way to interact with Kamino without reading directly from the blockchain. The API also provides the ability to fetch data that might not be available from just reading the chain. Kamino products covered by this documentation: - **Kamino Earn Vaults** (kvaults) - **Kamino Borrow** (klend) (checkout out the [SDK examples](https://github.com/Kamino-Finance/klend-sdk/tree/master/examples) too) - **Kamino Liquidity** (yvaults) (coming soon, in the meantime, checkout out the [SDK examples](https://github.com/Kamino-Finance/kliquidity-sdk/tree/master/examples)) The API is rate-limited for unauthenticated users. If you feel you need to make more requests or run into rate-limit issues, please reach out. Version: 1.0.0 ## Servers ``` https://api.kamino.finance ``` ## Download OpenAPI description [Kamino API](https://api-docs.kamino.com/_bundle/kamino-api.yaml) ## 📊 Vault Data Endpoints to retrieve information about the state of Kamino Earn Vaults ### Get all kvaults - [GET /kvaults/vaults](https://api-docs.kamino.com/kamino-api/kvaultsvault/paths/~1kvaults~1vaults/get.md): Get all Kamino Earn Vaults ### Get KVault by address - [GET /kvaults/vaults/{pubkey}](https://api-docs.kamino.com/kamino-api/kvaultsvault/paths/~1kvaults~1vaults~1%7Bpubkey%7D/get.md): Get a single Kamino Earn Vault by the KVault account address ### Get current KVault metrics - [GET /kvaults/vaults/{pubkey}/metrics](https://api-docs.kamino.com/kamino-api/kvaultsvault/paths/~1kvaults~1vaults~1%7Bpubkey%7D~1metrics/get.md): Get current Kamino Earn Vault metrics for a given vault ### Get historical KVault metrics - [GET /kvaults/vaults/{pubkey}/metrics/history](https://api-docs.kamino.com/kamino-api/kvaultsvault/paths/~1kvaults~1vaults~1%7Bpubkey%7D~1metrics~1history/get.md): Get historical Kamino Earn Vault metrics for a given vault, between an optional range of dates ### Get historical KVault allocation volume - [GET /kvaults/vaults/{pubkey}/allocation-volume/history](https://api-docs.kamino.com/kamino-api/kvaultsvault/paths/~1kvaults~1vaults~1%7Bpubkey%7D~1allocation-volume~1history/get.md): Get historical Kamino Earn Vault allocation volume for a given vault and date range (max 1 year) ## 🕵️‍♂️ User Data Endpoints to retrieve information about the state of Kamino Earn Vault users ### Get historical user metrics for all KVault positions - [GET /kvaults/users/{pubkey}/metrics/history](https://api-docs.kamino.com/kamino-api/kvaultsuser/paths/~1kvaults~1users~1%7Bpubkey%7D~1metrics~1history/get.md): Get historical timeseries of total usd/sol/interest/apy for all user Kamino Earn Vault positions ### Get user KVault transactions - [GET /kvaults/users/{pubkey}/transactions](https://api-docs.kamino.com/kamino-api/kvaultsuser/paths/~1kvaults~1users~1%7Bpubkey%7D~1transactions/get.md): Get all Kamino Earn Vault transactions for a given user ### Get all user KVault positions - [GET /kvaults/users/{pubkey}/positions](https://api-docs.kamino.com/kamino-api/kvaultsuser/paths/~1kvaults~1users~1%7Bpubkey%7D~1positions/get.md): Get a list of user positions for each Kamino Earn Vault the user has currently deposited into. Returns staked and unstaked shares. ### Get user position for a specific KVault - [GET /kvaults/users/{userPubkey}/positions/{vaultPubkey}](https://api-docs.kamino.com/kamino-api/kvaultsuser/paths/~1kvaults~1users~1%7Buserpubkey%7D~1positions~1%7Bvaultpubkey%7D/get.md): Get a single user position for a Kamino Earn Vault the user currently has currently deposited into. Returns staked and unstaked shares. ### Get historical user metrics for a single KVault - [GET /kvaults/users/{userPubkey}/vaults/{vaultPubkey}/metrics/history](https://api-docs.kamino.com/kamino-api/kvaultsuser/paths/~1kvaults~1users~1%7Buserpubkey%7D~1vaults~1%7Bvaultpubkey%7D~1metrics~1history/get.md): Get historical timeseries of total usd/sol/interest/apy for a single user Kamino Earn Vault position ### Get user KVault PnL - [GET /kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl](https://api-docs.kamino.com/kamino-api/kvaultsuser/paths/~1kvaults~1users~1%7Buserpubkey%7D~1vaults~1%7Bvaultpubkey%7D~1pnl/get.md): Get current PnL and cost basis of user vault position ### Get user KVault PnL history - [GET /kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history](https://api-docs.kamino.com/kamino-api/kvaultsuser/paths/~1kvaults~1users~1%7Buserpubkey%7D~1vaults~1%7Bvaultpubkey%7D~1pnl~1history/get.md): Get PnL and cost basis history of user vault position ## 🌍 Global Data Endpoints to retrieve information about the global state of Kamino Earn Vaults ### Get all KVault season rewards - [GET /kvaults/rewards](https://api-docs.kamino.com/kamino-api/kvaultsglobal/paths/~1kvaults~1rewards/get.md): Get all active season points rewards for each Kamino Earn Vault ### Get summary of the KVault program earnings - [GET /kvaults/summary](https://api-docs.kamino.com/kamino-api/kvaultsglobal/paths/~1kvaults~1summary/get.md): Get an aggregated all-time summary of all Kamino Earn Vault rewards and interest earned, in SOL and USD ## 🪙 Share Mint Data Endpoints to retrieve information about the global state of Kamino Earn Vault share mints ### Get metadata for KVault token - [GET /kvaults/mints/{pubkey}/metadata](https://api-docs.kamino.com/kamino-api/kvaultsmint/paths/~1kvaults~1mints~1%7Bpubkey%7D~1metadata/get.md): Get metadata for a given Kamino Earn Vault receipt token mint ### Get icon for KVault token - [GET /kvaults/mints/{pubkey}/metadata/image.svg](https://api-docs.kamino.com/kamino-api/kvaultsmint/paths/~1kvaults~1mints~1%7Bpubkey%7D~1metadata~1image.svg/get.md): Get the SVG icon for a given Kamino Earn Vault receipt token mint ## 🌱 Deposit Get unsigned Solana transactions to **deposit** into Kamino Earn Vaults {% code-snippet file="/docs/tags/kvaults-tx-deposit-example.ts" language="ts" title="Deposit Transaction" /%} ### Get transaction to deposit into a kvault - [POST /ktx/kvault/deposit](https://api-docs.kamino.com/kamino-api/kvaultstxdeposit/paths/~1ktx~1kvault~1deposit/post.md): Deposit tokens into a specified Kamino Earn Vault ### Get instructions to deposit into a kvault - [POST /ktx/kvault/deposit-instructions](https://api-docs.kamino.com/kamino-api/kvaultstxdeposit/paths/~1ktx~1kvault~1deposit-instructions/post.md): Instructions to deposit tokens into a specified Kamino Earn Vault. Additionally includes lookup tables to use to compress transaction size ## 🏃‍♂️ Withdraw Get unsigned Solana transactions to **withdraw** from Kamino Earn Vaults {% code-snippet file="/docs/tags/kvaults-tx-withdraw-example.ts" language="ts" title="Withdraw Transaction" /%} ### Get transaction to withdraw from a kvault - [POST /ktx/kvault/withdraw](https://api-docs.kamino.com/kamino-api/kvaultstxwithdraw/paths/~1ktx~1kvault~1withdraw/post.md): Withdraw tokens from a specified Kamino Earn Vault ### Get instructions to withdraw from a kvault - [POST /ktx/kvault/withdraw-instructions](https://api-docs.kamino.com/kamino-api/kvaultstxwithdraw/paths/~1ktx~1kvault~1withdraw-instructions/post.md): Instructions to withdraw tokens from a specified Kamino Earn Vault. Additionally includes lookup tables to use to compress transaction size ## 🏦 Markets ### Get all Kamino Markets config - [GET /v2/kamino-market](https://api-docs.kamino.com/kamino-api/klendmarkets/paths/~1v2~1kamino-market/get.md): Get all Kamino Lending markets configuration for a specific program ID. This is the V2 endpoint that allows filtering by program ID instead of cluster. ### Get KLend reserve history - [GET /kamino-market/{marketPubkey}/reserves/{reservePubkey}/metrics/history](https://api-docs.kamino.com/kamino-api/klendmarkets/paths/~1kamino-market~1%7Bmarketpubkey%7D~1reserves~1%7Breservepubkey%7D~1metrics~1history/get.md): Get historical metrics for a specific reserve in a Kamino Lending market over a specified time range with configurable frequency (minute, hour, or day). ### Get Kamino Market config - [GET /v2/kamino-market/{pubkey}](https://api-docs.kamino.com/kamino-api/klendmarkets/paths/~1v2~1kamino-market~1%7Bpubkey%7D/get.md): Get configuration for a specific Kamino Lending market by market address. Optionally filter by program ID. ### Get metrics for leverage/multiply vaults - [GET /kamino-market/{pubkey}/leverage/metrics](https://api-docs.kamino.com/kamino-api/klendmarkets/paths/~1kamino-market~1%7Bpubkey%7D~1leverage~1metrics/get.md): Get aggregated metrics for all leverage and multiply positions in a Kamino Lending market, including average leverage, total borrowed, total deposited, and number of obligations. ### Get KLend Market metrics history - [GET /kamino-market/{pubkey}/metrics/history](https://api-docs.kamino.com/kamino-api/klendmarkets/paths/~1kamino-market~1%7Bpubkey%7D~1metrics~1history/get.md): Get historical metrics (TVL and number of obligations) for a Kamino Lending market over a specified time range. ### Get metrics for market reserves - [GET /kamino-market/{pubkey}/reserves/metrics](https://api-docs.kamino.com/kamino-api/klendmarkets/paths/~1kamino-market~1%7Bpubkey%7D~1reserves~1metrics/get.md): Get current metrics for all reserves in a Kamino Lending market, including APY, TVL, borrow/supply amounts, and LTV ratios. ### Get KLend market reserves account data - [GET /kamino-market/reserves/account-data](https://api-docs.kamino.com/kamino-api/klendmarkets/paths/~1kamino-market~1reserves~1account-data/get.md): Fetch reserve account data for given Klend markets. Returns base64-encoded account data for all reserves in the specified markets. ## 🍬 Rewards Get up-to-date and historical rewards data. ### Get KLend rewards - [GET /klend/rewards](https://api-docs.kamino.com/kamino-api/klendrewards/paths/~1klend~1rewards/get.md): Fetches all active KLend reward metrics for a specific points source ### Get user KLend rewards - [GET /klend/users/{pubkey}/rewards](https://api-docs.kamino.com/kamino-api/klendrewards/paths/~1klend~1users~1%7Bpubkey%7D~1rewards/get.md): Fetches KLend reward data for a specific user and points source ### Get KLend reward history - [GET /klend/{depositReservePubkey}/{borrowReservePubkey}/rewards/history](https://api-docs.kamino.com/kamino-api/klendrewards/paths/~1klend~1%7Bdepositreservepubkey%7D~1%7Bborrowreservepubkey%7D~1rewards~1history/get.md): Fetches historical KLend reward metrics for a specific deposit and borrow reserve pair ## 👥 Users and Loans ### Get KLend obligation history - [GET /v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/metrics/history](https://api-docs.kamino.com/kamino-api/klendusersandloans/paths/~1v2~1kamino-market~1%7Bmarketpubkey%7D~1obligations~1%7Bobligationpubkey%7D~1metrics~1history/get.md): Get historical metrics for a specific obligation in a Kamino Lending market. This V2 endpoint supports using stake rate for obligation value calculation when useStakeRateForObligation is true. ### Get profit and loss for an obligation - [GET /v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl](https://api-docs.kamino.com/kamino-api/klendusersandloans/paths/~1v2~1kamino-market~1%7Bmarketpubkey%7D~1obligations~1%7Bobligationpubkey%7D~1pnl/get.md): Get profit and loss (PnL) for a specific obligation. You can specify PnL mode with query param positionMode (obligation_all_time or current_obligation). For xSOL pairs, useStakeRate can be set to true to calculate the PnL using the stake rate. ### Get all user obligations - [GET /kamino-market/{marketPubkey}/users/{userPubkey}/obligations](https://api-docs.kamino.com/kamino-api/klendusersandloans/paths/~1kamino-market~1%7Bmarketpubkey%7D~1users~1%7Buserpubkey%7D~1obligations/get.md): Get all obligations (loans) for a specific user wallet in a Kamino Lending market. ### Get information about a loan (obligation) - [GET /klend/loans/{pubkey}](https://api-docs.kamino.com/kamino-api/klendusersandloans/paths/~1klend~1loans~1%7Bpubkey%7D/get.md): Fetches information about a loan ## 📝 Deposit Get unsigned Solana transactions to **deposit** liquidity into a Kamino Lend market reserve, which can then be used as collateral to borrow {% code-snippet file="/docs/tags/klend-tx-deposit-example.ts" language="ts" title="Deposit Transaction" /%} ### Get transaction to deposit into a klend reserve - [POST /ktx/klend/deposit](https://api-docs.kamino.com/kamino-api/klendtxdeposit/paths/~1ktx~1klend~1deposit/post.md): Deposit tokens into the specified Kamino Lend market reserve ### Get instructions to deposit into a klend reserve - [POST /ktx/klend/deposit-instructions](https://api-docs.kamino.com/kamino-api/klendtxdeposit/paths/~1ktx~1klend~1deposit-instructions/post.md): Instructions to deposit tokens into the specified Kamino Lend market reserve. Additionally includes lookup tables to use to compress transaction size ## 💳 Borrow Get unsigned Solana transactions to **borrow** liquidity from a given Kamino Lend market reserve {% code-snippet file="/docs/tags/klend-tx-borrow-example.ts" language="ts" title="Borrow Transaction" /%} ### Get transaction to borrow liquidity from a klend reserve - [POST /ktx/klend/borrow](https://api-docs.kamino.com/kamino-api/klendtxborrow/paths/~1ktx~1klend~1borrow/post.md): Borrow liquidity from the specified Kamino Lend market reserve ### Get instructions to borrow liquidity from a klend reserve - [POST /ktx/klend/borrow-instructions](https://api-docs.kamino.com/kamino-api/klendtxborrow/paths/~1ktx~1klend~1borrow-instructions/post.md): Instructions to borrow liquidity from the specified Kamino Lend market reserve. Additionally includes lookup tables to use to compress transaction size ## 📝 Repay Get unsigned Solana transactions to **repay** debt for a given Kamino Lend user position {% code-snippet file="/docs/tags/klend-tx-repay-example.ts" language="ts" title="Repay Transaction" /%} ### Get transaction to repay debt of a klend reserve - [POST /ktx/klend/repay](https://api-docs.kamino.com/kamino-api/klendtxrepay/paths/~1ktx~1klend~1repay/post.md): Repay a debt position for the specified Kamino Lend market reserve ### Get instructions to repay debt of a klend reserve - [POST /ktx/klend/repay-instructions](https://api-docs.kamino.com/kamino-api/klendtxrepay/paths/~1ktx~1klend~1repay-instructions/post.md): Instructions to repay a debt position for the specified Kamino Lend market reserve. Additionally includes lookup tables to use to compress transaction size ## 🐝 Withdraw Get unsigned Solana transactions to **withdraw** liquidity from a given Kamino Lend market reserve {% code-snippet file="/docs/tags/klend-tx-withdraw-example.ts" language="ts" title="Withdraw Transaction" /%} ### Get transaction to withdraw from a klend reserve - [POST /ktx/klend/withdraw](https://api-docs.kamino.com/kamino-api/klendtxwithdraw/paths/~1ktx~1klend~1withdraw/post.md): Withdraw tokens from the specified Kamino Lend market reserve ### Get instructions to withdraw from a klend reserve - [POST /ktx/klend/withdraw-instructions](https://api-docs.kamino.com/kamino-api/klendtxwithdraw/paths/~1ktx~1klend~1withdraw-instructions/post.md): Instructions to withdraw tokens from the specified Kamino Lend market reserve. Additionally includes lookup tables to use to compress transaction size