What is a Reserve?
AReserve represents a single asset lending market within Kamino Lending. Each reserve manages:
- Liquidity: The underlying asset being lent/borrowed (e.g., USDC, SOL)
- Collateral: Receipt tokens (cTokens) representing deposits
- Configuration: Interest rates, fees, and limits
- State: Borrowed amounts, utilization, and interest accrual
state/reserve.rs:61:
Reserve Liquidity
TheReserveLiquidity struct tracks the actual token supply and borrows (from state/reserve.rs:782):
Key Liquidity Metrics
Total Supply (fromstate/reserve.rs:932):
state/reserve.rs:977):
total_available_amount: Tokens in the supply vaultfreely_available_liquidity_amount(): Available minus queued withdrawals
Reserve Collateral (cTokens)
When users deposit liquidity, they receive collateral tokens (cTokens) that represent their share of the reserve. Fromstate/reserve.rs:1092:
Collateral Exchange Rate
The exchange rate between liquidity and collateral changes over time as interest accrues (fromstate/reserve.rs:1146):
state/reserve.rs:1185-1291):
collateral_to_liquidity(): Convert cTokens to underlying tokensliquidity_to_collateral(): Convert underlying tokens to cTokens- Ceiling and floor variants for precise accounting
cToken Model Benefits
- Automatic Yield: cToken value increases relative to underlying as interest accrues
- Composability: cTokens can be used in other DeFi protocols
- Gas Efficiency: No need to track individual deposit shares
- Precision: Exchange rate uses scaled fractions for accuracy
Reserve Configuration
TheReserveConfig struct defines all operational parameters (from state/reserve.rs:1313):
Reserve Fees
Fromstate/reserve.rs:1537:
Interest Rate Model
Kamino uses a piecewise linear borrow rate curve that adjusts rates based on utilization.BorrowRateCurve
Fromutils/borrow_rate_curve.rs:21:
Rate Calculation
The borrow rate is calculated by finding the curve segment containing the current utilization rate, then interpolating linearly (fromstate/reserve.rs:160):
Interest Accrual
Interest compounds continuously based on elapsed Solana slots (fromstate/reserve.rs:998):
Deposit and Borrow Limits
Deposit Limits
Fromstate/reserve.rs:692:
- Timestamp is recorded
- New deposits may be restricted based on market configuration
- Prevents excessive concentration in a single asset
Borrow Limits
Fromstate/reserve.rs:697:
borrow_limit: Total borrow cap for the reserveborrow_limit_outside_elevation_group: Cap for non-isolated borrowsborrow_limit_against_this_collateral_in_elevation_group[32]: Per-group caps
Withdraw Queue
For reserves with limited liquidity, a withdraw queue manages redemptions (fromstate/reserve.rs:834):
Borrow Factor
The borrow factor adjusts the debt value for risk management (fromstate/reserve.rs:1430):
- User borrows $100 of Asset A with 120% borrow factor
- Debt counts as $120 for LTV calculations
- Provides extra safety margin before liquidation
Reserve Status
Fromstate/reserve.rs:1502:
Key Reserve Functions
Depositing Liquidity
Borrowing
Redeeming Collateral
Best Practices
Setting Interest Rate Curves
Setting Interest Rate Curves
- Start with lower rates to encourage borrowing
- Increase rates sharply at high utilization (>80%) to maintain liquidity
- Leave headroom for flash loan spikes
- Monitor utilization and adjust curves over time
Configuring Limits
Configuring Limits
- Set deposit limits based on oracle quality and liquidity
- Borrow limits should account for liquidation capacity
- Use elevation groups for higher-risk assets
- Review limits during volatile market conditions
Managing Fees
Managing Fees
- Origination fees should cover gas costs for liquidations
- Protocol take rate typically 10-20% of interest earned
- Flash loan fees should be competitive but profitable
- Consider referral fees to incentivize protocol growth
Related Concepts
Obligations
Learn how user positions interact with reserves
Collateral & Liquidity
Understand LTV ratios and liquidation mechanics