Use this workflow when the user wants to swap tokens on the same chain.
Reference command syntax in references/swap.md.
- Quote.
- Confirm with the user.
- Execute and track status.
Do not skip the quote review step. It is where the user sees output amount, fees, route, and slippage.
mm-dev swap quote --from ETH --to USDC --amount 1 --from-chain 1Required flags: --from, --to, --amount, and --from-chain.
Persist the quote id for execution. Show the quote to the user before execution. Confirm source token, destination token, amount, chain, slippage, expected output, fees, and route.
mm-dev swap execute --quote-id "$QUOTE_ID"Prefer executing by quote ID. Re-quote-and-execute flags exist, but quote ID execution keeps the reviewed quote tied to the submitted action.
mm-dev swap status --quote-id "$QUOTE_ID"- Quote expired: re-quote and ask the user to review the new quote.
- Insufficient balance: surface the error verbatim.
- Slippage exceeded: only increase
--slippageif the user explicitly accepts more slippage. Always warn the user if slippage is increased above 1% that it will affect the minimum received. - Missing chain: use
mm-dev chains listbefore guessing a chain ID.