Skip to main content
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.
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

If you’re missing any of these, follow the CLI installation & setup page first.

1. Clone and configure

Create a .env file in the project root:
Generate or point to an admin keypair:

2. Create the market

The CLI returns a market address in its output. Save it; every subsequent command takes it as --lending-market or --market.
Always start a new operation with --mode inspect (prints a simulator URL) or --mode simulate (runs the simulation and prints the result). Switch to --mode execute once the dry run looks correct.

3. Add a reserve

The repo includes configs/reserve_config_example.json as a starting point. For staging, USDC is a sensible first reserve.
The example reserve config is a starting template. Before mainnet, replace it with a config tuned for the asset, oracle, and risk profile you actually want. See Risk parameters and Reserve config reference.
Repeat the command with a different --mint for each additional reserve.

4. Verify the market state

Download the full market and reserve config to confirm everything is wired up:
The CLI writes the configs to ./configs/{MARKET_ADDRESS}/. Open them and check:
  • Market lending_market_owner is your admin pubkey
  • Each reserve has status: 0 (Active)
  • Each reserve has a populated tokenInfo.scopeConfiguration.priceFeed
  • depositLimit and borrowLimit are non-zero where you want activity

5. Test a deposit

Open the staging webapp scoped to your market:
Connect a wallet that holds the asset, deposit, and confirm the position appears. If you don’t see the market, double-check the staging program flag and that the reserve 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

1

Tune risk parameters

Replace the example config with values appropriate for the asset and your risk thesis. → Risk parameters
2

Configure oracles

Pick the right oracle source, set TWAP guards, configure staleness. → Configure oracles
3

Enable any optional features

Withdrawal queue, fixed rate reserves, borrow orders, eMode, permissioning — opt in per feature. → Withdrawal queue
4

Set up a Squads multisig

Production markets must be owned by a multisig. → Transfer to multisig
5

Re-run on mainnet

Drop the --staging flag and re-run the create + add-reserve flow. The mainnet program ID KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD is the default.

Common errors at this stage

For a wider catalog of errors, see Troubleshooting.