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
.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 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
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.