What is an Obligation?
AnObligation represents a user’s lending position in Kamino. It tracks:
- Deposits: Up to 8 different collateral types
- Borrows: Up to 5 different debt positions
- Health Metrics: LTV ratio, liquidation threshold, and borrow capacity
- Orders: Optional limit orders for automated position management
state/obligation.rs:28:
Obligation Initialization
Obligations are created per user per lending market (fromstate/obligation.rs:189):
Obligation Collateral (Deposits)
Each deposit slot tracks collateral in a specific reserve (fromstate/obligation.rs:579):
Managing Deposits
Adding Collateral (fromstate/obligation.rs:311):
state/obligation.rs:230):
Obligation Liquidity (Borrows)
Each borrow slot tracks debt in a specific reserve (fromstate/obligation.rs:635):
Cumulative Borrow Rate
The cumulative borrow rate tracks interest accrual. When a user borrows:- Reserve’s current
cumulative_borrow_rateis stored - As time passes, reserve’s rate increases
- User’s debt increases proportionally
state/obligation.rs:694):
Managing Borrows
Adding Debt (fromstate/obligation.rs:374):
state/obligation.rs:218):
Health Checks and LTV Calculations
Loan-to-Value (LTV) Ratio
The LTV ratio determines position health (fromstate/obligation.rs:201):
-
Deposited Value (
deposited_value_sf):- Sum of all collateral deposits valued in USD
- Updated during
refresh_obligation
-
Borrow Factor Adjusted Debt (
borrow_factor_adjusted_debt_value_sf):- Sum of all borrows × their borrow factors
- Borrow factor ≥ 100% creates safety buffer
Borrow Capacity
The allowed borrow value is calculated from deposits and their max LTV ratios (fromstate/obligation.rs:283):
Liquidation Threshold
The unhealthy borrow value uses liquidation thresholds instead of max LTV (fromstate/obligation.rs:212):
borrow_factor_adjusted_debt_value_sf > unhealthy_borrow_value_sf.
Maximum Withdrawable Collateral
When withdrawing, the obligation must remain healthy (fromstate/obligation.rs:246):
Liquidation Process
When an obligation becomes unhealthy (LTV > liquidation threshold), it can be liquidated.Liquidation Eligibility
Fromstate/obligation.rs:212:
Liquidation Mechanics
Liquidation Bonus: Liquidators receive a discount on the collateral they seize:Liquidation Example
Elevation Groups
Elevation groups create isolated lending markets with different risk parameters (fromstate/obligation.rs:59):
- Higher LTV for correlated assets (e.g., LSTs vs SOL)
- Risk isolation from main market
- Custom liquidation parameters per group
- Can only use debt reserve specified by the group
- Limited number of collateral types
- Cannot mix with non-group positions
Auto-Deleveraging
When a position approaches insolvency, it can be marked for auto-deleveraging (fromstate/obligation.rs:495):
Obligation Orders
Users can set limit orders for automated position management (fromstate/obligation.rs:769):
- Auto-deleverage when LTV > 70%
- Rebalance when debt/collateral price ratio changes
- Take profit at specific price levels
Best Practices
Position Management
Position Management
- Keep LTV below 60% for volatile assets
- Diversify collateral across multiple assets
- Monitor liquidation threshold, not just max LTV
- Set up obligation orders for automatic deleveraging
Risk Mitigation
Risk Mitigation
- Account for borrow factors when calculating capacity
- Leave buffer before liquidation threshold (10%+)
- Refresh obligations regularly to update prices
- Use elevation groups for correlated asset strategies
Gas Optimization
Gas Optimization
- Batch deposits and borrows when possible
- Close fully repaid borrow slots to free space
- Limit number of active positions (deposits + borrows)
- Use combined instructions (deposit + borrow in one tx)
Related Concepts
Reserves
Learn about reserve configuration and interest rates
Collateral & Liquidity
Deep dive into LTV calculations and liquidation mechanics