# Fees & Gas Economics

Morfa charges **zero deposit fees**, **zero withdrawal fees**, and **zero management fees**. Fees differ cleanly between Mode B and Mode A to match each mode's architecture.

## Side-by-Side Fee Structure

| Fee Type | Mode B: Morfa Vault (`mfUSDC`) | Mode A: Direct Wallet (`MorfaRebalancer`) |
| --- | --- | --- |
| **Deposit fee** | `0%` | `0%` |
| **Withdrawal / Redeem fee** | `0%` | `0%` |
| **Management fee** | `0%` | `0%` |
| **Performance fee** | **`5%` of earned native USDC yield only** | `0%` |
| **Rebalance fee** | `0%` | **`5 bps` (`0.05%`)** of moved principal on completed rebalances |
| **Emergency `WithdrawOnly` evacuation fee** | `0%` | **`0 bps` (`0%`)**, enforced on-chain |
| **On-chain maximum fee ceiling** | Governed by Morpho Vault V2 fee controls | **`100 bps` (`1.00%`)** immutable constant (`MAX_FEE_BPS`) |
| **Personal on-chain fee cap** | N/A (global vault rate) | User sets `maxFeeBps` + rolling 30-day `periodFeeCap` |
| **Fee collection mechanism** | Native Vault V2 share-minting on accrued yield to Owner (`0x9f28...F0d8`) | Pull-based (`claimFees()`) to `feeRecipient` (`0x9f28...F0d8`); floor-rounded |

:::info[Fee Reductions vs. Increases on `MorfaRebalancer`]
On `MorfaRebalancer.sol`, lowering `feeBps` via `reduceFeeBps(...)` takes effect **immediately** (and cancels any pending increase). Raising `feeBps` or changing `feeRecipient` is locked behind an immutable **`48-hour` on-chain timelock** (`TIMELOCK_DELAY`) and can never exceed either `MAX_FEE_BPS = 100` (`1.00%`) or your own personal `maxFeeBps` guardrail.
:::

***

## Worked Numerical Examples

The tables below illustrate how fees compare on **`$1,000 USDC`** and **`$100,000 USDC`** over one year under a **hypothetical illustrative scenario** of `6.00%` gross native USDC APY and `4` completed Mode A rebalances per year.

:::note[Illustrative Numbers Only]
These figures are arithmetic illustrations to show how each fee formula works, **not** a yield forecast or expected rebalance cadence. Actual DeFi rates and rebalance frequencies vary continuously with market conditions.
:::

### Example 1: `$1,000 USDC` Deposit

| Metric (1 Year, Hypothetical `6.00%` Gross Native APY) | Mode B: Morfa Vault (`5%` perf fee) | Mode A: Direct Wallet (`5 bps` × `4` moves) |
| --- | --- | --- |
| Starting principal | `$1,000.00` | `$1,000.00` |
| Gross native yield (illustrative `6.00%`) | `$60.00` | `$60.00` |
| Morfa protocol fee | `$3.00` (`5%` of `$60.00`) | `$2.00` (`0.05%` × `$1,000` × `4` moves) |
| **Illustrative net native yield after fee** | **`$57.00`** (`5.70%` net) | **`$58.00`** (`5.80%` net) |
| Mode A 30-day `periodFeeCap` impact (default `$25`) | N/A | `$0.50` per rebalance (well below `$25` / 30d cap) |

### Example 2: `$100,000 USDC` Deposit

| Metric (1 Year, Hypothetical `6.00%` Gross Native APY) | Mode B: Morfa Vault (`5%` perf fee) | Mode A: Direct Wallet (`5 bps` × `4` moves) |
| --- | --- | --- |
| Starting principal | `$100,000.00` | `$100,000.00` |
| Gross native yield (illustrative `6.00%`) | `$6,000.00` | `$6,000.00` |
| Morfa protocol fee | `$300.00` (`5%` of `$6,000.00`) | `$200.00` (`0.05%` × `$100,000` × `4` moves) |
| **Illustrative net native yield after fee** | **`$5,700.00`** (`5.70%` net) | **`$5,800.00`** (`5.80%` net) |
| Mode A `periodFeeCap` note | N/A | Each move is `$50.00` fee; raise `periodFeeCap` above the `$25` UI default if depositing `$100,000+` in Mode A |

:::tip[Adjust `periodFeeCap` for Large Mode A Balances]
In Mode A, the editable UI default `periodFeeCap` is `25 USDC` per rolling 30-day window. At `5 bps` (`0.05%`), `25 USDC` covers up to `$50,000 USDC` of moved principal in a 30-day period. Users supplying larger balances in Mode A should increase `periodFeeCap` in the **Advanced** guardrails form so automated rebalances are not blocked by a tight default cap.
:::

***

## Gas Economics

### What You Pay Gas For

You pay standard Ethereum Mainnet ETH gas only for transactions you sign directly from your wallet:

* **Mode B:** Depositing USDC (with EIP-2612 permit or ERC-20 `approve`), withdrawing/redeeming `mfUSDC`, and claiming Merkl rewards.
* **Mode A:** Supplying/withdrawing USDC on Morpho Blue, enabling/updating/disabling automation (`enableWithSig`, `setConfig`, `disable`, or `Morpho.setAuthorization`), and claiming Merkl rewards.

### What Morfa's Automated Worker Pays Gas For

You **never** deposit ETH into Morfa to pay for automated rebalancing. Morfa's keeper wallet (`0x2c7CB5D2f34e547d3EadbeF116f97D2e2A92DCAc`) pays Ethereum gas for automated allocations:

* **Mode B (`Morfa Vault`):** Because one atomic `VaultV2.multicall` rebalances the entire pooled vault at once, keeper gas is naturally amortized across all depositors. Moves execute only when projected pool-level net yield gains comfortably exceed gas costs.
* **Mode A (`Direct Wallet`):**
  * **Fee-covered moves:** On larger wallets where the `5 bps` rebalance fee exceeds transaction gas cost, automated rebalancing is economically self-sustaining.
  * **Keeper-subsidized moves (`≥ 100 USDC`):** Smaller eligible Mode A wallets (`≥ 100 USDC`) can still receive automated rebalances subsidized by the keeper, subject to operational daily and monthly gas budgets, maximum gas-price ceilings, and per-wallet anti-sybil frequency limits.
  * **Emergency priority:** During confirmed emergency evacuations, normal gas-subsidy limits are lifted and an elevated gas ceiling applies so safety exits remain prioritized.

***

## Pull-Based Fee Accounting (`MorfaRebalancer`)

In `MorfaRebalancer.sol`, protocol fees are **pull-based** rather than pushed inline during user rebalances:

* During each standard rebalance, the contract computes `fee = Math.mulDiv(received, currentFeeBps, 10_000, Floor)` and keeps `fee` inside the contract balance (`USDC.balanceOf(this) == usdcBefore + res.fee`), forwarding `received - fee` to Morpho Blue on the user's behalf.
* Separating fee transfers prevents a reverting or blacklisted `feeRecipient` from ever causing a denial-of-service on user rebalances.
* `feeRecipient` or `DEFAULT_ADMIN_ROLE` can sweep accrued fees at any time by calling `claimFees()` (which remains callable even while paused and transfers only accumulated fees, never user principal).
