bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 12쪽
ino Manager CLI
The Kamino Manager CLI is a command-line tool for creating and managing Kamino lending markets, reserves, and vaults.
## Prerequisites
Before installing the Kamino Manager CLI:
<Note>
Node.js, Yarn package manager, and Solana CLI tools are required to run the Kamino Manager CLI.
</Note>
## Installation
Follow these steps to install and configure the Kamino Manager CLI:
<Steps>
<Step title="Install Node.js and Yarn">
Install Node.js from [nodejs.org](https://nodejs.org/), then install Yarn package manager.
```bash theme={null}
npm install -g yarn
```
</Step>
<Step title="Install Solana CLI">
Install the Solana CLI tools to create and manage keypairs.
```bash theme={null}
sh -c "$(curl -sSfL https://release.solana.com/v1.18.18/install)"
```
<Warning>
After installation, restart the terminal to ensure the Solana CLI is available in PATH.
</Warning>
</Step>
<Step title="Clone and Setup Kamino Manager">
Clone the Kamino SDK repository and install dependencies.
```bash theme={null}
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.
</Step>
</Steps>
## Configuration
After installation, configure the Kamino Manager CLI with a wallet and RPC endpoint.
<Steps>
<Step title="Create Admin Keypair">
Create a new keypair that will serve as the admin account for managing markets and vaults.
```bash theme={null}
solana-keygen new -o admin.json
```
<Warning>
Store the keypair file securely and never share it. This keypair will need SOL for transaction fees.
</Warning>
<Note>
Existing keypairs can be used instead of creating a new one. Specify the path to the existing keypair file in the configuration.
</Note>
</Step>
<Step title="Configure Environment Variables">
Create a `.env` file in the `klend-sdk` directory and configure the following variables:
```bash theme={null}
# 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"
```
<Note>
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.
</Note>
</Step>
<Step title="Fund Your Admin Account">
Transfer SOL to the admin account to pay for transaction fees. Get the admin account address:
```bash theme={null}
solana-keygen pubkey admin.json
```
Transfer SOL to this address from another wallet or acquire it from an exchange.
</Step>
</Steps>
## Verify Installation
Run a simple command to verify everything is set up correctly:
```bash theme={null}
yarn run kamino-manager --help
```
The help output should display available commands for managing markets and vaults.
## Next Steps
The Kamino Manager CLI is now installed and ready for managing markets and vaults:
<CardGroup>
<Card title="Market Operations" icon="coins" href="/docs/build/cli/market-operations">
Create and manage lending markets and reserves
</Card>
<Card title="Vault Operations" icon="chart-line" href="/docs/build/cli/vault-operations">
Create and manage Kamino vaults
</Card>
</CardGroup>
# Market Operations
Source: https://kamino.com/docs/build/cli/market-operations
kamino-manager CLI command reference for market and reserve operations
A flat reference of every `kamino-manager` command that touches a Kamino lending market or reserve. For workflow guidance — when to use each command, what to set, why — see the [Curator Markets](/docs/curators/markets) tab.
<Note>
Before running any command, complete the [Installation & Setup](/docs/build/cli/installation-setup) guide. The CLI requires `ADMIN`, `RPC`, `KLEND_PROGRAM_ID_MAINNET`, and `KLEND_PROGRAM_ID_STAGING` in `.env`.
</Note>
## Conventions
### Execution modes
Every command supports `--mode <value>`:
| Mode | What it does |
| - | - |
| `inspect` | Prints a Solana Explorer URL where you can simulate the transaction in your browser |
| `simulate` | Runs simulation server-side and prints the result |
| `execute` | Signs with the admin keypair and lands the transaction |
| `multisig` | Outputs a base58-encoded transaction for submission to a Squads proposal |
Multisig mode requires `--multisig <SQUADS_PUBKEY>` to identify the multisig.
### Network selection
| Flag | Target | Program ID env var |
| - | - | - |
| (none) | Mainnet | `KLEND_PROGRAM_ID_MAINNET` |
| `--staging` | Staging program on Solana mainnet | `KLEND_PROGRAM_ID_STAGING` |
| `--devnet` | Solana devnet | (Devnet program ID resolved from env) |
## Market lifecycle
### `create-market`
Initialize a new `LendingMarket` account.
```bash theme={null}
yarn kamino-manager create-market --mode execute
```
| Flag | Required | Description |
| - | - | - |
| `--mode` | Yes | `inspect` / `simulate` / `execute` / `multisig` |
| `--multisig` | If `--mode multisig` | Pubkey of the multisig that will own the market |
| `--staging` / `--devnet` | No | Network selection |
### `update-lending-market-from-config`
Apply a full market config update from a JSON file.
```bash theme={null}
yarn kamino-manager update-lending-market-from-config \
--lending-market <MARKET_ADDRESS> \
--lending-market-config-path ./configs/<MARKET>/market-<MARKET>.json \
--mode execute
```
| Flag | Required | Description |
| - | - | - |
| `--lending-market` | Yes | Market address |
| `--lending-market-config-path` | Yes | Path to the JSON config file |
| `--mode` | Yes | Execution mode |
### `update-lending-market-name`
Focused command to rename a market.
```bash theme={null}
yarn kamino-manager update-lending-market-name \
--lending-market <MARKET_ADDRESS> \
--new-name "My Market" \
--mode execute
```
| Flag | Required |
| - | - |
| `--lending-market` | Yes |
| `--new-name` | Yes |
| `--mode` | Yes |
### `update-lending-market-owner`
Promote `lending_market_owner_cached` to active owner. Final step of the two-step ownership transfer.
```bash theme={null}
yarn kamino-manager update-lending-market-owner \
--lending-market <MARKET_ADDRESS> \
--mode multisig \
--multisig <NEW_OWNER_MULTISIG>
```
| Flag | Required |
| - | - |
| `--lending-market` | Yes |
| `--mode` | Yes |
| `--multisig` | If `--mode multisig` |
### `download-lending-market-config`
Export the current market config to a JSON file (read-only).
```bash theme={null}
yarn kamino-manager download-lending-market-config \
--lending-market <MARKET_ADDRESS>
```
Saves to `./configs/<MARKET_ADDRESS>/market-<MARKET_ADDRESS>.json`.
### `download-lending-market-config-and-all-reserves-configs`
Download the market config plus every reserve's config in a single call.
```bash theme={null}
yarn kamino-manager download-lending-market-config-and-all-reserves-configs \
--lending-market <MARKET_ADDRESS>
```
### `get-market-or-vault-admin-info`
Query admin metadata (owner, cached owner, emergency council).
```bash theme={null}
yarn kamino-manager get-market-or-vault-admin-info \
--address <MARKET_ADDRESS>
```
## Reserve lifecycle
### `add-asset-to-market`
Add a new reserve to a market with an initial config.
```bash theme={null}
yarn kamino-manager add-asset-to-market \
--market <MARKET_ADDRESS> \
--mint <TOKEN_MINT> \
--mint-program-id TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA \
--reserve-config-path ./configs/my_reserve_config.json \
--mode execute
```
| Flag | Required | Description |
| - | - | - |
| `--market` | Yes | Market address |
| `--mint` | Yes | Token mint address |
| `--mint-program-id` | Yes | `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` for SPL Token, `TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb` for Token-2022 |
| `--reserve-config-path` | Yes | Path to the reserve config JSON |
| `--mode` | Yes | Execution mode |
### `update-reserve-config`
Apply a full reserve config update from a JSON file.
```bash theme={null}
yarn kamino-manager update-reserve-config \
--reserve <RESERVE_ADDRESS> \
--reserve-config-path ./configs/<RESERVE>.json \
--mode execute
```
| Flag | Required |
| - | - |
| `--reserve` | Yes |
| `--reserve-config-path` | Yes |
| `--mode` | Yes |
### `update-reserve-config-debt-cap`
Focused update of just the borrow cap. Faster to review than a full config update.
```bash theme={null}
yarn kamino-manager update-reserve-config-debt-cap \
--reserve <RESERVE_ADDRESS> \
--mode multisig \
--multisig <SQUADS_PUBKEY>
```
| Flag | Required |
| - | - |
| `--reserve` | Yes |
| `--mode` | Yes |
| `--multisig` | If `--mode multisig` |
### `download-reserve-config`
Export the current reserve config to a JSON file.
```bash theme={null}
yarn kamino-manager download-reserve-config \
--reserve <RESERVE_ADDRESS> \
--output ./configs/<RESERVE_ADDRESS>.json
```
| Flag | Required |
| - | - |
| `--reserve` | Yes |
| `--output` | No (defaults to a path under `./configs/`) |
### `simulate-reserve-apy`
Compute the live supply and borrow APY for a reserve from on-chain state.
```bash theme={null}
yarn kamino-manager simulate-reserve-apy \
--reserve <RESERVE_ADDRESS>
```
## Oracles
### `get-oracle-mappings`
List Scope, Pyth, and Switchboard oracle addresses for known mints.
```bash theme={null}
yarn kamino-manager get-oracle-mappings
```
Use the output to populate `tokenInfo.scopeConfiguration.priceFeed`, `tokenInfo.pythConfiguration.price`, or `tokenInfo.switchboardConfiguration.priceAggregator` in a reserve config.
## Farms
### `get-reserve-farms-apy`
Reward APY for a reserve's collateral and debt farms.
```bash theme={null}
yarn kamino-manager get-reserve-farms-apy \
--reserve <RESERVE_ADDRESS>
```
For farm initialization, funding, and emission configuration, use the [KFarms tooling](https://github.com/Kamino-Finance/kfarms).
## Reserve config schema
The reserve config JSON schema is documented at [Reserve config reference](/docs/curators/markets/reserve-parameters). A starter file ships with klend-sdk:
<a href="https://github.com/Kamino-Finance/klend-sdk/blob/master/configs/reserve_config_example.json">
<Icon icon="github" /> klend-sdk/configs/reserve\_config\_example.json
</a>
Some fields in older example files (`assetTier`, `multiplierSideBoost`, `multiplierTagBoost`) are deprecated and ignored by the program. The canonical schema is in the reference page above.
## Market config schema
The market config JSON schema is documented at [Market config reference](/docs/curators/markets/market-config-reference).
## Workflow guides
These pages walk through the curator workflow that uses the commands above:
<CardGroup>
<Card title="Create a market" icon="circle-plus" href="/docs/curators/markets/creating-a-market">
`create-market`
</Card>
<Card title="Add reserves" icon="layer-group" href="/docs/curators/markets/adding-reserves">
`add-asset-to-market`
</Card>
<Card title="Configure oracles" icon="signal-stream" href="/docs/curators/markets/configuring-oracles">
`get-oracle-mappings`, `tokenInfo` setup
</Card>
<Card title="Transfer to multisig" icon="key" href="/docs/curators/markets/transfer-to-multisig">
`update-lending-market-from-config`, `update-lending-market-owner`
</Card>
<Card title="Updating reserves" icon="rotate" href="/docs/curators/markets/reserve-management">
`update-reserve-config`, `update-reserve-config-debt-cap`
</Card>
<Card title="Market settings" icon="sliders" href="/docs/curators/markets/market-settings">
`update-lending-market-from-config`, `update-lending-market-name`
</Card>
</CardGroup>
## Next
<CardGroup>
<Card title="Vault Operations" icon="chart-line" href="/docs/build/cli/vault-operations">
Create and manage Kamino vaults
</Card>
<Card title="Installation & Setup" icon="download" href="/docs/build/cli/installation-setup">
Review installation and configuration
</Card>
</CardGroup>
# Vault Operations
Source: https://kamino.com/docs/build/cli/vault-operations
Create and manage Kamino vaults
Use the Kamino Manager CLI to create vaults, manage reserve allocations, and configure vault parameters.
<Note>
Before starting, complete the [Installation & Setup](/docs/build/cli/installation-setup) guide. Commands require a .env file with ADMIN (path to vault owner keypair) and RPC configured.
</Note>
## 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
<Note>
It's recommended to always start with `inspect` or `simulate` mode to verify transactions before running with `execute`.
</Note>
## 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
```bash theme={null}
# Mainnet (default, no flag needed)
yarn kamino-manager create-vault --mint <TOKEN_MINT> --mode execute
# Staging
yarn kamino-manager create-vault --mint <TOKEN_MINT> --mode execute --staging
# Devnet
yarn kamino-manager create-vault --mint <TOKEN_MINT> --mode execute --devnet
```
<Note>
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](/docs/build/cli/installation-setup) guide.
</Note>
## Create a New Vault
Create a new Kamino vault to manage automated liquidity strategies.
<Steps>
<Step title="Create Vault">
Run the create vault command with the desired liquidity token mint.
```bash theme={null}
yarn kamino-manager create-vault --mint <TOKEN_MINT> --mode execute
```
<Note>
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.
</Note>
</Step>
<Step title="Save Vault Address">
After creation, save the vault address from the command output. This address is required for all subsequent vault operations.
</Step>
</Steps>
## Manage Reserve Allocations
Configure how vault assets are distributed across different lending reserves.
### Add or Update Reserve Allocation
Add a new reserve to the vault or update an existing reserve's allocation parameters.
```bash theme={null}
yarn kamino-manager update-vault-reserve-allocation \
--vault <VAULT_ADDRESS> \
--reserve <RESERVE_ADDRESS> \
--allocation-weight <WEIGHT> \
--allocation-cap <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
```bash theme={null}
yarn kamino-manager update-vault-reserve-allocation \
--vault 67dqmR76uAbjX6e81A1ganKv3ou31WUMEdeWJkwVfeXy \
--reserve 9GJ9GBRwCp4pHmWrQ43L5xpc9Vykg7jnfwcFGN8FoHYu \
--allocation-weight 100000 \
--allocation-cap 18446744073709.551615 \
--mode simulate
```
<Note>
First run with `--mode simulate` to verify the operation works as expected, then use `--mode execute` to send the transaction.
</Note>
### Remove Reserve Allocation
Remove a reserve from the vault's allocation strategy.
```bash theme={null}
yarn kamino-manager remove-vault-allocation \
--vault <VAULT_ADDRESS> \
--reserve <RESERVE_ADDRESS> \
--mode simulate
```
**Example:** Removing USDC reserve from fartcoin market
```bash theme={null}
yarn kamino-manager remove-vault-allocation \
--vault 67dqmR76uAbjX6e81A1ganKv3ou31WUMEdeWJkwVfeXy \
--reserve F22tnLsbv66vEU2GZRc7coaqZsr8UcBbyp9V2kqWAiWK \
--mode simulate
```
## Vault Ownership Management
<Note>
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.
</Note>
<Steps>
<Step title="Set Pending Admin">
Update the vault's pending admin to the new owner address.
```bash theme={null}
yarn kamino-manager update-vault-pending-admin \
--vault <VAULT_ADDRESS> \
--new-admin <NEW_ADMIN_PUBKEY> \
--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)
</Step>
<Step title="Accept Ownership">
The new admin must accept ownership to complete the transfer.
```bash theme={null}
yarn kamino-manager accept-ownership \
--vault <VAULT_ADDRESS> \
--mode execute
```
<Note>
This command must be run with the new admin's keypair in the ADMIN field of the .env file.
</Note>
</Step>
</Steps>
## Fee Management
Configure and manage vault performance and management fees.
### Performance Fees
Set the performance fee taken on generated yield.
```bash theme={null}
yarn kamino-manager update-vault-perf-fee \
--vault <VAULT_ADDRESS> \
--fee-bps <FEE_BPS> \
--mode execute
```
The fee is specified in basis points (1 bps = 0.01%).
### Management Fees
Set the yearly management fee for vault operations.
```bash theme={null}
yarn kamino-manager update-vault-mgmt-fee \
--vault <VAULT_ADDRESS> \
--fee-bps <FEE_BPS> \
--mode execute
```
### Withdraw Pending Fees
Withdraw accumulated fees from the vault.
```bash theme={null}
yarn kamino-manager withdraw-pending-fees \
--vault <VAULT_ADDRESS> \
--mode execute
```
### 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.
```bash theme={null}
yarn kamino-manager give-up-pending-fees \
--vault <VAULT_ADDRESS> \
--max-amount-to-give-up <TOKEN_AMOUNT> \
--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
## Advanced Operations
### Multisig Management
For multisig-controlled vaults, use the `--mode multisig` flag to generate Base58-encoded transactions for proposal submission.
```bash theme={null}
yarn kamino-manager update-vault-reserve-allocation \
--vault <VAULT_ADDRESS> \
--reserve <RESERVE_ADDRESS> \
--allocation-weight <WEIGHT> \
--allocation-cap <CAP> \
--mode multisig \
--multisig <MULTISIG_PUBKEY>
```
<Note>
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.
</Note>
## Next Steps
<CardGroup>
<Card title="Market Operations" icon="coins" href="/docs/build/cli/market-operations">
Create and manage lending markets and reserves
</Card>
<Card title="Installation & Setup" icon="download" href="/docs/build/cli/installation-setup">
Review installation and configuration
</Card>
</CardGroup>
# API vs SDK vs Rust Crate
Source: https://kamino.com/docs/build/developers/api-vs-sdk
Access data and build transactions through the API, the TypeScript SDK, or the Rust interface crate
## Overview
Kamino provides three integration options:
| Option | Description |
| - | - |
| R프로젝트로 돌아가기