Morpho Blue Repay
Repay borrowed loan token on a Morpho Blue market. Modes: 'exact' (specific amount), 'target-ltv' (restore LTV to target %), or 'max' (full close, dust-free via shares). Supports Ethereum (1), Optimism (10), Polygon (137), Base (8453), Arbitrum (42161). Ideal for: LTV-alert auto-repay, position unwind, leverage de-risking, automated debt management.
Catalog action EVM Onchain wallet Gas
Repay borrowed loan token on a Morpho Blue market. Modes: 'exact' (specific amount), 'target-ltv' (restore LTV to target %), or 'max' (full close, dust-free via shares). Supports Ethereum (1), Optimism (10), Polygon (137), Base (8453), Arbitrum (42161). Ideal for: LTV-alert auto-repay, position unwind, leverage de-risking, automated debt management.
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-repay |
| Category | EVM Onchain |
| Connector | wallet |
| Requires gas | Yes |
| Funds movement | None declared |
| Tags | morpho, morpho-blue, lending, repay, 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), Base (8453), Arbitrum (42161) |
amountMode | string | Yes | "exact" = repay a specific asset amount. "target-ltv" = repay to restore LTV to a target percentage. "max" = repay all debt (dust-free via shares). |
amount | string | No | Required when amountMode="exact". Loan-token raw amount to repay. |
targetLtvPercent | number | No | Required when amountMode="target-ltv". Target LTV percentage (e.g., 65 = 65%). |
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 | - |
repaidAssets | string | No | Raw amount of loan token actually repaid (wei). For 'max', this is the delta between pre-tx and post-tx borrowAssets. |
repaidAssetsFormatted | string | No | Human-readable repaid amount in loan token units |
resultingLtvPercent | number | null | No | Position LTV (%) after this repay, computed from oracle price. null if unavailable or fully closed. |
isFullyClosed | boolean | No | True if borrowShares reached zero after this repay |
Examples
json{ "type": "morpho-blue-repay", "payload": { "marketId": "example-marketId", "chainId": 1, "amountMode": "exact" }, "children": [], "connector": { "type": "wallet", "id": "conn_wallet" }}
bashcurl -X POST "https://api.b3os.org/v1/actions/morpho-blue-repay/test" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "marketId": "example-marketId", "chainId": 1, "amountMode": "exact" }}'
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.
