<!--
Sitemap:
- [Welcome to River](/index)
- [Asset-Backed Finance Primer](/concepts/finance-primer)
- [River for Lenders](/lenders/introduction)
- [Depositing](/lenders/depositing)
- [Earning: the Coupon](/lenders/earning)
- [The Accumulating Wrapper](/lenders/wrapper)
- [Withdrawals & Exits](/lenders/withdrawals)
- [Losses & Impairments](/lenders/losses)
- [FAQ](/lenders/faq)
- [Integrate with River](/integrate/get-started)
- [Wrapper Integration](/integrate/wrapper)
- [Class Token Integration](/integrate/class-token)
- [Contract Addresses](/integrate/addresses)
- [Protocol Architecture](/architecture)
- [Actors: Roles & Permissions](/technical/actors)
- [Proxies & Upgradeability](/technical/proxies)
- [Strategies & Reporters](/technical/strategies)
- [Glossary](/concepts/glossary)
- [Dual NAV & Exchange Rates](/accounting/dual-nav)
- [Settlement & Conservation](/accounting/settlement)
- [The Coupon Ledger](/accounting/coupon-ledger)
- [Wrapper Accounting](/accounting/wrapper)
- [Accounting Examples](/accounting/examples)
- [The Tiered Waterfall](/waterfall/)
- [Waterfall Scenarios](/waterfall/scenarios)
- [Security Model](/security)
- [Protocol Invariants](/technical/invariants)
- [List of Assumptions](/technical/assumptions)
- [External Entry Points](/technical/entry-points)
- [Governance](/governance)
- [Contract Reference](/reference/contracts)
- [River Engineering Standards](/reference/engineering-standards)
-->

# Accounting Examples

Scenario walkthroughs showing how value is represented across the system. State blocks show
before/after; all numbers are exact unless marked ≈ (virtual-share rounding dust, always in the
pool's favor).

## Example 1: fair deposit and exit pricing

```
Senior class: NAV 104, supply 100 (PPS 1.04 after some earned performance).

New lender requests 52, servicer accepts:
  shares minted = 52 / 1.04 = 50          (optimistic price — no discount)

  NAV     104 → 156
  supply  100 → 150
  PPS     1.04 → 1.04                     existing lenders unmoved ✓

Same lender exits all 50 later, price unchanged:
  fill pays = 50 × 1.04 = 52              (conservative price)

  NAV     156 → 104,  supply 150 → 100,  PPS 1.04 ✓
```

## Example 2: impairment window — both doors protected

```
NAV 1100 / supply 1000. Servicer marks expected loss 500.

                     optimistic     conservative
  before                 1.10             1.10
  impaired               1.10             0.60
  after 300 written off  0.80             0.80

During the impaired window:
  → an exit of 100 shares pays 60: loss marks are reflected before exit.
  → a deposit of 110 mints 100 shares: unresolved recovery stays with the
    lenders who held the risk. When 200 of the mark releases, the write-up
    accrues to those lenders.
```

## Example 3: coupon interval with a funding shortfall

```
Supply 200 (Alice 100, Bob 100).

accrue 6 over the month     Alice display-accrued 3, Bob 3. Nothing claimable.
fund 4.5                    rho = 4.5 / 6 = 0.75
                            Alice claimable 2.25, Bob 2.25 — total = cash funded ✓
                            Principal untouched; next interval starts clean.
```

## Example 4: wrapper — mid-interval entrant pays full freight

```
Wrapper: supply 200 (Alice, Bob), holds 200 class shares at par. totalAssets 200.

Class token accrues 10 (unfunded)      totalAssets still 200 (realized-only)
                                       grossTotalAssets = 210

Carol wraps 100 of value:
  shares = 100 × 200 / 210 ≈ 95.24     (gross price — she pays for the accrual)

Class token funds the 10:
  totalAssets = 300 + 10 = 310, supply ≈ 295.24 → PPS ≈ 1.05

  Alice: 100 sh × 1.05 = 105  ✓ kept her full coupon
  Carol:  95.24 × 1.05 = 100  ✓ exactly what she paid — the step was a wash
```

Without gross pricing Carol would have minted 100 shares and skimmed ~3.3 of Alice and Bob's
coupon.

## Example 5: wrapper — atomic income skim, rationed

```
Alice holds 100 wrapper shares worth 105 (5 of funded coupon in the price).
Her cash ration: 5.

requestUnwrap(4 shares, minCash = 4.2):
  owed value  = 4 × 1.05 = 4.2  ≤ ration → fully cash-settled
  → 4.2 cash paid instantly, ticket 0, nothing queued
  ration 5 → 0.8 · remaining 96 shares still worth 1.05 each ✓

requestUnwrap(4 shares) again immediately:
  cash leg = min(4.2, ration 0.8) = 0.8 → the remaining 3.4 queues
  → the ration is consumed once, preventing a double-skim.
```

## Example 6: queued exit keeps earning, then a loss reprices the fill

```
Alice queues a class-token exit of 100 shares at PPS 1.00 (lock-in-place).

Month passes: coupon accrues and funds → her locked shares earned their coupon
like everyone else's (claimable on the class token as usual).

Before her fill, a loss marks conservative NAV down 10%:
  fill pays 100 × 0.90 = 90 — she bears NAV drift while queued (both directions),
  and her month of coupon remains untouched: income and principal stay separate.
```

For waterfall-specific allocations (multi-tier stacks, recoveries after exits), see
[Waterfall Scenarios](/waterfall/scenarios).
