Architecture

The MAAT system architecture comprises several layers, each responsible for specific functions within the protocol. This documentation describes the various components and their interactions as illustrated in the provided diagram.

Overview

The MAAT architecture consists of the following layers:

  1. MAAT DApp

  2. Smart Contracts

  3. Yield Searcher

  4. Math

  5. Data Hub (Indexer)

Each layer interacts with the others to ensure seamless operation and optimal yield generation for users.

Components

1. MAAT DApp

The MAAT DApp is the user-facing interface through which users interact with the MAAT protocol. It provides functionalities such as:

  • Deposit: Allows users to deposit their assets into the MAAT system.

  • Check Earnings: Enables users to check their current earnings.

  • Withdraw: Facilitates the withdrawal of assets from the MAAT system.

  • Watch Analytics: Provides analytical insights and performance metrics.

2. Smart Contracts

The Smart Contracts layer includes the core contracts that handle various operations within the MAAT system. Key functions include:

  • Deposit: Handles the deposit of user assets into the system.

  • Check PPS (Price Per Share): Provides current Price Per Share information.

  • Request Withdraw: Manages withdrawal requests from users.

  • Execute: Executes the necessary operations based on user requests.

3. Yield Searcher

The Yield Searcher is responsible for optimizing asset allocation to generate the highest possible yields. It includes functions such as:

  • Distribute Deposit: Manages the distribution of user deposits across various strategies.

  • Rebalance: Rebalances the assets to maintain optimal yield generation.

  • Fulfill Withdraw Request: Processes user withdrawal requests by reallocating assets as necessary.

4. Math

The Math layer performs the necessary calculations to optimize the system's state. It includes:

  • Calculate Deposit Distribution: Determines the best way to distribute deposits.

  • Calculate Rebalance: Calculates the optimal rebalance strategy.

  • Calculate Withdraw: Computes the best way to fulfill withdrawal requests.

5. Data Hub (Indexer)

The Data Hub acts as the indexer, gathering and providing data necessary for the system's operation. It includes APIs to:

  • Get Strategies: Retrieves available yield strategies.

  • Get Chains: Provides information on supported chains.

  • Get Protocols: Lists supported protocols.

  • Get System State: Provides the current state of the system, including APYs for all strategies.

Interaction Flow

  1. User Interaction:

    • The user interacts with the MAAT DApp to perform actions such as depositing assets, checking earnings, or withdrawing funds.

  2. Smart Contract Execution:

    • The DApp sends requests to the Smart Contracts to execute the corresponding actions (e.g., deposit, request withdraw).

  3. Yield Searcher:

    • Upon receiving events from the Smart Contracts, the Yield Searcher queries the Data Hub to fetch current APYs for all accessible strategies.

    • The Yield Searcher then interacts with the Math API to calculate the optimal asset distribution.

  4. Data Hub and Math Integration:

    • The Data Hub provides necessary data about strategies, chains, and protocols.

    • The Math layer performs calculations to determine the optimal state for deposit distribution, rebalancing, and withdrawal fulfillment.

This layered approach ensures that the MAAT protocol operates efficiently, providing users with optimized yield generation while maintaining seamless and secure interactions across the system.

Last updated