# Architecture

## Protocol Architecture

<figure><img src="/files/EkLcRw9x5dlMTPNx8NvS" alt=""><figcaption></figcaption></figure>

1. Vault Factory:
   * This is the top-level component that creates and manages vaults.
   * It likely implements a whitelist mechanism to control vault creation and management.
2. User Interaction:
   * Users deposit assets into the Vault.
   * In return, users receive Vault tokens, representing their share of the pooled assets.
3. Vault:
   * The core component that holds and manages user assets.
   * It interacts with multiple Liquidity Pools (LPs) to generate yield and BGT rewards.
   * The Vault distributes assets across LP 1, LP 2, and LP 3 (and potentially more).
4. Liquidity Pools (LPs):
   * Multiple LPs are integrated to diversify yield sources.
   * Each LP generates yield and BGT rewards, which are sent back to the Vault.
5. Optimizer:
   * A crucial component that determines the optimal distribution of assets across LPs.
   * It's powered by two main components: a. AI-testing model (two instances shown, suggesting redundancy or different purposes) b. Off-chain Computing
   * Utilizes an AI-based calculation model for real-time rate monitoring and auto-rebalancing to manage risk.
6. Modular Design:
   * The architecture is designed to be robust and modular, allowing WeBera to unify yield opportunities across various DeFi protocols.
7. Asset Flow:
   * Assets flow from Users to the Vault, then to LPs.
   * Yield and BGT rewards flow back from LPs to the Vault, and ultimately to Users.

This architecture enables WeBera to efficiently manage user assets, optimize yields across multiple protocols, and provide a unified interface for users to access diverse DeFi opportunities. The use of AI and off-chain computing in the Optimizer suggests advanced strategies for maximizing returns while potentially managing risks.

## **ERC-4626 and Tokenized Architecture** <a href="#erc-4626" id="erc-4626"></a>

The ERC-4626 vault standard is a crucial component of the protocol, offering enhanced functionality and interoperability compared to conventional vaults using representative tokens. This standard has gained widespread adoption in the decentralized finance (DeFi) ecosystem.

Implementing ERC-4626 enables features like automatic compounding and collateralized loans, optimizing yield while maintaining active loans on WeBera. ERC-4626 provides a universal interface for tokenized vaults, simplifying integration with DeFi protocols for efficient use of yield-generating tokens.


---

# Agent Instructions: 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:

```
GET https://docs.webera.finance/core-concepts/architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
