<!--
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)
-->

# Integrate with River

River exposes two token surfaces for each class: the accumulating wrapper and the class token.

Most integrations should start with the wrapper. It is a single ERC-4626-style asset whose price
retains funded coupon. Integrate the class token directly when your product needs cash coupon
passthrough, async deposit requests, or exact class-level accounting.

| Use case | Integrate | Why |
| --- | --- | --- |
| Collateral asset, vault aggregation, treasury holding, yield tokenization | **Accumulating wrapper** (`DistributingVault4626`) | Single compounding price, synchronous wrap entry, standard read surface |
| Custody with income passthrough, direct tranche exposure, credit-note UX | **Class token** (`DistributingClassToken`) | Principal and coupon separated, async request flows, direct coupon claims |

## The three rules

### 1. Treat mutation flows as River-native

Standard ERC-4626 read functions are supported where relevant. River-native functions handle the
primary entry and exit paths.

On unavailable standard flows, `deposit`, `mint`, `withdraw`, or `redeem` can revert with
`SyncFlowDisabled`, and the matching `max*` function returns 0. Use the River-native functions
documented in the wrapper and class-token pages.

### 2. Use the conservative price for collateral

River intentionally separates entry and exit pricing.

`convertToAssets` is the conservative, collateral-safe read. Lending markets and liquidation
engines should use that value for collateral, while gross mint-side values include unrealized or
entrant-charged amounts.

See [Dual NAV & Exchange Rates](/accounting/dual-nav).

### 3. Get the right address allowlisted

Eligibility gates apply to the address performing the action. If your protocol receives tokens,
wraps, initiates exits, or routes deposits, your contract may need to be allowlisted for that
specific action.

Claims and cancels bypass gates, keeping funds already owed reachable.

## Function map

| Action | Wrapper | Class token |
| --- | --- | --- |
| Enter | `wrap(shares, receiver, minShares)` | `requestDeposit(assets, controller, owner)` |
| Exit | `requestUnwrap(shares, receiver, minCash)` | `requestRedeem(shares, controller, owner)` |
| Claim exit | `claimUnwrap(holder, receiver)` | `withdraw` / `redeem` against claimable balance |
| Cancel | `cancelUnwrap(receiver, ticket)` | `cancelDeposit(id)` / `cancelRedeem(ticket)` |
| Income | Retained in wrapper price | `claimCoupon(receiver)` |

## Next steps

* [Wrapper Integration](/integrate/wrapper) - recommended starting point for protocols
* [Class Token Integration](/integrate/class-token) - direct principal and coupon flows
* [Contract Addresses](/integrate/addresses)
