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
| Function | Returns | Description |
|---|
getSrLpPriceNetAsset() | bigint | Senior LP price as raw fixed-point NAV per raw Senior LP unit |
getJrLpPriceNetAsset() | bigint | Junior LP price as raw fixed-point NAV per raw Junior LP unit |
LP price uses the virtual-share formula:
lpPrice=⌊totalLpSupply+1effectiveNAV+1NAV⌋
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
| Function | Returns | Description |
|---|
getSrLpCapacity() | bigint | Senior LP capacity constrained by configured max supply and Junior coverage |
getJrLpCapacity() | bigint | Configured Junior max LP supply. 0n means uncapped |
getSrRemainingLpCapacity() | bigint | Remaining Senior LP capacity |
getJrRemainingLpCapacity() | bigint | null | Remaining Junior LP capacity, or null when uncapped |
getSrMaxCapacityNetAssetValue() | bigint | Max Senior capacity as raw fixed-point NAV |
getJrMaxCapacityNetAssetValue() | bigint | null | Max Junior capacity as raw fixed-point NAV, or null when uncapped |
getSrRemainingCapacityNetAssetValue() | bigint | Remaining Senior deposit room as raw fixed-point NAV |
getJrRemainingCapacityNetAssetValue() | bigint | null | Remaining Junior deposit room as raw fixed-point NAV, or null when uncapped |
getSrCoverageRemainingNetAssetValue() | bigint | Senior 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.