morpho

Interact with Morpho Blue lending markets and MetaMorpho vaults on Ethereum using viem.

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill morpho-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: morpho
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/morpho
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill morpho-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires viem, and includes references (resource) components.

What problem does it solve? AI agents frequently confuse Morpho Blue with the deprecated Morpho Optimizer (V1), hallucinate contract addresses, misuse market IDs, and mishandle the shares-versus-assets pattern, leading to failed transactions or lost funds. This Skill provides verified contract addresses, correct ABI fragments, and tested interaction patterns for Morpho Blue and MetaMorpho vaults. ## Core Features & Use Cases - Market Operations: Supply, withdraw, borrow, repay, and manage collateral on Morpho Blue's singleton contract with correct market ID derivation via keccak256 of MarketParams. - MetaMorpho Vault Integration: Deposit and redeem from ERC-4626 curated vaults like Steakhouse USDC and Gauntlet Prime using standard vault interfaces. - Liquidation & Market Creation: Execute liquidations with seizedAssets or repaidShares, and create permissionless markets with governance-enabled LLTVs and IRMs. - Use Case: Build a TypeScript bot that supplies USDC to a Morpho Blue market, monitors borrow rates from the AdaptiveCurveIRM, and automatically liquidates undercollateralized positions. ## Quick Start Ask the agent to supply 1000 USDC to the Morpho Blue USDC/wstETH market on Ethereum mainnet using viem.

Frequently Asked Questions about morpho

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I supply assets to a Morpho Blue market with viem?

Approve the Morpho singleton contract to spend your loan token, then call supply with MarketParams, the assets amount, shares set to zero, and the onBehalf address. Exactly one of assets or shares must be nonzero or the call reverts with InconsistentInput.

How is a Morpho Blue market ID computed?

The market ID is keccak256 of the ABI-encoded five MarketParams: loanToken, collateralToken, oracle, irm, and lltv. It is a bytes32 hash, not a numeric index, and all markets live in the single singleton contract.

What is the difference between Morpho Blue and Morpho Optimizer?

Morpho Blue is a standalone, immutable lending primitive with its own singleton contract, while Morpho Optimizer (V1) was a peer-to-peer matching layer on Aave and Compound. They have different addresses, interfaces, and architectures.

Why does my Morpho borrow transaction revert with InsufficientCollateral?

The borrow exceeds the collateral capacity at the current oracle price and LLTV. Confirm you called supplyCollateral rather than supply, verify the oracle returns a nonzero price, and borrow well below the LLTV threshold.

How do I deposit into a MetaMorpho vault?

MetaMorpho vaults use the standard ERC-4626 interface. Approve the vault address to spend the asset, check maxDeposit for caps, then call deposit with the asset amount and receiver address to receive vault shares.

Why does repaying my Morpho loan leave dust debt?

Interest accrues between reading your debt and executing repayment, so repaying by assets leaves a remainder. Repay by passing your exact borrowShares with assets set to zero, and over-approve the loan token slightly to cover accrued interest.