> For the complete documentation index, see [llms.txt](https://docs.maple.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maple.finance/technical-resources/pools/pool-accounting.md).

# Pool Accounting

## Total Pool Value (`totalAssets`)

The Pool Manager computes `totalAssets` as the Pool's cash, plus the value of its Open Term Loan Manager, plus its share of each Strategy Manager it funds:

$$
\begin{align} \nonumber totalAssets = cash + assetsUnderManagement\_{openTermLoanManager} + \sum{assetsOf\_{strategyManagers}} \end{align}
$$

For the [Open Term Loan Manager](https://docs.maple.finance/technical-resources/strategies/open-term-loans/open-term-loan-manager.md) the Pool Manager reads `assetsUnderManagement()`. For a [Strategy Manager](https://docs.maple.finance/technical-resources/strategies/strategy-manager.md), which several Pools share, it reads `assetsOf(poolManager)`, the Pool's share of the Strategy Manager's total assets in proportion to the shares the Pool Manager holds.

The Open Term Loan Manager's value is:

$$
\begin{align} \nonumber assetsUnderManagement = \sum\Big({outstandingPrincipal\_{loan}} + {outstandingInterest\_{loan}}\Big) \end{align}
$$

where:

$$
\begin{align} \nonumber outstandingInterest(t) = accountedInterest + \frac{issuanceRate \times (t - domainStart)}{PRECISION} \end{align}
$$

The Open Term Loan Manager stores `issuanceRate` scaled by `PRECISION`, which is `1e27`.

```mermaid
flowchart LR
    Pool -->|"totalAssets(), unrealizedLosses()"| PM[Pool Manager]
    PM -->|"assetsUnderManagement(), unrealizedLosses()"| OTLM[Open Term Loan Manager]
    PM -->|"assetsOf(pm), unrealizedLossesOf(pm)"| SM[Strategy Manager]
    SM -->|"assetsUnderManagement(), unrealizedLosses()"| US[Underlying Strategy]
```

## Unrealized Losses

`unrealizedLosses` is a paper loss: value the Pool expects to lose but has not yet written off. The Pool Manager sums each position's unrealized loss and caps the total at `totalAssets`:

$$
\begin{align} \nonumber unrealizedLosses = \min\Big(unrealizedLosses\_{openTermLoanManager} + \sum{unrealizedLossesOf\_{strategyManagers}},\ totalAssets\Big) \end{align}
$$

Two events raise it:

* The Pool Delegate or Governor impairs a loan on the Open Term Loan Manager, which adds the loan's principal and the interest accrued so far. See [Impairments](https://docs.maple.finance/technical-resources/strategies/open-term-loans/impairments.md).
* An Underlying Strategy records an impairment. Each Strategy Manager funding it reports the Pool's pro-rata share of that loss through `unrealizedLossesOf(poolManager)`.

While `unrealizedLosses` is above zero the Pool prices withdrawals at `totalAssets - unrealizedLosses` and deposits at `totalAssets`. This stops Lenders exiting ahead of a loss and stops new Lenders capturing the jump in value when an impairment is removed. [Exchange Rates](https://docs.maple.finance/technical-resources/pools/exchange-rates.md) explains the two rates and works through examples.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maple.finance/technical-resources/pools/pool-accounting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
