> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3os.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Morpho Blue Borrow

Borrow loan token against existing collateral in a Morpho Blue market. Optional maxLtvPercent safety cap prevents accidentally borrowing to dangerous LTV. Supports Ethereum (1), Optimism (10), Polygon (137), Robinhood Chain (4663), Base (8453), Arbitrum (42161). Ideal for: opening leverage positions, cash-out against collateral, automated borrowing.

![Morpho Blue Borrow logo](https://cdn.b3.fun/b3os-icons/morpho.svg)
Catalog action EVM Onchain wallet Gas

Borrow loan token against existing collateral in a Morpho Blue market. Optional maxLtvPercent safety cap prevents accidentally borrowing to dangerous LTV. Supports Ethereum (1), Optimism (10), Polygon (137), Robinhood Chain (4663), Base (8453), Arbitrum (42161). Ideal for: opening leverage positions, cash-out against collateral, automated borrowing.

**Review wallet and value movement**

This action can require a wallet connector, gas, token movement, or an external side effect. Test with simulation or a controlled amount before using it in a live workflow.

## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `morpho-blue-borrow` |
| Category | EVM Onchain |
| Connector | `wallet` |
| Requires gas | Yes |
| Funds movement | None declared |
| Tags | `morpho`, `morpho-blue`, `lending`, `borrow`, `write`, `defi` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `marketId` | `string` | Yes | Morpho Blue market ID \(bytes32 hex\) |
| `chainId` | `number` | Yes | Chain ID. Supported: Ethereum \(1\), Optimism \(10\), Polygon \(137\), Robinhood Chain \(4663\), Base \(8453\), Arbitrum \(42161\) |
| `amount` | `string` | Yes | Amount of loan token to borrow in smallest unit \(wei\). E.g. "50000000" = 50 USDC. |
| `maxLtvPercent` | `number` | No | Optional safety cap. Reject the borrow if the resulting LTV would exceed this percentage. Example: 75 = cap at 75%. |
| `gasLimit` | `string` | No | Optional gas limit as a positive integer string \(e.g., "300000"\) |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | Yes | - |
| `transactionHash` | `string` | Yes | - |
| `transactionUrl` | `string` | No | Block explorer URL for the transaction \(e.g. https://basescan.org/tx/0x...\) |
| `blockNumber` | `number` | No | - |
| `borrowedAmount` | `string` | No | Raw amount of loan token borrowed in this call \(wei\) |
| `borrowedAmountFormatted` | `string` | No | Human-readable borrowed amount in loan token units |
| `resultingLtvPercent` | `number` | No | Position LTV \(%\) after this borrow, computed from oracle price |

## Examples

**Workflow node**

```json
{
  "type": "morpho-blue-borrow",
  "payload": {
    "marketId": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "chainId": 1,
    "amount": "1000000"
  },
  "children": [],
  "connector": {
    "type": "wallet",
    "id": "conn_wallet"
  }
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/morpho-blue-borrow/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "marketId": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "chainId": 1,
    "amount": "1000000"
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.