> 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/allocation-strategy.md).

# Allocation Strategy

Some sources of yield have no smart contract that a Pool can deposit into directly, such as activity run off-chain or spread across several protocols. The Allocation Strategy lets Maple Pools earn from them. It holds the Pool's capital and releases it to Managed Wallets, which are Maple-operated addresses with their own permissions and limits. The wallets put the capital to work and send profits back, and the strategy counts yield only once that cash arrives. A Pool can withdraw the cash the strategy holds, minus yield still vesting. Capital deployed to Managed Wallets must come back before the Pool can withdraw it.

The strategy sits behind a [Strategy Manager](https://docs.maple.finance/technical-resources/strategies/strategy-manager.md), which is the only contract that moves pool capital into or out of it.

`MapleAllocationStrategy` does five things:

* Holds pool capital it has received from its Strategy Manager (`recordedAssets`).
* Releases that capital to Managed Wallets under per-wallet permissions and deployment caps, and tracks what each wallet holds (`deployedAssetsOf`, `totalDeployedAssets`).
* Accepts returned yield into a linear-release buffer (`scheduledYieldAssets`) and pays Strategy Delegate and protocol fees on it immediately.
* Reports `assetsUnderManagement()` and `unrealizedLosses()` to the Strategy Manager, which uses them to price the Pool's position.
* Writes capital down through impairments and recognized losses.

## Initialization

`MapleAllocationStrategyFactory` deploys each strategy as an upgradeable proxy. `createInstance()` requires `MapleGlobals.canDeploy(msg.sender)` to be true for the caller, which in practice is the [Strategy Deployer](https://docs.maple.finance/technical-resources/strategies/strategy-deployer.md). The proxy pattern is described under [Proxies and Upgradeability](https://docs.maple.finance/technical-resources/protocol-overview/proxies-and-upgradeability.md).

`MapleAllocationStrategyInitializer` runs once, through its `fallback()`, and decodes a `strategyManager` address followed by an `AllocationStrategyInitializerParams` struct:

| Parameter                 | Type      | Meaning                                                                  |
| ------------------------- | --------- | ------------------------------------------------------------------------ |
| `strategyManager`         | `address` | The Strategy Manager this strategy is bound to. It cannot change later.  |
| `fundsAsset`              | `address` | The ERC-20 asset the strategy holds.                                     |
| `strategyMetadata`        | `string`  | Free-form label for off-chain tooling. Updatable with `setMetadata()`.   |
| `strategyDelegateFeeRate` | `uint32`  | Share of gross yield paid to the Strategy Delegate, where `1e6` is 100%. |
| `strategyProtocolFeeRate` | `uint32`  | Share of gross yield paid to the Maple treasury, where `1e6` is 100%.    |
| `yieldCap`                | `uint256` | Maximum `yield` a single `realizeYield()` call may bring in.             |

The initializer reverts unless all of the following hold:

* `strategyManager` is not the zero address.
* `fundsAsset` is a registered pool asset on `MapleGlobals` (`isPoolAsset`).
* The Strategy Manager's factory is a registered `STRATEGY_MANAGER_FACTORY` instance on Globals, and `strategyManager` is an instance of that factory.
* `strategyManager.underlyingStrategy()` already equals the new strategy's address. The Strategy Manager must point at this strategy before the strategy accepts the pairing, which makes the 1:1 binding a guarantee rather than a convention.
* `strategyDelegateFeeRate + strategyProtocolFeeRate` does not exceed `1e6`.

## Access control

The strategy stores only two addresses, `strategyManager` and `fundsAsset`. It reads every other actor live on each call: the Strategy Delegate from `strategyManager.strategyDelegate()`, and the Governor, Operational Admin, Security Admin and treasury from `MapleGlobals`. Rotating any of them takes effect immediately on every Allocation Strategy. A Managed Wallet must pass both an allowlist on Globals and a per-strategy permission flag, described on [Managed Wallets](https://docs.maple.finance/technical-resources/strategies/allocation-strategy/managed-wallets.md).

| Function                           | Allowed callers                                                          |
| ---------------------------------- | ------------------------------------------------------------------------ |
| `fundUnderlyingStrategy`           | Strategy Manager                                                         |
| `withdrawFromUnderlyingStrategy`   | Strategy Manager                                                         |
| `deployAssets`                     | Managed Wallet with `canDeployAssets`                                    |
| `returnAssets`                     | Managed Wallet with `canReturnAssets`                                    |
| `realizeYield`                     | Managed Wallet with `canRealizeYield`                                    |
| `cancelYield`                      | Strategy Delegate, Security Admin                                        |
| `impair`                           | Strategy Delegate, Operational Admin                                     |
| `removeImpairment`                 | Strategy Delegate, Operational Admin                                     |
| `recognizeLoss`                    | Strategy Delegate, Operational Admin                                     |
| `recognizeLossAndRemoveImpairment` | Strategy Delegate, Operational Admin                                     |
| `setDeploymentCaps`                | Strategy Delegate, Security Admin                                        |
| `setPermissions`                   | Strategy Delegate, Security Admin                                        |
| `setMetadata`                      | Strategy Delegate, Operational Admin                                     |
| `setStrategyDelegateFeeRate`       | Strategy Delegate                                                        |
| `setStrategyProtocolFeeRate`       | Governor, Operational Admin                                              |
| `setYieldCap`                      | Strategy Delegate, Operational Admin                                     |
| `skim`                             | Strategy Delegate, Operational Admin                                     |
| `multicall`                        | Anyone. Each inner call runs its own checks against the original caller. |
| `upgrade`                          | Security Admin                                                           |
| `migrate`, `setImplementation`     | Factory                                                                  |

Every state-changing function except `multicall` carries `whenNotPaused`, so the Governor or Security Admin can pause the contract or the whole protocol through Globals, and unpause single functions on it. See [Emergency Protocol Pause](https://docs.maple.finance/technical-resources/security/emergency-protocol-pause.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.

## Interfaces

{% content-ref url="/pages/iBXUEFOJ2ZgaZ1Jv7tWg" %}
[AllocationStrategy](https://docs.maple.finance/technical-resources/interfaces/allocation-strategy.md)
{% endcontent-ref %}

{% content-ref url="/pages/57bzyzigqzrmEFhzQTRJ" %}
[AllocationStrategyFactory](https://docs.maple.finance/technical-resources/interfaces/allocation-strategy-factory.md)
{% endcontent-ref %}

{% content-ref url="/pages/mapJYlaBO8e1yBzSJzp9" %}
[AllocationStrategyInitializer](https://docs.maple.finance/technical-resources/interfaces/allocation-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/allocation-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.
