Skip to main content

Overview

Kamino provides three integration options:
OptionDescription
REST APIHTTPS endpoints for data, analytics, and unsigned transactions. Language-agnostic.
TypeScript SDKOn-chain state reads and transaction building. TS/JS only.
Rust Interface CrateLightweight instruction builder for Rust clients, bots, and on-chain CPI.

Core Differences

Comparison of API, SDK, and Rust crate capabilities.
CapabilityREST APITypeScript SDKRust Interface Crate
Data queries (vaults, reserves)Ready-made endpointsOn-chain readsOn-chain reads (raw account parsing)
User position trackingRich endpointsReal-time account lookupReal-time account lookup
Historical metrics & chartsBuilt-in history endpointsNot availableNot available
Transaction building (deposit, borrow)Unsigned transaction endpointsInstruction buildersInstruction builders
Vault creationNot supportedAdmin-level creation toolsNot supported
On-chain CPINot applicableNot applicableDirect CPI from Solana programs
Language/runtimeAny (via HTTP)TypeScript/JavaScript onlyRust (client-side or on-chain)

Data & Analytics

Retrieve vault, market, and historical performance data.
REST APIFetch historical APY data for lending market reserves.
const options = {method: 'GET'};
fetch('https://api.kamino.finance/kamino-market/{market-id}/rates/history', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
TypeScript SDKNo history tracking. Developers must persist snapshots manually if needed.

On-Chain Transactions

Build and execute deposit, borrow, repay, and withdraw operations.
REST API
Get unsigned Solana transactions to deposit liquidity into a Kamino Lend market reserve. Returns transaction that must be signed client-side.
const depositRequest = {
  wallet: 'YOUR_WALLET_ADDRESS',
  market: 'DxXdAyU3kCjnyggvHmY5nAwg5cRbbmdyX3npfDMjjMek',
  reserve: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
  amount: '1.0', // 1 USDC (decimal format, not lamports)
};

const res = await fetch('https://api.kamino.finance/ktx/klend/deposit', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(depositRequest),
});

const { transaction } = await res.json();
// Sign and send transaction client-side
TypeScript SDK
Build and execute deposit transactions directly on-chain.
import { KaminoMarket, KaminoAction, VanillaObligation, PROGRAM_ID } from '@kamino-finance/klend-sdk';
import { createSolanaRpc, address } from '@solana/kit';
import BN from 'bn.js';

const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');
const market = await KaminoMarket.load(
  rpc,
  address('DxXdAyU3kCjnyggvHmY5nAwg5cRbbmdyX3npfDMjjMek'),
  100
);

const depositAction = await KaminoAction.buildDepositTxns(
  market,
  new BN(1_000_000), // 1 USDC
  address('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'),
  signer,
  new VanillaObligation(PROGRAM_ID),
  true
);
// Build, sign, and send transaction
Rust Interface Crate
Build deposit instructions from a Rust client. Ideal for bots and backend services.
use klend_interface::{helpers, pda, ReserveInfo, KLEND_PROGRAM_ID};
use spl_associated_token_account::get_associated_token_address;

let reserve = ReserveInfo::from_account_data(reserve_pubkey, &reserve_data.data)?;
let user_source_liquidity = get_associated_token_address(&owner, &reserve.liquidity_mint);
let (collateral_mint, _) = pda::reserve_collateral_mint(&KLEND_PROGRAM_ID, &reserve_pubkey);
let user_destination_collateral = get_associated_token_address(&owner, &collateral_mint);

let instructions = helpers::deposit::deposit(
    owner,
    &reserve,
    user_source_liquidity,
    user_destination_collateral,
    1_000_000, // 1 USDC (6 decimals)
);
// Build and send transaction
REST API
Get unsigned transactions for borrow and repay operations.
// Borrow
const borrowRequest = {
  wallet: 'YOUR_WALLET_ADDRESS',
  market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF',
  reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59',
  amount: '1.0',
};

const borrowRes = await fetch('https://api.kamino.finance/ktx/klend/borrow', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(borrowRequest),
});

// Repay
const repayRequest = {
  wallet: 'YOUR_WALLET_ADDRESS',
  market: '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF',
  reserve: 'D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59',
  amount: '1.0',
};

const repayRes = await fetch('https://api.kamino.finance/ktx/klend/repay', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(repayRequest),
});
TypeScript SDK
Build borrow and repay transactions directly.
import { KaminoAction, VanillaObligation, PROGRAM_ID } from '@kamino-finance/klend-sdk';
import BN from 'bn.js';

const borrowAction = await KaminoAction.buildBorrowTxns(
  market,
  new BN(1_000_000),
  tokenMint,
  signer,
  new VanillaObligation(PROGRAM_ID),
  true,
  undefined,
  1_000_000,
  true,
  false
);
Rust Interface Crate
Build borrow instructions using ObligationContext which handles reserve refresh automatically.
use klend_interface::{ObligationContext, pda, KLEND_PROGRAM_ID};
use spl_associated_token_account::get_associated_token_address;

// Build context from on-chain obligation + its reserves
let ctx = ObligationContext::from_account_data(
    obligation_pubkey, &obligation_data.data, &reserves
)?;

let user_dest_liquidity = get_associated_token_address(&owner, &borrow_mint);
let instructions = ctx.borrow(
    owner,
    &reserve_pubkey,
    user_dest_liquidity,
    1_000_000, // 1 USDC (6 decimals)
)?;
// Build and send transaction
TypeScript SDK
const { vault: vaultSigner, initVaultIxs: instructions } =
  await kaminoManager.createVaultIxs(kaminoVaultConfig);

Choose the right tool for your use case.
Use CaseBest Tool
Display vault list with APR & TVLAPI
Chart vault APY over 30 daysAPI
Fetch a user’s historical rewardsAPI
Build transactions for client signingAPI
Execute transactions with full customizationSDK
Create a new liquidity vaultSDK
Build in non-JS backend (e.g. Python)API
Require zero rate limitsSDK with private RPC
Build a Rust botRust Crate
CPI from an on-chain Solana programRust Crate

Summary

Use the Kamino REST API for fast data integration, history tracking, and building unsigned transactions across any backend. Use the TypeScript SDK for advanced transaction composition, simulation, and vault creation with full on-chain control. Use the Rust interface crate for Rust-native clients, high-performance bots, and CPI from on-chain Solana programs.

API Documentation

Explore REST API endpoints and response schemas

SDK Documentation

Learn how to integrate the TypeScript SDK

Rust Interface Crate

Lightweight Rust instruction builder for clients and CPI

Borrow Operations

Step-by-step guides for deposit, withdraw, borrow, and repay

SDK Examples

View code examples in the GitHub repository