earn-integration
Installation
SKILL.md
Earn Integration — Vault V2
Build and review Earn products on Morpho Vault V2. Do not silently substitute a Vault V1/MetaMorpho flow, a direct Blue supply position, or a generic ERC-4626 recipe.
Use the authoritative Morpho documentation index, Morpho SDK documentation, and Core API reference for current signatures and schemas. Keep copied examples small; link to the current specification instead of recreating it.
Choose a mode
- Build or update: read references/vault-v2.md completely, then implement only the surfaces relevant to the request.
- Review, audit, QA, or pre-launch: read references/review.md completely. Review only unless the user explicitly asks for fixes.
Build workflow
- Confirm chain, Vault V2 address, underlying asset, user/account, requested action, and whether the app needs indexed analytics or execution-fresh state.
- Discover candidates with the Morpho API; resolve the selected vault to a fresh
client.morpho.vaultV2(address, chainId)entity before previewing or building a transaction. - Use the primary
@morpho-org/morpho-sdkaction flow: create the action, await and satisfy everygetRequirements()result, callbuildTx(...), simulate the final authorized transaction, then submit and wait for a receipt. - Preserve bigint token units, token-specific decimals, explicit slippage/deadline choices, and the builder/signer invariant. Never hand-build a supported vault or bundler transaction.
- Show the vault identity, variable APY breakdown, fees, rewards by token, allocation exposure, available withdrawal paths, risks, and data freshness on the surfaces where each fact changes the user's decision.
- Re-fetch critical state immediately before building or submitting. Indexed API data is not transaction state.