> 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/admin-functions/liquidity-bot-actions.md).

# Liquidity Bots

From the contracts' point of view a bot is an address registered in [Maple Globals](https://docs.maple.finance/technical-resources/singletons/globals.md) under an instance key. The Governor or Operational Admin registers it with `setValidInstanceOf`, and every call checks the key live, so revoking a bot takes effect immediately. Three keys matter.

| Key                    | Where it is checked                     | What it allows                                              |
| ---------------------- | --------------------------------------- | ----------------------------------------------------------- |
| `LIQUIDITY_BOT`        | Strategy Manager, in the Operator check | Fund, request, cancel and process redemptions directly      |
| `LIQUIDITY_ROUTER_BOT` | Liquidity Router, in `executeActions`   | Batch those same four actions across many Strategy Managers |
| `WITHDRAWAL_REDEEMER`  | Withdrawal Manager, in `onlyRedeemer`   | Process the LP redemption queue                             |

## `LIQUIDITY_BOT`: direct Strategy Manager calls

The [Strategy Manager](https://docs.maple.finance/technical-resources/strategies/strategy-manager.md) resolves an Operator on every call. The check passes for the Strategy Delegate at all times. For any other caller it returns false if `underlyingStrategy.impairedAssets()` is non-zero, and otherwise passes when the caller is registered as `LIQUIDITY_BOT` or `LIQUIDITY_ROUTER`.

A `LIQUIDITY_BOT` can therefore call:

* `fundStrategyManager(poolManager, assetsIn, data)`
* `requestRedeem(poolManager, shares)`
* `cancelRedemption(poolManager, shares)`
* `processRedemption(poolManager, shares, data)`

It cannot set caps, accept a delegate handover or upgrade anything.

## `LIQUIDITY_ROUTER_BOT`: calls through the Liquidity Router

The [Liquidity Router](https://docs.maple.finance/technical-resources/strategies/liquidity-router.md) is a single non-upgradeable contract that batches Strategy Manager actions. Two registrations are needed: the bot as `LIQUIDITY_ROUTER_BOT`, so it may call `executeActions(actions, deadline)`, and the Router itself as `LIQUIDITY_ROUTER`, so Strategy Managers accept the Router as an Operator.

For each action the Router checks that the deadline has not passed, that the Strategy Manager came from a registered `STRATEGY_MANAGER_FACTORY`, and then calls one of `fundStrategyManager`, `requestRedeem`, `cancelRedemption` or `processRedemption`. The Strategy Manager sees the Router as `msg.sender` and applies its own Operator and cap checks, so routing through the Router never grants more than a direct `LIQUIDITY_BOT` call would.

A bot address can hold one key or both.

## The impairment block

Once an Underlying Strategy reports `impairedAssets() != 0`, both `LIQUIDITY_BOT` and `LIQUIDITY_ROUTER` callers fail the Operator check on that Strategy Manager. Until the impairment is removed, only the Strategy Delegate can fund. The Strategy Delegate and the Pool Delegate can still request and cancel redemptions, and the Strategy Delegate and the Operational Admin can still process them. On the Aave V3 and Sky strategies `recognizeLoss` also resets `impairedAssets` to zero. On the Allocation Strategy only `removeImpairment` or `recognizeLossAndRemoveImpairment` does.

## Limits that apply to every Operator call

* `PoolManager.requestFunds` rejects funding that would push the Pool's position above `strategyCapOf[strategyManager]`, which the Pool Delegate sets.
* The Strategy Manager rejects funding that would exceed `poolManagerCapOf[poolManager]` or `strategyLiquidityCap`. A `poolManagerCap` of `type(uint256).max` blocks funding from that Pool entirely.
* `processRedemption` only settles up to the Pool's pending shares and up to `availableToWithdraw()` of the Underlying Strategy.
* The Router and every Strategy Manager carry `whenNotPaused`, so the Security Admin can stop bots with a contract or protocol pause.

## `WITHDRAWAL_REDEEMER`: the LP redemption queue

The queue [Withdrawal Manager](https://docs.maple.finance/technical-resources/pools/withdrawal-manager.md) restricts its processing functions with `onlyRedeemer`, which passes for a registered `WITHDRAWAL_REDEEMER`, the Pool Delegate or the Operational Admin:

* `processRedemptions(maxSharesToProcess)` fills requests in order and reverts with `WM:PR:LOW_LIQUIDITY` if the Pool cannot cover the full amount.
* `processEmptyRedemptions(numberOfRequests)` skips cancelled requests at the head of the queue.
* `removeRequest(owner, requestIds)` returns an owner's shares.

A `WITHDRAWAL_REDEEMER` cannot call `setManualWithdrawal` or `upgrade`.


---

# 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/admin-functions/liquidity-bot-actions.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.
