> 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

## 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 dynamically by asking a question.

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

```
GET https://docs.fira.money/developers/features/rehypothecation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
