# Configuration Guide

#### Configuration Guide

The **Configuration Guide** provides detailed instructions for setting up and managing Term Strategy Vaults. It covers administrative parameters, risk settings, protocol integration, and emergency controls to ensure efficient and secure operation.

***

**Yearn V3 Administration**

| **Feature**          | **Details**                                                                                                                                                     |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Profit Mechanics** | <p><code>setProfitMaxUnlockTime(3 days)</code> – Time window for profit realization.<br><code>setPerformanceFee(1000)</code> – Default 10% in basis points.</p> |
| **Profit Unlocking** | <p>Profits accrue linearly over <code>profitMaxUnlockTime</code>.<br>Prevents PPS manipulation.<br>Recommended <code>report()</code> frequency: 3 days.</p>     |
| **Performance Fees** | <p>Default: 10% of profits.<br>Split: 80% to curator, 20% to Yearn.<br>Charged at <code>report()</code> and sent to <code>performanceFeeRecipient</code>.</p>   |

***

**Administrative Roles**

| **Role**                      | **Responsibilities**                                                                                            |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------- |
| **Manager**                   | Strategy control, parameter configuration, emergency functions, fee settings.                                   |
| **Keeper**                    | Calls `report()`, triggers profit realization, matches profit unlock cycle, essential for performance tracking. |
| **Performance Fee Recipient** | Passively receives performance fees (must not be zero address or the strategy itself).                          |

***

**Reporting Cycle**

| **Action**             | **Details**                                                                                                                                                                                          |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Report Function**    | <p>Called by the keeper.<br>Recommended frequency: every 3 days.<br>Triggers profit realization and starts a new unlock period.</p>                                                                  |
| **Profit Realization** | <p>- <strong>Time 0</strong>: <code>report()</code> called, profit locked.<br>- <strong>Time 0-3 days</strong>: Profit unlocks linearly.<br>- <strong>Time 3 days</strong>: All profit realized.</p> |

***

**Deployment Configuration**

| **Field**                      | **Description**                |
| ------------------------------ | ------------------------------ |
| `_asset`                       | Underlying asset address.      |
| `_assetVault`                  | 4626 vault for idle funds.     |
| `_discountRateAdapter`         | Oracle for repo token pricing. |
| `_eventEmitter`                | Event logging contract.        |
| `_governorAddress`             | Governance safe address.       |
| `_termController`              | TERM protocol controller.      |
| `_repoTokenConcentrationLimit` | Maximum exposure per token.    |
| `_timeToMaturityThreshold`     | Maximum weighted maturity.     |
| `_requiredReserveRatio`        | Minimum liquidity ratio.       |
| `_discountRateMarkup`          | Rate premium.                  |

***

**Risk Parameters**

| **Parameter**           | **Function**                              | **Recommended Range**                  | **Details**                                                                  |
| ----------------------- | ----------------------------------------- | -------------------------------------- | ---------------------------------------------------------------------------- |
| **Concentration Limit** | `setRepoTokenConcentrationLimit(uint256)` | 10-25% (1000-2500 bps)                 | Maximum exposure to a single repo token. Balances diversification and yield. |
| **Maturity Threshold**  | `setTimeToMaturityThreshold(uint256)`     | 90-180 days (7776000-15552000 seconds) | Maximum weighted portfolio maturity. Balances duration risk and yield.       |
| **Reserve Ratio**       | `setRequiredReserveRatio(uint256)`        | Min 10% (1000 bps)                     | Minimum liquid balance for withdrawals. Ensures portfolio liquidity.         |

***

**Market Parameters**

| **Parameter**           | **Function**                                 | **Recommended Range** | **Details**                                                            |
| ----------------------- | -------------------------------------------- | --------------------- | ---------------------------------------------------------------------- |
| **Rate Configuration**  | `setDiscountRateMarkup(uint256)`             | 0-200 bps             | Premium over TERM auction rates. Adjust to reflect market conditions.  |
| **Collateral Settings** | `setCollateralTokenParams(address, uint256)` | Based on asset risk   | Minimum collateral ratio. Ensure values exceed TERM protocol minimums. |

***

**Protocol Integration**

| **Component**             | **Function**                      | **Details**                                                                                                                                      |
| ------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **TERM Controller**       | `setTermController(address)`      | Validates repo token deployments. Ensure compatibility with TERM protocol. View list [here](https://developers.term.finance/deployed-contracts). |
| **Discount Rate Adapter** | `setDiscountRateAdapter(address)` | Provides repo token pricing. Align with TERM controller for accurate rates.                                                                      |

***

**Emergency Controls**

| **Feature**              | **Function**                                                                                                                      | **Details**                                                               |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| **Pause Configuration**  | <p><code>pauseDeposit()</code>, <code>unpauseDeposit()</code><br><code>pauseStrategy()</code>, <code>unpauseStrategy()</code></p> | Granular controls for emergencies. Ensure users are notified.             |
| **Blacklist Management** | `setRepoTokenBlacklist(address, bool)`                                                                                            | Exclude specific repo tokens during emergencies. Monitor exposure levels. |

***

**Configuration Examples**

| **Setup**        | **Parameter**        | **Value**      | **Details**                                                |
| ---------------- | -------------------- | -------------- | ---------------------------------------------------------- |
| **Conservative** | Concentration Limit  | 10% (1000 bps) | Focuses on diversification and liquidity.                  |
|                  | Maturity Threshold   | 90 days        | Minimizes duration risk.                                   |
|                  | Reserve Ratio        | 20% (2000 bps) | Ensures ample liquidity for withdrawals.                   |
|                  | Discount Rate Markup | 25 bps         | Provides a modest premium over auction rates.              |
| **Aggressive**   | Concentration Limit  | 25% (2500 bps) | Maximizes yield by increasing exposure to specific tokens. |
|                  | Maturity Threshold   | 180 days       | Focuses on longer-term returns.                            |
|                  | Reserve Ratio        | 10% (1000 bps) | Balances liquidity needs with capital deployment.          |
|                  | Discount Rate Markup | 50 bps         | Adjusted for higher spread.                                |

***

**Configuration Best Practices**

| **Area**              | **Best Practice**                                                                                 |
| --------------------- | ------------------------------------------------------------------------------------------------- |
| **Parameter Changes** | Start conservatively. Change one parameter at a time. Monitor metrics before further adjustments. |
| **Risk Management**   | Regularly review parameters. Align with market conditions. Monitor protocol exposure.             |
| **Emergency Actions** | Test pause functionality. Define clear triggers. Document emergency response procedures.          |
