# MorphoAaveV2Borrow

### Description

Borrow a token from Morpho

### Action ID

`0xb6af4eff`

### SDK Action

```ts
const morphoAaveV2BorrowAction = new dfs.actions.morpho.MorphoAaveV2BorrowAction(
    tokenAddr,
    amount,
    to,
    maxGasForMatching
);
```

### Action Type

`STANDARD_ACTION`

### Input Parameters

```solidity
    /// @param tokenAddr The address of the token to be borrowed
    /// @param amount Amount of tokens to be borrowed
    /// @param to The address we are sending the borrowed tokens to
    /// @param maxGasForMatching - Max gas to spend on p2p matching
    struct Params {
        address tokenAddr;
        uint256 amount;
        address to;
        uint256 maxGasForMatching;
    }
```

### Return Value

```solidity
return bytes32(amount);
```

### Events and Logs

```solidity
emit ActionEvent("MorphoAaveV2Borrow", logData);
logger.logActionDirectEvent("MorphoAaveV2Borrow", logData);
bytes memory logData = abi.encode(params);
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.defisaver.com/actions/morphooptimizers/aavev2/morphoaavev2borrow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
