kamino について
Solana上で開発するためのKamino Finance SDKとCLIのガイドです。借入、レバレッジポジション、集中流動性戦略、複数ソースを集約したオラクル価格を各SDKごとに説明します。
主な機能
- 01融資市場の操作とポジション管理
- 02レバレッジポジションの操作
- 03集中流動性戦略
- 04集約オラクル価格へのアクセス
- 05融資用CLIコマンド
活用シーン
- 01Solanaの融資アプリを開発
- 02借入と返済を自動化
- 03対応DEXの流動性戦略を管理
- 04DeFiアプリで集約価格を利用
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ sendaifun/ skills --skill kaminoインストール後、Claude Code で/kaminoを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
docs/troubleshooting.mdexamples/lending/borrow-repay.mddeposit-withdraw.mdleverage.mdexamples/liquidity/strategy-management.mdexamples/oracle/price-feeds.mdresources/klend-api-reference.mdkliquidity-api-reference.mdprogram-addresses.mdscope-api-reference.mdtemplates/full-integration.tslending-setup.tsliquidity-setup.ts詳細
Kamino Finance 開発ガイド
Kamino Finance を利用して、Solana 上で高度な DeFi アプリケーションを構築しましょう。Kamino Finance は、レンディング、借入、自動流動性管理、レバレッジ取引、オラクル集約を提供する包括的な DeFi プロトコルです。
概要
Kamino Finance が提供する機能:
- Kamino Lend (K-Lend):分離型マーケットを備えたレンディングおよび借入プロトコル
- Kamino Liquidity (K-Liquidity):自動 CLMM 流動性管理戦略
- Scope Oracle:信頼性の高い価格を提供するオラクル価格アグリゲーター
- Multiply/Leverage:資産のレバレッジ付きロング/ショートポジション
- Vaults:利回りを生み出すボールト戦略
- Obligation Orders:LTV および価格に基づく注文の自動実行
クイックスタート
インストール
# Lending SDK
npm install @kamino-finance/klend-sdk
# Liquidity SDK
npm install @kamino-finance/kliquidity-sdk
# Oracle SDK
npm install @kamino-finance/scope-sdk
# Required peer dependencies
npm install @solana/web3.js @coral-xyz/anchor decimal.js
環境設定
# .env file
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
WALLET_KEYPAIR_PATH=./keypair.json
Kamino Lending (klend-sdk)
レンディング SDK を使用すると、Kamino のレンディングマーケットで預け入れ、借入、返済、清算を実行できます。
コアクラス
| クラス | 用途 |
|---|---|
KaminoMarket | レンディングマーケットの読み込みと操作 |
KaminoAction | レンディング取引(預け入れ、借入、返済、引き出し)の構築 |
KaminoObligation | ユーザーの債務(ポジション)の管理 |
KaminoReserve | リザーブの設定と統計情報へのアクセス |
VanillaObligation | 標準的な債務タイプ |
マーケットの初期化
import { KaminoMarket } from "@kamino-finance/klend-sdk";
import { Connection, PublicKey } from "@solana/web3.js";
const connection = new Connection("https://api.mainnet-beta.solana.com");
// Main lending market address
const MAIN_MARKET = new PublicKey("7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF");
// Load market with basic data
const market = await KaminoMarket.load(connection, MAIN_MARKET);
// Load reserves for detailed data
await market.loadReserves();
// Get specific reserve
const usdcReserve = market.getReserve("USDC");
console.log("Total Deposits:", usdcReserve?.stats.totalDepositsWads.toString());
console.log("LTV:", usdcReserve?.stats.loanToValueRatio);
console.log("Borrow APY:", usdcReserve?.stats.borrowInterestAPY);
console.log("Supply APY:", usdcReserve?.stats.supplyInterestAPY);
// Refresh all data including obligations
await market.refreshAll();
担保の預け入れ
import { KaminoAction, VanillaObligation, PROGRAM_ID } from "@kamino-finance/klend-sdk";
import { Keypair, sendAndConfirmTransaction } from "@solana/web3.js";
import Decimal from "decimal.js";
async function deposit(
market: KaminoMarket,
wallet: Keypair,
tokenSymbol: string,
amount: Decimal
) {
// Build deposit transaction
const kaminoAction = await KaminoAction.buildDepositTxns(
market,
amount.toString(), // Amount in base units
tokenSymbol, // e.g., "USDC", "SOL"
wallet.publicKey,
new VanillaObligation(PROGRAM_ID),
0, // Additional compute budget (optional)
true, // Include Ata init instructions
undefined, // Referrer (optional)
undefined, // Current slot (optional)
"finalized" // Commitment
);
// Get all instructions
const instructions = [
...kaminoAction.setupIxs,
...kaminoAction.lendingIxs,
...kaminoAction.cleanupIxs,
];
// Create and send transaction
const tx = new Transaction().add(...instructions);
const signature = await sendAndConfirmTransaction(connection, tx, [wallet]);
return signature;
}
資産の借入
async function borrow(
market: KaminoMarket,
wallet: Keypair,
tokenSymbol: string,
amount: Decimal
) {
const kaminoAction = await KaminoAction.buildBorrowTxns(
market,
amount.toString(),
tokenSymbol,
wallet.publicKey,
new VanillaObligation(PROGRAM_ID),
0,
true,
false, // Include deposit for fees (optional)
undefined,
undefined,
"finalized"
);
const instructions = [
...kaminoAction.setupIxs,
...kaminoAction.lendingIxs,
...kaminoAction.cleanupIxs,
];
const tx = new Transaction().add(...instructions);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
ローンの返済
async function repay(
market: KaminoMarket,
wallet: Keypair,
tokenSymbol: string,
amount: Decimal | "max"
) {
const repayAmount = amount === "max" ? "max" : amount.toString();
const kaminoAction = await KaminoAction.buildRepayTxns(
market,
repayAmount,
tokenSymbol,
wallet.publicKey,
new VanillaObligation(PROGRAM_ID),
0,
true,
undefined,
"finalized"
);
const instructions = [
...kaminoAction.setupIxs,
...kaminoAction.lendingIxs,
...kaminoAction.cleanupIxs,
];
const tx = new Transaction().add(...instructions);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
担保の引き出し
async function withdraw(
market: KaminoMarket,
wallet: Keypair,
tokenSymbol: string,
amount: Decimal | "max"
) {
const withdrawAmount = amount === "max" ? "max" : amount.toString();
const kaminoAction = await KaminoAction.buildWithdrawTxns(
market,
withdrawAmount,
tokenSymbol,
wallet.publicKey,
new VanillaObligation(PROGRAM_ID),
0,
true,
undefined,
"finalized"
);
const instructions = [
...kaminoAction.setupIxs,
...kaminoAction.lendingIxs,
...kaminoAction.cleanupIxs,
];
const tx = new Transaction().add(...instructions);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
ユーザーの債務を取得する
// Get single vanilla obligation for user
const obligation = await market.getUserVanillaObligation(wallet.publicKey);
if (obligation) {
console.log("Deposits:", obligation.state.deposits);
console.log("Borrows:", obligation.state.borrows);
console.log("Health Factor:", obligation.refreshedStats.borrowLimit);
}
// Get all obligations for user
const allObligations = await market.getAllUserObligations(wallet.publicKey);
// Get obligations for specific reserve
const reserveObligations = await market.getAllUserObligationsForReserve(
wallet.publicKey,
usdcReserve
);
// Check if reserve is part of obligation
const isReserveInObligation = market.isReserveInObligation(
obligation,
usdcReserve
);
清算
async function liquidate(
market: KaminoMarket,
liquidator: Keypair,
obligationOwner: PublicKey,
repayTokenSymbol: string,
withdrawTokenSymbol: string,
repayAmount: Decimal
) {
const kaminoAction = await KaminoAction.buildLiquidateTxns(
market,
repayAmount.toString(),
repayTokenSymbol,
withdrawTokenSymbol,
obligationOwner,
liquidator.publicKey,
new VanillaObligation(PROGRAM_ID),
0,
true,
"finalized"
);
const instructions = [
...kaminoAction.setupIxs,
...kaminoAction.lendingIxs,
...kaminoAction.cleanupIxs,
];
const tx = new Transaction().add(...instructions);
return await sendAndConfirmTransaction(connection, tx, [liquidator]);
}
レバレッジ/Multiply 操作
Kamino は Multiply 機能を通じてレバレッジポジションをサポートしています。
レバレッジポジションを開く
import {
getLeverageDepositIxns,
getLeverageWithdrawIxns,
calculateLeverageMultiplier
} from "@kamino-finance/klend-sdk/leverage";
async function openLeveragedPosition(
market: KaminoMarket,
wallet: Keypair,
collateralToken: string,
borrowToken: string,
depositAmount: Decimal,
targetLeverage: number // e.g., 2x, 3x
) {
// Calculate parameters for target leverage
const leverageParams = await calculateLeverageMultiplier(
market,
collateralToken,
borrowToken,
depositAmount,
targetLeverage
);
// Build leverage deposit instructions
const { instructions, lookupTables } = await getLeverageDepositIxns(
market,
wallet.publicKey,
collateralToken,
borrowToken,
depositAmount,
leverageParams,
new VanillaObligation(PROGRAM_ID)
);
// Execute transaction with address lookup tables
const tx = new VersionedTransaction(/* ... */);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
レバレッジポジションを閉じる
async function closeLeveragedPosition(
market: KaminoMarket,
wallet: Keypair,
collateralToken: string,
borrowToken: string
) {
const { instructions, lookupTables } = await getLeverageWithdrawIxns(
market,
wallet.publicKey,
collateralToken,
borrowToken,
"max", // Withdraw full position
new VanillaObligation(PROGRAM_ID)
);
const tx = new VersionedTransaction(/* ... */);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
Obligation Orders
LTV または価格のしきい値に基づくアクションを自動化します。
LTV ベースの注文
import {
createLtvBasedOrder,
LtvOrderType
} from "@kamino-finance/klend-sdk/obligation_orders";
// Create order to repay when LTV exceeds threshold
async function createLtvOrder(
market: KaminoMarket,
wallet: Keypair,
targetLtv: number, // e.g., 0.8 for 80%
repayToken: string,
repayAmount: Decimal
) {
const orderIx = await createLtvBasedOrder(
market,
wallet.publicKey,
new VanillaObligation(PROGRAM_ID),
{
type: LtvOrderType.REPAY_ON_HIGH_LTV,
triggerLtv: targetLtv,
repayToken,
repayAmount: repayAmount.toString(),
}
);
const tx = new Transaction().add(orderIx);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
価格ベースの注文
import {
createPriceBasedOrder,
PriceOrderType
} from "@kamino-finance/klend-sdk/obligation_orders";
// Create stop-loss order
async function createStopLossOrder(
market: KaminoMarket,
wallet: Keypair,
tokenSymbol: string,
triggerPrice: Decimal,
action: "repay" | "withdraw"
) {
const orderIx = await createPriceBasedOrder(
market,
wallet.publicKey,
new VanillaObligation(PROGRAM_ID),
{
type: PriceOrderType.STOP_LOSS,
tokenSymbol,
triggerPrice: triggerPrice.toString(),
action,
}
);
const tx = new Transaction().add(orderIx);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
Kamino Liquidity (kliquidity-sdk)
Orca、Raydium、Meteora の集中流動性ポジションを自動で管理します。
SDK の初期化
import { Kamino } from "@kamino-finance/kliquidity-sdk";
import { Connection, clusterApiUrl } from "@solana/web3.js";
const connection = new Connection(clusterApiUrl("mainnet-beta"));
const kamino = new Kamino("mainnet-beta", connection);
戦略の取得
// Get all strategies
const strategies = await kamino.getStrategies();
// Get strategy by address
const strategy = await kamino.getStrategyByAddress(
new PublicKey("strategy_address")
);
// Get strategy by kToken mint
const strategyByMint = await kamino.getStrategyByKTokenMint(
new PublicKey("ktoken_mint")
);
// Get strategies with filters
const filteredStrategies = await kamino.getAllStrategiesWithFilters({
strategyType: "NON_PEGGED", // NON_PEGGED, PEGGED, STABLE
status: "LIVE", // LIVE, STAGING, DEPRECATED
tokenA: new PublicKey("..."), // Filter by token A
tokenB: new PublicKey("..."), // Filter by token B
});
戦略タイプ
| タイプ | 説明 | ペアの例 |
|---|---|---|
NON_PEGGED | 相関のない資産 | SOL-BONK、SOL-USDC |
PEGGED | 緩やかな相関がある資産 | BSOL-JitoSOL、mSOL-SOL |
STABLE | 価格が安定した資産 | USDC-USDT、USDH-USDC |
戦略データの取得
// Get share price
const sharePrice = await kamino.getStrategySharePrice(strategy);
console.log("Share Price:", sharePrice.toString());
// Get share data
const shareData = await kamino.getStrategyShareData(strategy);
console.log("Total Shares:", shareData.totalShares);
console.log("Token A per Share:", shareData.tokenAPerShare);
console.log("Token B per Share:", shareData.tokenBPerShare);
// Get token amounts per share
const tokenAmounts = await kamino.getTokenAAndBPerShare(strategy);
console.log("Token A:", tokenAmounts.tokenA);
console.log("Token B:", tokenAmounts.tokenB);
// Get strategy price range
const range = await kamino.getStrategyRange(strategy);
console.log("Lower Price:", range.lowerPrice);
console.log("Upper Price:", range.upperPrice);
console.log("Current Price:", range.currentPrice);
戦略への預け入れ
import Decimal from "decimal.js";
async function depositToStrategy(
kamino: Kamino,
wallet: Keypair,
strategyAddress: PublicKey,
tokenAAmount: Decimal,
tokenBAmount: Decimal,
slippage: Decimal // e.g., new Decimal(0.01) for 1%
) {
const strategy = await kamino.getStrategyByAddress(strategyAddress);
// Build deposit instructions
const depositIxs = await kamino.deposit(
strategy,
wallet.publicKey,
tokenAAmount,
tokenBAmount,
slippage
);
// Create transaction with extra compute budget
const tx = kamino.createTransactionWithExtraBudget();
tx.add(...depositIxs);
await kamino.assignBlockInfoToTransaction(tx);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
単一トークンの預け入れ
async function singleTokenDeposit(
kamino: Kamino,
wallet: Keypair,
strategyAddress: PublicKey,
tokenAmount: Decimal,
isTokenA: boolean, // true for Token A, false for Token B
slippage: Decimal
) {
const strategy = await kamino.getStrategyByAddress(strategyAddress);
const depositIxs = await kamino.singleTokenDeposit(
strategy,
wallet.publicKey,
tokenAmount,
isTokenA,
slippage
);
const tx = kamino.createTransactionWithExtraBudget();
tx.add(...depositIxs);
await kamino.assignBlockInfoToTransaction(tx);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
戦略からの引き出し
async function withdrawFromStrategy(
kamino: Kamino,
wallet: Keypair,
strategyAddress: PublicKey,
shareAmount: Decimal, // Number of shares to withdraw
slippage: Decimal
) {
const strategy = await kamino.getStrategyByAddress(strategyAddress);
const withdrawIxs = await kamino.withdraw(
strategy,
wallet.publicKey,
shareAmount,
slippage
);
const tx = kamino.createTransactionWithExtraBudget();
tx.add(...withdrawIxs);
await kamino.assignBlockInfoToTransaction(tx);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
// Withdraw all shares
async function withdrawAllShares(
kamino: Kamino,
wallet: Keypair,
strategyAddress: PublicKey,
slippage: Decimal
) {
const strategy = await kamino.getStrategyByAddress(strategyAddress);
const withdrawIxs = await kamino.withdrawAllShares(
strategy,
wallet.publicKey,
slippage
);
const tx = kamino.createTransactionWithExtraBudget();
tx.add(...withdrawIxs);
await kamino.assignBlockInfoToTransaction(tx);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
手数料と報酬の受け取り
async function collectFeesAndRewards(
kamino: Kamino,
wallet: Keypair,
strategyAddress: PublicKey
) {
const strategy = await kamino.getStrategyByAddress(strategyAddress);
const collectIxs = await kamino.collectFeesAndRewards(
strategy,
wallet.publicKey
);
const tx = kamino.createTransactionWithExtraBudget();
tx.add(...collectIxs);
await kamino.assignBlockInfoToTransaction(tx);
return await sendAndConfirmTransaction(connection, tx, [wallet]);
}
プール情報の取得
// Get supported DEXes
const dexes = kamino.getSupportedDexes();
// Returns: ["ORCA", "RAYDIUM", "METEORA"]
// Get fee tiers for DEX
const feeTiers = kamino.getFeeTiersForDex("ORCA");
// Get pools for token pair
const orcaPools = await kamino.getOrcaPoolsForTokens(tokenAMint, tokenBMint);
const raydiumPools = await kamino.getRaydiumPoolsForTokens(tokenAMint, tokenBMint);
const meteoraPools = await kamino.getMeteoraPoolsForTokens(tokenAMint, tokenBMint);
// Get current price for pair
const price = await kamino.getPriceForPair("ORCA", tokenAMint, tokenBMint);
リバランス方法
// Get available rebalance methods
const methods = kamino.getRebalanceMethods();
// Returns: ["MANUAL", "DRIFT", "TAKE_PROFIT", "PERIODIC", "PRICE_PERCENTAGE", ...]
// Get enabled methods
const enabledMethods = kamino.getEnabledRebalanceMethods();
// Get default method
const defaultMethod = kamino.getDefaultRebalanceMethod();
// Read rebalance parameters for strategy
const driftParams = await kamino.readDriftRebalanceParams(strategy);
const periodicParams = await kamino.readPeriodicRebalanceParams(strategy);
const priceParams = await kamino.readPricePercentageParams(strategy);
新しい戦略の作成
async function createStrategy(
kamino: Kamino,
admin: Keypair,
params: {
dex: "ORCA" | "RAYDIUM" | "METEORA";
tokenAMint: PublicKey;
tokenBMint: PublicKey;
feeTierBps: Decimal;
rebalanceMethod: string;
}
) {
const strategyKeypair = Keypair.generate();
// Check token accounts exist
const tokenAAccount = await kamino.getAssociatedTokenAddressAndData(
params.tokenAMint,
admin.publicKey
);
const tokenBAccount = await kamino.getAssociatedTokenAddressAndData(
params.tokenBMint,
admin.publicKey
);
// Create strategy account
const createAccountIx = await kamino.createStrategyAccount(
strategyKeypair.publicKey
);
// Initialize strategy
const initIxs = await kamino.initializeStrategy(
strategyKeypair.publicKey,
admin.publicKey,
params
);
const tx = kamino.createTransactionWithExtraBudget();
tx.add(createAccountIx, ...initIxs);
await kamino.assignBlockInfoToTransaction(tx);
return await sendAndConfirmTransaction(
connection,
tx,
[admin, strategyKeypair],
{ commitment: "finalized" }
);
}
Scope Oracle (scope-sdk)
信頼性の高い価格データを提供するオラクル価格アグリゲーターです。
Scope の初期化
import { Scope } from "@kamino-finance/scope-sdk";
import { Connection, clusterApiUrl } from "@solana/web3.js";
const connection = new Connection(clusterApiUrl("mainnet-beta"));
const scope = new Scope("mainnet-beta", connection);
オラクル価格の取得
// Get all oracle prices
const prices = await scope.getOraclePrices();
// Prices indexed by token
console.log("SOL Price:", prices.get("SOL"));
console.log("USDC Price:", prices.get("USDC"));
// Get specific price
const solPrice = await scope.getPrice("SOL");
console.log("SOL/USD:", solPrice.price.toString());
console.log("Timestamp:", solPrice.timestamp);
console.log("Confidence:", solPrice.confidence);
価格フィード
Scope は複数のオラクルソースからデータを集約します:
- Pyth:リアルタイムの市場価格
- Switchboard:分散型オラクルネットワーク
- TWAP:時間加重平均価格
- CLMM Prices:DEX から算出される価格
// Get price with source info
const priceData = await scope.getPriceWithMetadata("SOL");
console.log("Price:", priceData.price);
console.log("Source:", priceData.source);
console.log("Age (slots):", priceData.ageSlots);
CLI コマンド
レンディング CLI
# Deposit tokens
yarn cli deposit --url <RPC> --owner ./keypair.json --token USDC --amount 100
# Print all lending market accounts
yarn cli print-all-lending-market-accounts --rpc <RPC>
# Print all reserve accounts
yarn cli print-all-reserve-accounts --rpc <RPC>
# Print all obligation accounts
yarn cli print-all-obligation-accounts --rpc <RPC>
# Filter with jq
yarn cli print-all-reserve-accounts --rpc <RPC> | jq '.lastUpdateSlot'
yarn cli print-all-obligation-accounts --rpc <RPC> | jq --stream 'select(.[0][1] == "owner")'
プログラムアドレス
Mainnet
| プログラム | アドレス |
|---|---|
| Kamino Lending | KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD |
| Main Market | 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF |
| Kamino Liquidity | KLIQ... (varies) |
| Scope Oracle | ScopE... (varies) |
リザーブ設定
各リザーブには、設定可能なパラメーターがあります:
interface ReserveConfig {
// Collateral configuration
loanToValueRatio: number; // Max borrowing power (e.g., 0.8 = 80%)
liquidationThreshold: number; // Liquidation trigger (e.g., 0.85 = 85%)
liquidationBonus: number; // Liquidator reward (e.g., 0.05 = 5%)
// Interest rate model
optimalUtilizationRate: number; // Target utilization
borrowRateCurve: {
baseRate: number;
optimalRate: number;
maxRate: number;
};
// Fees
protocolTakeRate: number; // Protocol fee on interest
hostFeeRate: number; // Host integration fee
// Limits
depositLimit: number; // Max deposits
borrowLimit: number; // Max borrows
// Status
depositEnabled: boolean;
borrowEnabled: boolean;
withdrawEnabled: boolean;
}
エラー処理
import { KaminoError, ErrorCode } from "@kamino-finance/klend-sdk";
try {
await kaminoAction.execute();
} catch (error) {
if (error instanceof KaminoError) {
switch (error.code) {
case ErrorCode.InsufficientCollateral:
console.error("Not enough collateral for this borrow");
break;
case ErrorCode.BorrowLimitExceeded:
console.error("Borrow limit reached for this reserve");
break;
case ErrorCode.LiquidationThresholdExceeded:
console.error("Position is at risk of liquidation");
break;
case ErrorCode.InvalidObligation:
console.error("Obligation account not found or invalid");
break;
default:
console.error("Kamino error:", error.message);
}
} else {
throw error;
}
}
ベストプラクティス
ヘルスファクターの監視
async function checkHealthFactor(
market: KaminoMarket,
wallet: PublicKey
): Promise<number> {
await market.refreshAll();
const obligation = await market.getUserVanillaObligation(wallet);
if (!obligation) return Infinity;
const stats = obligation.refreshedStats;
const healthFactor = stats.borrowLimit / stats.borrowedValue;
if (healthFactor < 1.1) {
console.warn("WARNING: Health factor below 1.1, consider adding collateral");
}
return healthFactor;
}
トランザクションの最適化
// Use lookup tables for smaller transactions
const { instructions, lookupTables } = await kaminoAction.buildWithLookupTables();
// Create versioned transaction
const messageV0 = new TransactionMessage({
payerKey: wallet.publicKey,
recentBlockhash: (await connection.getLatestBlockhash()).blockhash,
instructions,
}).compileToV0Message(lookupTables);
const tx = new VersionedTransaction(messageV0);
tx.sign([wallet]);
await sendAndConfirmTransaction(connection, tx, [wallet]);
スリッページ保護
// For liquidity operations, always use slippage protection
const slippage = new Decimal(0.005); // 0.5% max slippage
const depositIxs = await kamino.deposit(
strategy,
wallet.publicKey,
tokenAAmount,
tokenBAmount,
slippage // Protects against price movement
);
TypeScript の型
import type {
// Lending types
KaminoMarket,
KaminoAction,
KaminoObligation,
KaminoReserve,
VanillaObligation,
ReserveConfig,
ObligationStats,
// Liquidity types
Kamino,
WhirlpoolStrategy,
StrategyWithAddress,
ShareData,
PositionRange,
RebalanceMethod,
StrategiesFilters,
// Oracle types
Scope,
OraclePrices,
PriceData,
} from "@kamino-finance/klend-sdk";
Kamino 2.0 / K-Lend(新機能)
アーキテクチャの更新
Kamino 2.0 では、次の 2 つの主要レイヤーを備えた完全統合型アプリケーションが導入されました:
- マーケットレイヤー:高度なリスクパラメーターを備えた中核的なレンディングマーケット
- ボールトレイヤー:利回りを最適化する、キュレーター管理のボールト戦略
新しい担保資産のサポート(2025年)
| 資産 | 種類 | 備考 |
|---|---|---|
| nxSOL | LST | Nansen のリキッドステーキングトークン |
| Huma RWA | RWA | 実世界資産を裏付けとする担保 |
| JitoSOL | LST | Jito のリキッドステーキングトークン |
K-Lend V2 の機能(2025年第4四半期)
- モジュール型レンディング:RWA および機関投資家向けのユースケースに対応した分離型市場
- 強化されたリスクエンジン:清算パラメーターの改善
- マルチ担保ポジション:複数の資産を担保に借り入れ
ガバナンス(2026年第1四半期)
KMNO ステーカーによる分散型の意思決定が有効になり、トークン保有者は以下について投票できるようになります。
- 準備金のパラメーター
- 新規市場の上場
- プロトコル手数料
セキュリティのマイルストーン
- プロトコルの4回目の検証が完了(2025年10月)
- 150万ドルのバグ報奨金プログラムが実施中
リソース
- Kamino Finance のウェブサイト
- Kamino のドキュメント
- klend-sdk の GitHub
- kliquidity-sdk の GitHub
- scope-sdk の GitHub
- farms-sdk の GitHub
- Kamino の Discord
スキルの構成
kamino/
├── SKILL.md # This file
├── resources/
│ ├── klend-api-reference.md # Complete lending API
│ ├── kliquidity-api-reference.md # Complete liquidity API
│ ├── scope-api-reference.md # Oracle API reference
│ ├── reserve-configs.md # Reserve configurations
│ └── program-addresses.md # All program addresses
├── examples/
│ ├── lending/
│ │ ├── deposit-withdraw.md # Deposit & withdraw examples
│ │ ├── borrow-repay.md # Borrowing examples
│ │ ├── leverage.md # Multiply/leverage examples
│ │ └── liquidation.md # Liquidation bot example
│ ├── liquidity/
│ │ ├── strategy-management.md # Strategy operations
│ │ ├── deposits-withdrawals.md # LP operations
│ │ └── rebalancing.md # Rebalance strategies
│ └── oracle/
│ └── price-feeds.md # Oracle usage examples
├── templates/
│ ├── lending-setup.ts # Lending starter
│ ├── liquidity-setup.ts # Liquidity starter
│ └── full-integration.ts # Complete integration
└── docs/
├── troubleshooting.md # Common issues
└── advanced-patterns.md # Complex patterns
コメント
Markdown 対応