Skip to main content
Use these helpers to determine how much Senior or Junior capacity remains and how LP shares are priced.

Usage

In Rust, max_senior_lp_supply is only the configured Senior cap. Exact Senior capacity also depends on available Junior coverage. Use min_coverage, beta, raw NAV, effective NAV, and LP supply to mirror the capacity helper formulas below.

LP price helpers

LP price uses the virtual-share formula: lpPrice=effectiveNAV+1NAVtotalLpSupply+1\text{lpPrice} = \left\lfloor \frac{\text{effectiveNAV} + 1_{\text{NAV}}}{\text{totalLpSupply} + 1} \right\rfloor In SDK raw bigint values, 1_NAV is 1_000_000_000_000. This converts the fixed-point scale only. Apply token mint decimals separately when showing NAV or LP balances in a UI.

Capacity helpers

Senior capacity can be lower than maxSeniorLpSupply because Senior deposits also depend on available Junior coverage.