# Profit & Loss

A vault holds a single account balance and a single set of positions. Realized and unrealized PnL accrue to that one account, and the vault then attributes the change to its two share classes (LP and Manager) before any deposit or withdrawal touches the share count.

### Profit attribution

If PnL over a period is positive, the manager first takes a performance fee on profits above the vault's high-water mark. The remainder is split pro-rata between LP and Manager balances by their share of the previous period's total balance.

```
fee_eligible_profit  = max(current_equity - high_watermark, 0)
performance_fee      = fee_eligible_profit * manager_profit_share
remaining_pnl        = period_pnl - performance_fee

lp_ratio  = lp_balance      / (lp_balance + manager_balance)
mgr_ratio = manager_balance / (lp_balance + manager_balance)

lp_delta  = remaining_pnl * lp_ratio
mgr_delta = remaining_pnl * mgr_ratio + performance_fee

high_watermark = max(high_watermark, current_equity)
```

If `manager_profit_share` is unset it defaults to zero and no performance fee is taken.

#### Performance fee

The performance fee is charged only on equity above the previous all-time high (the "high-water mark", or HWM). If the vault has been at a loss since its last peak, no performance fee accrues until the prior peak has been recovered.

#### High-water mark

The HWM moves monotonically upward through trading PnL. It also tracks deposits and withdrawals so that they do not artificially trigger or skip the performance fee:

* On a deposit, the HWM increases by the deposit amount. New capital does not retroactively earn or pay performance fees on the prior peak.
* On a withdrawal, the HWM is reduced by the gross dollar amount paid out. The profit/loss of the vault is accounted for upon withdrawal with regard to calculating the HWM.

The HWM never moves down through trading. Drawdowns must be recovered before the manager earns another performance fee.

### Loss attribution

If PnL over a period is negative, the loss is split pro-rata between LP and Manager balances.

```
loss     = -period_pnl
lp_ratio = lp_balance / (lp_balance + manager_balance)
mgr_ratio = manager_balance / (lp_balance + manager_balance)

lp_delta  = -loss * lp_ratio
mgr_delta = -loss * mgr_ratio
high_watermark unchanged
```

### Worked example: profit period

A vault with `manager_profit_share = 0.20` starts a period at:

```
lp_balance      = 800
manager_balance = 200
lp_shares       = 800
manager_shares  = 200
high_watermark  = 1000
last_checked    = 1000
```

The vault trades to a new equity of `1100`. An LP deposits.

```
period_pnl           = 1100 - 1000 = +100
fee_eligible_profit  = max(1100 - 1000, 0) = 100
performance_fee      = 100 * 0.20 = 20
remaining_pnl        = 100 - 20 = 80
lp_ratio             = 0.8,  mgr_ratio = 0.2
lp_delta             = 80 * 0.8 = 64
mgr_delta            = 80 * 0.2 + 20 = 36

lp_balance      -> 864    (unchanged share count: 800)
manager_balance -> 236    (unchanged share count: 200)
high_watermark  -> 1100
last_checked    -> 1100
```

NAV per LP share rises from 1.00 to 1.08; NAV per Manager Share rises from 1.00 to 1.18 (the manager captured both their pro-rata profit and the 20 USDC performance fee).

### Worked example: loss period

A vault starts a period at:

```
lp_balance      = 800
manager_balance = 200
high_watermark  = 1000
last_checked    = 1000
```

The vault trades to a new equity of `900`.

```
loss       = 100
lp_ratio   = 0.8,  mgr_ratio = 0.2
lp_delta   = -80
mgr_delta  = -20

lp_balance      -> 720
manager_balance -> 180
high_watermark  -> 1000   (unchanged)
last_checked    -> 900
```

The HWM is unchanged, so the manager will not earn a performance fee until equity recovers above 1000.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pacifica.gitbook.io/docs/vaults/profit-and-loss.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
