> 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/interfaces/liquidity-router.md).

# LiquidityRouter

## Constructor

```solidity
    constructor(
        address globals_
    );
```

#### Parameters:

| Index |    Name    |    Type   | Internal Type | Description |
| :---: | :--------: | :-------: | :-----------: | ----------- |
|   0   | `globals_` | `address` |   `address`   |             |

## Functions

### `executeActions`

Executes actions atomically in their listed order. Only a registered liquidity bot can call this function. The call reverts when the deadline has passed or any action fails.

```solidity
    function executeActions(
        Action[] actions,
        uint256 deadline
    )
        nonpayable;
```

#### Parameters:

| Index |    Name    |    Type   |   Internal Type   | Description                                      |
| :---: | :--------: | :-------: | :---------------: | ------------------------------------------------ |
|   0   |  `actions` | `tuple[]` | `struct Action[]` | Ordered actions to execute.                      |
|   1   | `deadline` | `uint256` |     `uint256`     | Latest timestamp at which the batch can execute. |

### `globals`

Returns the Maple globals contract used for access control and function pausing.

```solidity
    function globals()
        view
        returns (
            address globals
        );
```

#### Return Values:

| Index |    Name   |    Type   | Internal Type | Description                            |
| :---: | :-------: | :-------: | :-----------: | -------------------------------------- |
|   0   | `globals` | `address` |   `address`   | Address of the Maple globals contract. |

## Events

### `ActionExecuted`

Emitted after an action is executed.

```solidity
    event ActionExecuted(
        uint256 actionIndex,
        ActionType indexed actionType,
        address indexed strategyManager,
        address indexed poolManager,
        uint256 amount
    );
```

#### Parameters:

| Index |        Name       |    Type   |   Internal Type   | Description                                           |
| :---: | :---------------: | :-------: | :---------------: | ----------------------------------------------------- |
|   0   |   `actionIndex`   | `uint256` |     `uint256`     | Index of the action in the batch.                     |
|   1   |    `actionType`   |  `uint8`  | `enum ActionType` | Type of action that was executed.                     |
|   2   | `strategyManager` | `address` |     `address`     | Strategy manager the action ran against.              |
|   3   |   `poolManager`   | `address` |     `address`     | Pool manager the action concerned.                    |
|   4   |      `amount`     | `uint256` |     `uint256`     | Assets for funding and shares for redemption actions. |

## Structs

### `Action`

```solidity
    struct Action {
        ActionType actionType;
        address strategyManager;
        address poolManager;
        uint256 amount;
        bytes strategyData;
    }
```

#### Members:

| Index |        Name       |    Type   |   Internal Type   | Description                                                                                                    |
| :---: | :---------------: | :-------: | :---------------: | -------------------------------------------------------------------------------------------------------------- |
|   0   |    `actionType`   |  `uint8`  | `enum ActionType` | Type of action to execute.                                                                                     |
|   1   | `strategyManager` | `address` |     `address`     | Strategy manager the action runs against.                                                                      |
|   2   |   `poolManager`   | `address` |     `address`     | Pool manager the action concerns.                                                                              |
|   3   |      `amount`     | `uint256` |     `uint256`     | Assets to fund for \`FUND\_STRATEGY\`, otherwise shares. Computed off-chain by the liquidity bot.              |
|   4   |   `strategyData`  |  `bytes`  |      `bytes`      | Data forwarded to the underlying strategy on \`FUND\_STRATEGY\` and \`PROCESS\_REDEMPTION\`. Unused otherwise. |

## Enums

### `ActionType`

```solidity
    enum ActionType {
        FUND_STRATEGY,
        REQUEST_REDEEM,
        CANCEL_REDEMPTION,
        PROCESS_REDEMPTION
    }
```

#### Values:

| Index |         Name         | Description                                                                                                     |
| :---: | :------------------: | --------------------------------------------------------------------------------------------------------------- |
|   0   |    `FUND_STRATEGY`   | Calls \`fundStrategyManager(poolManager, amount, strategyData)\` on the strategy manager. \`amount\` is assets. |
|   1   |   `REQUEST_REDEEM`   | Calls \`requestRedeem(poolManager, amount)\` on the strategy manager. \`amount\` is shares.                     |
|   2   |  `CANCEL_REDEMPTION` | Calls \`cancelRedemption(poolManager, amount)\` on the strategy manager. \`amount\` is shares.                  |
|   3   | `PROCESS_REDEMPTION` | Calls \`processRedemption(poolManager, amount, strategyData)\` on the strategy manager. \`amount\` is shares.   |


---

# 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/interfaces/liquidity-router.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.
