This walkthrough takes you from zero to a working market with one reserve on Kamino’s staging environment. Staging runs the klend program on Solana mainnet under a separate program ID, so prices, oracles, and conditions match production while the market itself stays isolated from prod.Documentation Index
Fetch the complete documentation index at: https://kamino.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Want a fully isolated sandbox instead? Replace every
--staging flag below with --devnet to run against Solana devnet. Devnet is good for learning the CLI without any mainnet exposure; staging is the right target if you intend to graduate the same configuration to mainnet.Prerequisites
| Requirement | Why |
|---|---|
| Node.js + Yarn | The CLI is a TypeScript app shipped with klend-sdk |
Solana CLI (solana-keygen) | To create and inspect the admin keypair |
| A funded Solana wallet | To pay transaction fees and seed the first deposit |
| A Solana RPC endpoint | Public RPC works for staging; private RPC strongly recommended |
1. Clone and configure
.env file in the project root:
2. Create the market
--lending-market or --market.
3. Add a reserve
The repo includesconfigs/reserve_config_example.json as a starting point. For staging, USDC is a sensible first reserve.
--mint for each additional reserve.
4. Verify the market state
Download the full market and reserve config to confirm everything is wired up:./configs/{MARKET_ADDRESS}/. Open them and check:
- Market
lending_market_owneris your admin pubkey - Each reserve has
status: 0(Active) - Each reserve has a populated
tokenInfo.scopeConfiguration.priceFeed(or Pyth / Switchboard equivalent) depositLimitandborrowLimitare non-zero where you want activity
5. Test a deposit
Open the staging webapp scoped to your market:status is 0.
What you have now
A working market with one reserve, owned by your hot wallet, running against staging. The on-chain accounts are real; the program is real; the oracles are real. The only thing missing for production is multisig ownership.Next steps for going to production
Tune risk parameters
Replace the example config with values appropriate for the asset and your risk thesis. → Risk parameters
Configure oracles
Pick the right oracle source, set TWAP guards, configure staleness. → Configure oracles
Enable any optional features
Withdrawal queue, fixed rate reserves, borrow orders, eMode, permissioning — opt in per feature. → Withdrawal queue
Set up a Squads multisig
Production markets must be owned by a multisig. → Transfer to multisig
Common errors at this stage
| Error | Cause |
|---|---|
RPC rate limit / transaction failed | Use a private RPC (Helius, Triton, etc.). Public mainnet RPC is rate-limited. |
InvalidOracleConfig | The reserve’s tokenInfo doesn’t match a real oracle account. Run get-oracle-mappings to find the correct addresses. |
Reserve init failed: account already exists | Re-running add-asset-to-market with the same mint. Each mint can have only one reserve per market. |
Insufficient funds for transaction fee | The admin wallet is empty. Send a small amount of SOL. |