prepare_morpho_supply
Deposit loan tokens into Morpho Blue markets to earn lending yield. Builds unsigned supply transactions for Ledger signing, automatically handling ERC-20 approvals when needed.
Instructions
Build an unsigned Morpho Blue supply transaction — deposits the market's loan token to earn lending yield. Market params (loan/collateral tokens, oracle, IRM, LLTV) are resolved on-chain from the market id, so only wallet/marketId/amount are required. If the wallet's current allowance is insufficient, an ERC-20 approve tx is emitted first (chainable via .next); control the cap with approvalCap (defaults to unlimited for UX, pass 'exact' or a decimal ceiling to scope it). Returns a handle + preview for Ledger signing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet | Yes | 0x-prefixed EVM wallet address (40 hex chars) that will execute this action. | |
| chain | No | EVM chain Morpho Blue is deployed on. Currently only ethereum is enabled. | ethereum |
| marketId | Yes | Morpho Blue market id — 32-byte hex (0x + 64 hex chars). Identifies the market's (loanToken, collateralToken, oracle, irm, lltv) tuple. Discover via get_morpho_positions. | |
| amount | Yes | Human-readable decimal amount, NOT raw wei/base units. Example: "10" for 10 USDC. Pass "max" for full-balance withdraw/repay. | |
| approvalCap | No | Cap on the ERC-20 approval preceding this action. Omit for "unlimited" (standard DeFi UX — fewer follow-up approvals). Pass "exact" to approve only what this action pulls. Pass a decimal string (e.g. "500") for a specific ceiling in the asset's human units; must be ≥ the action amount, otherwise the transaction would revert. |