> For the complete documentation index, see [llms.txt](https://docs.maple.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maple.finance/technical-resources/strategies/aave-v3-strategy.md).

# Aave V3 Strategy

The Aave V3 Strategy is an Underlying Strategy that supplies a Pool's capital to a single Aave V3 lending market and holds the interest-bearing aToken in return. It lets Pools earn Aave supply yield through a [Strategy Manager](https://docs.maple.finance/technical-resources/strategies/strategy-manager.md), with Maple's accounting, fee collection and loss controls wrapped around the position.

The contract is `MapleAaveV3Strategy` (`STRATEGY_TYPE = "AAVEV3"`). It targets any Aave V3-compatible market. The strategy reads the market's pool and underlying asset from the aToken itself, and a liquidity switch (`useVirtualUnderlyingBalance`) exists so it can also value positions in Aave V3 forks, such as SparkLend, that do not track reserve liquidity virtually. See [Accounting and Fees](https://docs.maple.finance/technical-resources/strategies/aave-v3-strategy/accounting-and-fees.md).

Each strategy instance is bound to one Strategy Manager and one aToken at initialization. Neither binding can change. The Strategy Manager is the only caller that moves capital in or out, and the Pool never calls the strategy directly.

## Initialization

The [Strategy Deployer](https://docs.maple.finance/technical-resources/strategies/strategy-deployer.md) deploys the strategy as an upgradeable proxy through `MapleAaveV3StrategyFactory.createInstance()`. The factory requires `Globals.canDeploy(msg.sender)`. Upgrades follow the standard Maple proxy pattern, see [Proxies and Upgradeability](https://docs.maple.finance/technical-resources/protocol-overview/proxies-and-upgradeability.md).

The initializer decodes a `strategyManager` address followed by an `AaveV3StrategyInitializerParams` struct.

| Parameter                     | Type      | Description                                                                                                                               |
| ----------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `strategyManager`             | `address` | The Strategy Manager this strategy serves.                                                                                                |
| `aaveToken`                   | `address` | The Aave aToken for the target reserve. The strategy derives `fundsAsset` from `UNDERLYING_ASSET_ADDRESS()` and `aavePool` from `POOL()`. |
| `strategyDelegateFeeRate`     | `uint32`  | Share of yield paid to the Strategy Delegate, 6 decimals (`1e6` is 100%).                                                                 |
| `strategyProtocolFeeRate`     | `uint32`  | Share of yield paid to the Maple Treasury, 6 decimals.                                                                                    |
| `referralCode`                | `uint16`  | Aave referral code passed on every `supply()` call.                                                                                       |
| `useVirtualUnderlyingBalance` | `bool`    | How `availableToWithdraw()` reads the reserve's free liquidity.                                                                           |
| `strategyMetadata`            | `string`  | Optional free-form label for off-chain tooling.                                                                                           |

The initializer reverts unless all of the following hold:

1. `strategyManager` and `aaveToken` are non-zero.
2. `strategyDelegateFeeRate + strategyProtocolFeeRate <= 1e6`.
3. The Strategy Manager's factory is registered in Globals as a `STRATEGY_MANAGER_FACTORY`, and `strategyManager` is an instance of that factory.
4. `strategyManager.underlyingStrategy()` equals the strategy's own address. The Strategy Manager must already point at this strategy, which makes the pairing a two-sided guarantee.
5. `aaveToken` is registered in Globals as a `STRATEGY_VAULT`.
6. The derived `fundsAsset` is a valid Pool asset in Globals.

On success the initializer stores the parameters, arms the reentrancy lock and emits `Initialized(strategyManager, params)`.

## Access control

The strategy stores only the Strategy Manager address. It reads every other actor live on each call: the Strategy Delegate from `strategyManager.strategyDelegate()`, and the Governor, Operational Admin, Security Admin and Maple Treasury from Globals. Rotating any of those addresses takes effect on the strategy immediately.

| Function                         | Allowed callers                                                          |
| -------------------------------- | ------------------------------------------------------------------------ |
| `fundUnderlyingStrategy`         | Strategy Manager                                                         |
| `withdrawFromUnderlyingStrategy` | Strategy Manager                                                         |
| `impair`                         | Strategy Delegate, Operational Admin                                     |
| `removeImpairment`               | Strategy Delegate, Operational Admin                                     |
| `recognizeLoss`                  | Strategy Delegate, Operational Admin                                     |
| `recoverPosition`                | Strategy Delegate, Operational Admin                                     |
| `claimRewards`                   | Strategy Delegate, Operational Admin                                     |
| `setMetadata`                    | Strategy Delegate, Operational Admin                                     |
| `setReferralCode`                | Strategy Delegate, Operational Admin                                     |
| `setStrategyDelegateFeeRate`     | Strategy Delegate                                                        |
| `setStrategyProtocolFeeRate`     | Governor, Operational Admin                                              |
| `setUseVirtualUnderlyingBalance` | Governor, Operational Admin                                              |
| `multicall`                      | Anyone. Each inner call runs its own checks against the original caller. |
| `upgrade`                        | Security Admin                                                           |
| `migrate`                        | Factory                                                                  |
| `setImplementation`              | Factory                                                                  |

Two modifiers apply across the table:

* `whenNotPaused` guards every state-changing function except `multicall`. Globals can pause the contract or the whole protocol and unpause single functions, see [Emergency Protocol Pause](https://docs.maple.finance/technical-resources/security/emergency-protocol-pause.md).
* `whenLossNotRecognized` guards every state-changing function except `recoverPosition`, `claimRewards`, `multicall` and the proxy functions. See [Impairments and Losses](https://docs.maple.finance/technical-resources/strategies/aave-v3-strategy/impairments-and-losses.md).

## Multicall

`multicall(bytes[] data)` delegatecalls each entry back into the contract and reverts the whole batch with the first inner error. It has no access, pause or reentrancy check of its own. Each inner call runs its own checks against the original caller.

## Contract interfaces

{% content-ref url="/pages/VAFLhljmoIPvhUQGblam" %}
[AaveV3Strategy](https://docs.maple.finance/technical-resources/interfaces/aave-v3-strategy.md)
{% endcontent-ref %}

{% content-ref url="/pages/G0XkaapSkAPtb3bBacDQ" %}
[AaveV3StrategyFactory](https://docs.maple.finance/technical-resources/interfaces/aave-v3-strategy-factory.md)
{% endcontent-ref %}

{% content-ref url="/pages/BXUrklGhQN8OIr5RDqXX" %}
[AaveV3StrategyInitializer](https://docs.maple.finance/technical-resources/interfaces/aave-v3-strategy-initializer.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maple.finance/technical-resources/strategies/aave-v3-strategy.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
