Morpho Blue Withdraw
Withdraw lender supply from a Morpho Blue market. Modes: 'exact' (specific asset amount) or 'max' (full position, sweeps dust via shares). Supports Ethereum (1), Optimism (10), Polygon (137), Base (8453), Arbitrum (42161). Ideal for: yield harvesting, closing lender position, liquidity rotation.
Catalog action EVM Onchain wallet Gas
Withdraw lender supply from a Morpho Blue market. Modes: 'exact' (specific asset amount) or 'max' (full position, sweeps dust via shares). Supports Ethereum (1), Optimism (10), Polygon (137), Base (8453), Arbitrum (42161). Ideal for: yield harvesting, closing lender position, liquidity rotation.
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-withdraw |
| Category | EVM Onchain |
| Connector | wallet |
| Requires gas | Yes |
| Funds movement | None declared |
| Tags | morpho, morpho-blue, lending, withdraw, 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" = withdraw a specific asset amount. "max" = withdraw entire lender position (sweeps dust via shares). |
amount | string | No | Required when amountMode="exact". Loan-token raw amount to withdraw. |
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 | - |
withdrawnAssets | string | No | Raw amount of loan token withdrawn (wei). For 'max', this is the pre-tx accrued supplyAssets estimate. |
withdrawnAssetsFormatted | string | No | Human-readable withdrawn amount in loan token units |
isFullyClosed | boolean | No | True if supplyShares reached zero after this withdraw |
Examples
json{ "type": "morpho-blue-withdraw", "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-withdraw/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.
