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

Usage

console.log("Senior LP price:", market.getSrLpPriceNetAsset());
console.log("Junior LP price:", market.getJrLpPriceNetAsset());
console.log("Senior LP capacity:", market.getSrLpCapacity());
console.log("Junior LP capacity:", market.getJrLpCapacity());
console.log("Senior remaining LP capacity:", market.getSrRemainingLpCapacity());
console.log("Junior remaining LP capacity:", market.getJrRemainingLpCapacity());
console.log("Senior remaining NAV capacity:", market.getSrRemainingCapacityNetAssetValue());
console.log("Junior remaining NAV capacity:", market.getJrRemainingCapacityNetAssetValue());

LP price helpers

FunctionReturnsDescription
getSrLpPriceNetAsset()bigintSenior LP price as raw fixed-point NAV per raw Senior LP unit
getJrLpPriceNetAsset()bigintJunior LP price as raw fixed-point NAV per raw Junior LP unit
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

FunctionReturnsDescription
getSrLpCapacity()bigintSenior LP capacity constrained by configured max supply and Junior coverage
getJrLpCapacity()bigintConfigured Junior max LP supply. 0n means uncapped
getSrRemainingLpCapacity()bigintRemaining Senior LP capacity
getJrRemainingLpCapacity()bigint | nullRemaining Junior LP capacity, or null when uncapped
getSrMaxCapacityNetAssetValue()bigintMax Senior capacity as raw fixed-point NAV
getJrMaxCapacityNetAssetValue()bigint | nullMax Junior capacity as raw fixed-point NAV, or null when uncapped
getSrRemainingCapacityNetAssetValue()bigintRemaining Senior deposit room as raw fixed-point NAV
getJrRemainingCapacityNetAssetValue()bigint | nullRemaining Junior deposit room as raw fixed-point NAV, or null when uncapped
getSrCoverageRemainingNetAssetValue()bigintSenior deposit room allowed by current Junior coverage, as raw fixed-point NAV
Senior capacity can be lower than maxSeniorLpSupply because Senior deposits also depend on available Junior coverage.