> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exponent.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Market State

> Read current TranchingMarket state, NAV, utilization, and size

Use these getters and fields to inspect current market state after loading a `TranchingMarket`.

## Usage

```typescript theme={null}
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

| Function                   | Returns  | Description                                                      |
| -------------------------- | -------- | ---------------------------------------------------------------- |
| `getSrNetAssetValue()`     | `bigint` | Senior raw NAV as a raw fixed-point value                        |
| `getSrEffNetAssetValue()`  | `bigint` | Senior effective NAV after the tranche waterfall                 |
| `getJrNetAssetValue()`     | `bigint` | Junior raw NAV as a raw fixed-point value                        |
| `getJrEffNetAssetValue()`  | `bigint` | Junior effective NAV after loss, recovery, and return allocation |
| `getMarketSize()`          | `bigint` | `Senior raw NAV + Junior raw NAV`                                |
| `getEffectiveMarketSize()` | `bigint` | `Senior effective NAV + Junior effective NAV`                    |

## State fields

| Field                                         | Description                                          |
| --------------------------------------------- | ---------------------------------------------------- |
| `state.marketState`                           | `Uninitialized`, `Active`, or `FixedTermRecovery`    |
| `state.statusFlags`                           | Bitmask of global market flags. `1` means paused     |
| `state.financials.utilization`                | Current utilization used by the return curve         |
| `state.financials.currentJuniorReturnShare`   | Last calculated Junior return share                  |
| `state.financials.twJuniorReturnShareAccrued` | Time-weighted Junior return share accumulator        |
| `state.financials.lastSyncTs`                 | Last timestamp when NAV was synced                   |
| `state.financials.lastDistributionTs`         | Last timestamp when distributable gain was allocated |
| `state.financials.fixedTermEndTs`             | Recovery window end timestamp, if active             |

<Note>
  `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.
</Note>
