# Rehypothecation

Rehypothecation in Napier allows pools to deploy idle assets into external ERC-4626 vaults while keeping them fully usable for trading. This enables LPs to earn additional yield beyond swap fees, maximizing capital efficiency by reducing idle reserves and delivering dual income streams.

***

### Mechanism

* **Token-Specific Vaults**: Each side of the LP pair (Underlying and PT) can be rehypothecated independently into separate ERC-4626 vaults.
* **Independent Parameters**: For each token, the curator specifies:
  * **Vault Address** – The ERC-4626 vault to use (or zero address to disable).
  * **Min (ϕmin)** – Minimum ratio of raw tokens to total balance.
  * **Max (ϕmax)** – Maximum ratio of raw tokens to total balance.
  * **Target (ϕtarget)** – Target ratio of raw tokens to total balance.
  * **Lock Setting** – At deployment or afterward, curators can freeze either the vault choice or ratio conditions. Once frozen, these cannot be changed, ensuring transparency for LPs and minimizing trust assumptions.
* **Reserve Split**: A portion of reserves is kept as raw balance for swaps, while the remainder is deployed into the assigned vault.
  * Vault-deposited reserves remain available for trading, but withdrawals incur **additional gas costs and smart contract risks**.
* **Rebalancing**: After swaps, reserves are dynamically rebalanced between raw tokens and vault deposits according to curator-defined parameters.

***

### Benefits

* **For LPs**: Earn both trading fees and vault yield, boosting net returns.
* **For Curators**: Configure vault allowlists, allocation ratios, and freeze parameters, tailoring strategies to specific assets and risk profiles.
* **For Traders**: Just-in-time (JIT) rebalancing ensures sufficient liquidity for efficient execution without compromising depth.

***

### Supported Vaults

Yield-generating protocols that can be integrated for rehypothecation include (but are not limited to):

* Aave
* Euler
* Morpho
* Yearn
* Gearbox

***

### Example

In a **stETH/PT-stETH** pool, a curator may configure:

* ϕtarget = 20%
* ϕmin = 10%
* ϕmax = 30%

This means **20% of reserves are kept as raw stETH** for swaps, while the remainder is deployed into a Morpho vault.

If swaps reduce the raw balance below 10%, funds are withdrawn from the vault until the ratio is restored to 20%.


---

# 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://docs.napier.finance/learn/protocols/markets-napier-amm/rehypothecation.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.
