Skip to main content
The Obligation account represents a user’s lending position, tracking all deposited collateral and borrowed assets. Each user can have multiple obligations per lending market.

Obligation

tag
u64
Unique identifier tag for the obligation
last_update
LastUpdate
Last update tracking slot and staleness
lending_market
Pubkey
Parent lending market this obligation belongs to
owner
Pubkey
Authority that owns this obligation and can manage it
deposits
ObligationCollateral[8]
Array of deposited collateral positions (max 8 different assets)
lowest_reserve_deposit_liquidation_ltv
u64
Lowest liquidation LTV among all deposited reserves
deposited_value_sf
u128
Total deposited value in quote currency (scaled fraction)
borrows
ObligationLiquidity[5]
Array of borrowed positions (max 5 different assets)
borrow_factor_adjusted_debt_value_sf
u128
Total debt value adjusted by borrow factors (scaled fraction)
borrowed_assets_market_value_sf
u128
Total borrowed assets market value without borrow factor adjustment (scaled fraction)
allowed_borrow_value_sf
u128
Maximum allowed borrow value based on deposits and LTV (scaled fraction)
unhealthy_borrow_value_sf
u128
Borrow value threshold at which position becomes liquidatable (scaled fraction)
elevation_group
u8
Elevation group ID this obligation belongs to (0 = no elevation group)
num_of_obsolete_deposit_reserves
u8
Count of deposits in obsolete reserves
has_debt
u8
Boolean flag indicating if obligation has any outstanding debt
referrer
Pubkey
Referrer account eligible for referral fees
borrowing_disabled
u8
Boolean flag disabling borrowing for this specific obligation
autodeleverage_target_ltv_pct
u8
Target LTV percentage for autodeleverage operations
lowest_reserve_deposit_max_ltv_pct
u8
Lowest max LTV percentage among all deposited reserves
num_of_obsolete_borrow_reserves
u8
Count of borrows from obsolete reserves
highest_borrow_factor_pct
u64
Highest borrow factor percentage among all borrows
autodeleverage_margin_call_started_timestamp
u64
Unix timestamp when autodeleverage margin call started (0 = not marked)
obligation_orders
ObligationOrder[2]
Array of limit orders for automated position management
borrow_order
BorrowOrder
Active borrow order for this obligation

Key Health Metrics

Loan-to-Value (LTV)

Calculated as: borrow_factor_adjusted_debt_value / deposited_value

Health Status

  • Healthy: LTV < allowed LTV (can borrow more)
  • Unhealthy: LTV >= liquidation threshold (liquidatable)
  • Margin Call: Marked for autodeleverage

Remaining Borrow Capacity

Calculated as: allowed_borrow_value - borrow_factor_adjusted_debt_value

Constraints

  • Maximum 8 different collateral deposits
  • Maximum 5 different asset borrows
  • Maximum 2 obligation orders (limit orders)
  • Maximum 1 active borrow order

Account Size

The Obligation account has a fixed size of 1784 bytes (OBLIGATION_SIZE).

Common Operations

Deposit Collateral

Adds collateral to the deposits array, increasing deposited_value_sf and allowed_borrow_value_sf.

Borrow

Adds or increases a borrow in the borrows array, increasing borrowed_amount_sf and borrow_factor_adjusted_debt_value_sf.

Repay

Reduces borrowed amount, potentially removing the borrow entry if fully repaid.

Withdraw

Removes collateral, potentially closing the deposit position if fully withdrawn.

Liquidate

Liquidator repays part of debt and receives discounted collateral when position is unhealthy.

Build docs developers (and LLMs) love