> For the complete documentation index, see [llms.txt](https://docs.fira.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fira.money/developers/features/rehypothecation.md).

# Rehypothecation

The Rehypothecation Module controls how FW tokens balance between idle reserves and yield-generating vault deployments.

## Overview

FW tokens hold their underlying assets in two places: **idle reserves** (for instant redemptions) and an **ERC-4626 vault** (for yield generation). The RehypothecationModule defines the parameters that govern this balance.

{% hint style="info" %}
Rehypothecation ensures FW always has enough idle liquidity for redemptions while maximizing yield by deploying the rest into the underlying vault.
{% endhint %}

## How it works

The RehypothecationModule defines three parameters (in basis points):

| Parameter   | Purpose                                                                        |
| ----------- | ------------------------------------------------------------------------------ |
| `phiMin`    | Minimum idle ratio — if idle drops below this, assets are withdrawn from vault |
| `phiMax`    | Maximum idle ratio — if idle exceeds this, excess is deposited into vault      |
| `phiTarget` | Target idle ratio — used by `forceRehypothecation()` to rebalance              |

### Triggering rebalance

* **`triggerRehypothecation()`** — Callable by anyone. Deposits excess to vault if `idleRatio > phiMax`, or withdraws from vault if `idleRatio < phiMin`. No-ops if the ratio is within bounds.
* **`forceRehypothecation()`** — Owner-only. Always rebalances to `phiTarget` regardless of current ratio.

### Example

If `phiMin = 10%`, `phiMax = 30%`, `phiTarget = 20%`:

* FW holds 100 USDC total, 5 USDC idle (5% idle ratio → below `phiMin`)
* Anyone calls `triggerRehypothecation()` → vault withdraws USDC to bring idle up
* After rebalance: \~20 USDC idle, \~80 USDC in vault

## Key features

* **Automatic yield optimization** — Excess idle funds are deployed for yield
* **Redemption guarantees** — Minimum idle ratio ensures users can always redeem
* **Permissionless triggers** — Anyone can call `triggerRehypothecation()` when out of bounds
* **Owner-controlled force rebalance** — Protocol can rebalance to target at any time

## Related contracts

* [`RehypothecationModule.sol`](/developers/protocol-contracts/rehypothecation-module.md) — Contract details
* [`FWBase.sol`](/developers/token-contracts/fw-tokens.md) — FW base contract that uses the module


---

# 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.fira.money/developers/features/rehypothecation.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.
