safe-transactions
Installation
SKILL.md
Safe Morpho transactions
Every tool named here comes from Morpho's MCP server, https://mcp.morpho.org/. The morpho_prepare_* tools return an unsigned transaction for the user's own wallet to review, sign and send. They never sign or send anything.
The order is always: look up → read the position → state the details → build → hand over unsigned.
Steps
- Look up the target in this session. Fetch the vault or market with a tool call now, even when it looks familiar. Never take an address, market ID or token decimals from memory.
- Vault:
morpho_get_vaultwithvault-selector<chainId>:<vaultAddress>(it returns a V1 or V2 vault). For what the vault can pay out now, read itsliquidityfrommorpho_query_vaults. - Market:
morpho_get_marketwithmarket-selector<chainId>:<marketId>. It returns the loan and collateral tokens andliquidity_assets, what can be borrowed or withdrawn now. - If the user gave a name instead of an address, find it with
morpho_query_vaults(search,chain_ids) ormorpho_query_markets, and ask the user to confirm the address when more than one matches.
- Vault:
- Read the user's current position before sizing anything, with their
user-addressandchain_ids:morpho_get_vault_positionsfor a vault,morpho_get_market_positionsfor a market. For a deposit, supply or repay, check the wallet holds the token withmorpho_get_token_balance. A withdrawal can't exceed the position or what the vault or market can pay out now. For a borrow, report the currenthealth_factorfrommorpho_get_market_positionsonly when the response includes it. The build step's simulation rejects a borrow or collateral withdrawal that would leave the position unhealthy (POSITION_UNHEALTHY), but no tool returns the health factor after it: never state one as a fact; show the current position and what changes. - State the details before building: chain (name and chain ID), full vault address or market ID, the user's account address, the token, and the amount in both token units and the base units you will send. Amounts are integer strings in base units: 1,000 USDC (6 decimals) is
"1000000000". Read the decimals from a tool response. - Build with the matching
morpho_prepare_*tool, using the same selector as step 1 and the intent inbody. Vault prepare tools pick V1 or V2 from the vault itself.morpho_prepare_claim_rewardstakes achainslug and a plain address instead. Ifdata.statusissignature_required, the user signs eachdata.signatures[].typed_datamessage in their own wallet and gives you the signatures; call the same tool again withcontinuationand those signatures. - Hand over unsigned. Show every call in
data.calls, in order, with its target, value and data, plusdata.simulation.status,data.expires_atand every warning by level. Say plainly that nothing has been signed or sent, and tell the user to check the chain, addresses and amounts in their wallet before signing.morpho_prepare_claim_rewardsreturnstransactionsandwarningsinstead ofdata.calls; present them the same way. Then stop: signing and sending are the user's move.