Skip to main content
Use these getters and fields to inspect current market state after loading a TranchingMarket.

Usage

const market = await TranchingMarket.load(connection, marketAddress, env);

console.log("State:", market.state.marketState);
console.log("Paused flags:", market.state.statusFlags);
console.log("Senior raw NAV:", market.getSrNetAssetValue());
console.log("Senior effective NAV:", market.getSrEffNetAssetValue());
console.log("Junior raw NAV:", market.getJrNetAssetValue());
console.log("Junior effective NAV:", market.getJrEffNetAssetValue());
console.log("Market size:", market.getMarketSize());
console.log("Effective market size:", market.getEffectiveMarketSize());
console.log("Utilization:", market.state.financials.utilization);

Helpers

FunctionReturnsDescription
getSrNetAssetValue()bigintSenior raw NAV as a raw fixed-point value
getSrEffNetAssetValue()bigintSenior effective NAV after the tranche waterfall
getJrNetAssetValue()bigintJunior raw NAV as a raw fixed-point value
getJrEffNetAssetValue()bigintJunior effective NAV after loss, recovery, and return allocation
getMarketSize()bigintSenior raw NAV + Junior raw NAV
getEffectiveMarketSize()bigintSenior effective NAV + Junior effective NAV

State fields

FieldDescription
state.marketStateUninitialized, Active, or FixedTermRecovery
state.statusFlagsBitmask of global market flags. 1 means paused
state.financials.utilizationCurrent utilization used by the return curve
state.financials.currentJuniorReturnShareLast calculated Junior return share
state.financials.twJuniorReturnShareAccruedTime-weighted Junior return share accumulator
state.financials.lastSyncTsLast timestamp when NAV was synced
state.financials.lastDistributionTsLast timestamp when distributable gain was allocated
state.financials.fixedTermEndTsRecovery window end timestamp, if active
Number fields are fixed-point values with 1_000_000_000_000 as one unit. Use tranchingFromNumber or tranchingNumberToRaw for conversions. These helpers do not apply token mint decimals.