BTB Finance for agents

Protocols / Lending

Kamino Lend

Peer-to-pool lending and borrowing on Solana (klend program). An agent can deposit liquidity to earn interest, deposit collateral, borrow against it, repay, withdraw, and use flash loans. Kamino also exposes a REST API for market data and transaction builders.

On-chain + APISOLANA1 contractsWebsite · Docs

get_protocol({ "protocol": "kamino-lend" })

Risks an agent should know

What an agent can do

supplyDeposit liquidity into a reserve to earn interest
deposit_reserve_liquidity(amount) on the klend program, or the Kamino API transaction builder under /ktx/klend/deposit
borrowBorrow against deposited collateral
init_user_metadata and init_obligation once per wallet and market; deposit collateral; refresh_reserve(s) and refresh_obligation; then borrow_obligation_liquidity_v2(amount) in the same transaction
repayRepay borrowed liquidity
refresh the reserve, then repay_obligation_liquidity_v2(amount); or repay_and_withdraw_and_redeem for repay plus collateral release
withdrawWithdraw supplied liquidity
redeem_reserve_collateral(ctoken_amount) after refresh_reserve
flash-loanBorrow and repay in one transaction
flash_borrow_reserve_liquidity(amount), other instructions, then flash_repay_reserve_liquidity(amount, borrow_index) in the same transaction

Contracts

solana

ContractAddressKey functionsTry
klend lending program (mainnet)
pool
KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD
source
writedeposit_reserve_liquidity(liquidity_amount: u64)
writeredeem_reserve_collateral(collateral_amount: u64)
writeinit_user_metadata(user_lookup_table: Pubkey)
writeinit_obligation(args: InitObligationArgs)
writerefresh_reserve()
writerefresh_reserves_batch(skip_price_updates: bool)
writerefresh_obligation()
writedeposit_obligation_collateral_v2(collateral_amount: u64)
+9 more via get_protocol

APIs

Kamino API: list lending markets
auth: none
https://api.kamino.finance/v2/kamino-market
GET the list of lending markets (market pubkeys and metadata). Use it to find the main market and its reserves before building transactions. Base URL taken from Kamino's own tutorial code; the API reference was not readable in full during research.
Kamino API: reserve metrics history
auth: none
https://api.kamino.finance/kamino-market/{market}/reserves/{reserve}/metrics/history
GET historical supply APY and borrow APY for one reserve.
Kamino API reference
auth: none
https://api-docs.kamino.com
Full OpenAPI reference for market data and transaction builders (for example the klend deposit and withdraw routes under /ktx/). Check exact parameters here before use.

Notes

Mainnet program id KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD is listed for mainnet and devnet on the official README. The staging program SLendK7ySfcEzyaFqy93gDnD3RtrpXJcnRwb6zFHJSh (a separate test deployment) is left out. Lending market and reserve account addresses are not included because they could not be confirmed from an official page in this research; get them from the Kamino API or the SDK. Keyfunctions are from the program's lib.rs instruction list; the deprecated v1 variants are omitted. Kamino vaults (kvault) are a separate product and are not covered here.

Sources

Researched 2026-11-28. Addresses are copied from the official sources above; check them before moving large amounts.