> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fragmetric.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

## **FRAG-22: Yield Source Module**

### **Overview**

The Yield Source Module manages the strategic deployment and optimization of assets within the FRAG-22 system, actively allocating user-deposited funds across various external decentralized yield strategies. This module seamlessly connects internal asset management with external yield-generating protocols, maximizing user returns while maintaining efficient liquidity.

The module distinctly organizes responsibilities across three internal layers and clearly interacts with external yield opportunities:

* **Asset Management :**

  Safely maintains and manages the pool of assets (Reserve Account), readying them for strategic deployment to external yield sources.
* **Operator Management :**

  Handles critical operations including asset allocation, periodic rebalancing for optimal yields, and yield harvesting—ensuring asset positions remain optimized and responsive to market conditions.
* **Accounting :**

  Precisely tracks and accumulates the generated yields within the Fund Reward Account, ensuring transparent and accurate reward accounting.

External yield opportunities, such as staking, restaking, liquidity pools, lending protocols, and structured financial products, provide diverse and attractive yield streams. The Yield Source Module strategically integrates these external systems, continuously monitoring and adjusting positions to deliver consistent and optimized returns for users.

### **Comprehensive Structure Diagram**

```mermaid theme={null}
graph TD

%% External Yield Sources
subgraph External_Yield_Sources
    LiquidStaking[Liquid Staking]
    Restaking[Restaking]
    CustomYieldSource[Custom Yield Source]
end

%% Adapters Layer
subgraph Adapters_Layer
    LiquidStakingAdapter[Liquid Staking Adapter]
    RestakingAdapter[Restaking Adapter]
    CustomAdapter[Custom Yield Adapter]
end

%% Logic Layer
subgraph Logic_Layer
    YieldHarvester[Yield Harvester]
    AssetAllocator[Asset Allocator]
end

%% Internal Accounts Layer
subgraph Internal_Accounts
    ReserveAccount[Reserve Account]
    FundRewardAccount[Fund Reward Account]
end

%% External Sources to Adapters
LiquidStaking --> LiquidStakingAdapter
Restaking --> RestakingAdapter
CustomYieldSource --> CustomAdapter

%% Adapters to Logic Layer
LiquidStakingAdapter --> YieldHarvester
RestakingAdapter --> YieldHarvester
CustomAdapter --> YieldHarvester
AssetAllocator --> LiquidStakingAdapter
AssetAllocator --> RestakingAdapter
AssetAllocator --> CustomAdapter

%% Logic Layer to Internal Accounts
YieldHarvester --> FundRewardAccount
AssetAllocator --> ReserveAccount

%% Internal Accounts Interaction
FundRewardAccount --> ReserveAccount

classDef external fill:#ADD8E6, stroke:#333,stroke-width:1px
classDef adapter fill:#FFD580, stroke:#333,stroke-width:1px
classDef logic fill:#87CEFA, stroke:#333,stroke-width:1px
classDef internal fill:#90EE90, stroke:#333,stroke-width:1px

class LiquidStaking,Restaking,CustomYieldSource external
class LiquidStakingAdapter,RestakingAdapter,CustomAdapter adapter
class YieldHarvester,AssetAllocator logic
class ReserveAccount,FundRewardAccount internal
```
