Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(deploy): replace data/skills metamask symlinks with real files
nirholas9bb803074153
diff --git a/data/skills/metamask-agent-wallet b/data/skills/metamask-agent-walletdeleted file mode 120000index 7d5b9dd72..000000000--- a/data/skills/metamask-agent-wallet+++ /dev/null@@ -1 +0,0 @@-../../.agents/skills/metamask-agent-wallet\ No newline at end of filediff --git a/data/skills/metamask-agent-wallet/SKILL.md b/data/skills/metamask-agent-wallet/SKILL.mdnew file mode 100644index 000000000..2b39ad410--- /dev/null+++ b/data/skills/metamask-agent-wallet/SKILL.md@@ -0,0 +1,259 @@+---+name: metamask-agent-wallet+description: Use when the user asks anything about blockchain wallets, transactions, signing, token transfers, supported chains, wallet balances, perpetual futures trading, prediction markets, token swaps, cross-chain bridges, market data, token discovery, decoding EVM calldata, Aave V3 lending and borrowing, or authentication via the MetaMask Agentic CLI. Single entry point for all mm CLI operations.+license: MIT+metadata:+ author: metamask+ version: "2.2.0"+ cliVersion: "1.0.0"+---++# MetaMask Agentic CLI Skill++This skill documents the `mm` CLI surface for MetaMask Agent Wallet authentication, wallet lifecycle, balance queries, token transfers, message and typed-data signing, raw transactions, chain discovery, market data, token discovery, perpetual futures trading, prediction market trading, token swaps, and cross-chain bridges.++Use the routing table to select the relevant reference file. CLI behavior lives in `references/`. Repeatable operational patterns live in `workflows/`.++## Command Routing++Match the user's intent to a command and reference file, then read the reference before constructing a command. If intent spans multiple domains, load them sequentially in dependency order.++| User Intent | Command | Reference |+| --- | --- | --- |+| Check authentication status | `mm auth status` | [auth.md](references/auth.md) |+| Login in MetaMask Agentic CLI | `mm login` | [auth.md](references/auth.md) |+| Choose a wallet mode and set up policies | `mm init` | [auth.md](references/auth.md) |+| Show current init settings | `mm init show` | [auth.md](references/auth.md) |+| Sign in via QR code with MetaMask Mobile | `mm login qr` | [auth.md](references/auth.md) |+| Sign in via Google | `mm login google` | [auth.md](references/auth.md) |+| Sign in via email OTP | `mm login email` | [auth.md](references/auth.md) |+| Sign out | `mm logout` | [auth.md](references/auth.md) |+| Reset CLI session | `mm reset` | [auth.md](references/auth.md) |+| Show CLI configuration | `mm config get` | [auth.md](references/auth.md) |+| Set CLI configuration | `mm config set` | [auth.md](references/auth.md) |+| Set BYOK mnemonic encryption password | `mm wallet password set` | [auth.md](references/auth.md) |+| Change BYOK mnemonic encryption password | `mm wallet password change` | [auth.md](references/auth.md) |+| Remove BYOK mnemonic encryption password | `mm wallet password remove` | [auth.md](references/auth.md) |+| Interpret raw CLI error codes | `AuthError`, `ValidationError`, `WALLET_ERROR` | [errors.md](references/errors.md) |+| Decode EVM calldata into a human-readable intent | `mm decode` | [decode.md](references/decode.md) |+| Create a wallet | `mm wallet create` | [wallet.md](references/wallet.md) |+| List all wallets | `mm wallet list` | [wallet.md](references/wallet.md) |+| Switch active wallet | `mm wallet select` | [wallet.md](references/wallet.md) |+| Show active wallet details | `mm wallet show` | [wallet.md](references/wallet.md) |+| Show active wallet address | `mm wallet address` | [wallet.md](references/wallet.md) |+| Check the active wallet balance | `mm wallet balance` | [wallet.md](references/wallet.md) |+| Show current trading mode and policies | `mm wallet trading-mode get` | [wallet.md](references/wallet.md) |+| Set trading mode (guard or beast) | `mm wallet trading-mode set` | [wallet.md](references/wallet.md) |+| Sign a plaintext message | `mm wallet sign-message` | [signing.md](references/signing.md) |+| Sign EIP-712 typed data | `mm wallet sign-typed-data` | [signing.md](references/signing.md) |+| Send a raw EVM transaction | `mm wallet send-transaction` | [transaction.md](references/transaction.md) |+| Transfer native tokens or ERC-20 tokens | `mm transfer` | [transfer.md](references/transfer.md) |+| List supported chains by the CLI | `mm chains list` | [chain.md](references/chain.md) |+| List pending wallet requests | `mm wallet requests list` | [polling.md](references/polling.md) |+| Watch a wallet polling id | `mm wallet requests watch` | [polling.md](references/polling.md) |+| Query spot or historical prices | `mm price ...` | [market-data.md](references/market-data.md) |+| Discover tokens, token networks, or token metadata | `mm token ...` | [market-data.md](references/market-data.md) |+| List perpetual markets | `mm perps markets` | [perps.md](references/perps.md) |+| Check perps account balance | `mm perps balance` | [perps.md](references/perps.md) |+| List open perpetual positions | `mm perps positions` | [perps.md](references/perps.md) |+| Get a quote for a perpetual order | `mm perps quote` | [perps.md](references/perps.md) |+| List resting perpetual orders | `mm perps orders` | [perps.md](references/perps.md) |+| Open a perpetual position | `mm perps open` | [perps.md](references/perps.md) |+| Close a perpetual position | `mm perps close` | [perps.md](references/perps.md) |+| Modify leverage, take-profit, or stop-loss | `mm perps modify` | [perps.md](references/perps.md) |+| Cancel a resting perps order | `mm perps cancel` | [perps.md](references/perps.md) |+| Deposit USDC into a perps venue | `mm perps deposit` | [perps.md](references/perps.md) |+| Withdraw USDC from a perps venue | `mm perps withdraw` | [perps.md](references/perps.md) |+| Transfer USDC between spot and perp accounts | `mm perps transfer` | [perps.md](references/perps.md) |+| List perpetual futures venues | `mm perps list-venues` | [perps.md](references/perps.md) |+| List available DEXs for a venue | `mm perps dexs` | [perps.md](references/perps.md) |+| Set Predict trading mode | `mm predict mode` | [predict.md](references/predict.md) |+| One-time Predict setup | `mm predict setup` | [predict.md](references/predict.md) |+| Create or refresh Predict credentials | `mm predict auth` | [predict.md](references/predict.md) |+| Repair Predict approvals | `mm predict approve` | [predict.md](references/predict.md) |+| Check Predict back-end status and account setup | `mm predict status` | [predict.md](references/predict.md) |+| Check if Polymarket is geoblocked for your IP | `mm predict geoblock` | [predict.md](references/predict.md) |+| List prediction markets | `mm predict markets list` | [predict.md](references/predict.md) |+| Search prediction markets | `mm predict markets search` | [predict.md](references/predict.md) |+| Inspect a prediction market | `mm predict markets get` | [predict.md](references/predict.md) |+| List Polymarket events | `mm predict events list` | [predict.md](references/predict.md) |+| Inspect a Polymarket event | `mm predict events get` | [predict.md](references/predict.md) |+| List Polymarket event series | `mm predict series list` | [predict.md](references/predict.md) |+| Inspect a Polymarket event series | `mm predict series get` | [predict.md](references/predict.md) |+| List Polymarket tags | `mm predict tags list` | [predict.md](references/predict.md) |+| Inspect a Polymarket tag | `mm predict tags get` | [predict.md](references/predict.md) |+| Preview a prediction order cost | `mm predict quote` | [predict.md](references/predict.md) |+| Place a prediction market order | `mm predict place` | [predict.md](references/predict.md) |+| Cancel prediction orders | `mm predict cancel` | [predict.md](references/predict.md) |+| View prediction market positions | `mm predict positions` | [predict.md](references/predict.md) |+| View open prediction orders | `mm predict orders` | [predict.md](references/predict.md) |+| Show full Predict portfolio snapshot | `mm predict portfolio` | [predict.md](references/predict.md) |+| List redeemable (winning) positions | `mm predict redeem list` | [predict.md](references/predict.md) |+| Redeem winning positions | `mm predict redeem` | [predict.md](references/predict.md) |+| Check Predict deposit wallet balance | `mm predict balance` | [predict.md](references/predict.md) |+| Fund Predict deposit wallet | `mm predict deposit` | [predict.md](references/predict.md) |+| Withdraw pUSD from Predict deposit wallet | `mm predict withdraw` | [predict.md](references/predict.md) |+| Fetch prediction order book | `mm predict book` | [predict.md](references/predict.md) |+| Watch a Predict job | `mm predict watch` | [predict.md](references/predict.md) |+| Get a swap or bridge quote | `mm swap quote` | [swap.md](references/swap.md) |+| Execute a token swap or bridge | `mm swap execute` | [swap.md](references/swap.md) |+| Check swap or bridge status | `mm swap status` | [swap.md](references/swap.md) |+| Bridge tokens to another chain | `mm swap execute` | [swap.md](references/swap.md) |++## Workflows++CLI behavior lives in `references/`. Repeatable patterns live in `workflows/`. Load a workflow file when the user's request is a pattern, not a single command.++| Pattern | Workflow |+| --- | --- |+| First time setup and onboarding | [onboarding.md](workflows/onboarding.md) |+| Login flow | [login.md](workflows/login.md) |+| Troubleshooting decision tree | [troubleshooting.md](workflows/troubleshooting.md) |+| Swap quote-review-execute flow | [swap.md](workflows/swap.md) |+| Bridge quote-review-execute flow | [bridge.md](workflows/bridge.md) |+| Open a perpetual position flow | [perps-open-position.md](workflows/perps-open-position.md) |+| Close a perpetual position flow | [perps-close-position.md](workflows/perps-close-position.md) |+| Modify a perpetual position flow | [perps-modify-position.md](workflows/perps-modify-position.md) |+| Predict first-time setup and credentials | [predict-setup.md](workflows/predict-setup.md) |+| Deposit or withdraw pUSD from Predict wallet | [predict-funding.md](workflows/predict-funding.md) |+| Search and browse prediction markets | [predict-markets.md](workflows/predict-markets.md) |+| Quote and place a prediction order | [predict-place-order.md](workflows/predict-place-order.md) |+| View or cancel Predict orders and positions | [predict-manage-orders.md](workflows/predict-manage-orders.md) |+| View Predict portfolio and redeem winnings | [predict-portfolio.md](workflows/predict-portfolio.md) |+| Token discovery, prices, and market data | [market-data.md](workflows/market-data.md) |+| Supply assets to Aave V3 | [aave-supply.md](workflows/aave-supply.md) |+| Withdraw assets from Aave V3 | [aave-withdraw.md](workflows/aave-withdraw.md) |+| Borrow from Aave V3 | [aave-borrow.md](workflows/aave-borrow.md) |+| Repay Aave V3 debt | [aave-repay.md](workflows/aave-repay.md) |+| Toggle Aave V3 collateral | [aave-collateral.md](workflows/aave-collateral.md) |+| Check Aave V3 positions and health factor | [aave-positions.md](workflows/aave-positions.md) |+| Discover Aave V3 tokens, rates, and liquidity | [aave-markets.md](workflows/aave-markets.md) |++## Global Flags++Every `mm` command accepts these flags:++| Flag | Short | Description |+| --- | --- | --- |+| `--format` | `-f` | Output format: `text`, `json`, `yaml`, `toml`, or `toon` (defaults to `text` in TTY, `json` when piped) |+| `--json` | | Shorthand for `--format=json` |+| `--toon` | | Shorthand for `--format=toon` |+| `--verbose` | `-v` | Show debug logs on stderr. Use for troubleshooting |++Always use `--toon` for command output unless the user explicitly requests a different format.++## Preflight++Run these checks before the first CLI operation in a session, in order.++### 1. Version compatibility++This skill is written for `@metamask/agentic-cli` **v1.0.0** (see `cliVersion` in the frontmatter). Check the installed version:++```bash+mm --version+```++The installed version is the value after `@metamask/agentic-cli/` (e.g. `@metamask/agentic-cli/1.0.0 darwin-arm64 node-v24.14.1`). Compare its `major.minor` against the pinned `cliVersion`. Optionally check the latest published version (best-effort; skip silently on network failure):++```bash+npm view @metamask/agentic-cli version+```++If the installed `major.minor` differs from the pinned `cliVersion`, or the installed version is behind the latest release, warn the user once and continue:++> Version mismatch: installed CLI `<installed>`, this skill is pinned to `1.0.0`, latest release is `<latest>`. Command syntax in this skill may be inaccurate until they are aligned. Update the CLI with `npm install -g @metamask/agentic-cli@latest`, then re-install the skills with `npx skills add metaMask/agent-skills`.++Run this check once per session. Do not block operations on it.++### 2. Authentication++```bash+mm auth status+```++If the user is not authenticated, follow `workflows/onboarding.md` for first time setup, or `workflows/login.md` for login.++## Safety Rules++These rules apply to every operation, regardless of which reference or workflow is active.++### Input Validation++Before constructing any command, validate all user-provided values:++| Flag | Validation rule |+| --- | --- |+| `--to`, `--address` | Must match `^0x[0-9a-fA-F]{40}$` |+| `--amount` | Human-readable decimal (e.g. 0.5, 100). Must match `^\d+\.?\d*$`. Reject spaces, semicolons, pipes, backticks, or shell metacharacters |+| `--chain-id` | Must be a positive integer (`^\d+$`) |+| `--payload` (send-transaction) | Must be valid JSON. No unescaped shell metacharacters outside the JSON structure |+| `--payload` (decode) | Must be 0x-prefixed hex calldata, matching `^0x[0-9a-fA-F]+$` |+| `--token` | Must be a valid hex address or known symbol |+| `--leverage` | Must be a positive integer (`^\d+$`) |+| `--size` | Human-readable decimal (e.g. 0.01, 1). Must match `^\d+\.?\d*$` and be positive |+| `--venue` | Must be `hyperliquid` |+| `--side` (perps) | Must be `long` or `short` |+| `--order-id` | Must be a positive integer (`^\d+$`) |+| `--token-id` | Must be a non-empty outcome token ID string |+| `--price`, `--limit-price` | Must be a positive number in range `(0, 1]` |+| `--order-type` | Must be one of `GTC`, `GTD`, `FOK`, `FAK` |+| `--side` (predict) | Must be `buy` or `sell` |+| `--slippage` | Must be a number between 0 and 100 |+| `--from-chain`, `--to-chain` | Must be a positive integer EVM chain ID |+| `--to-address` | Must match `^0x[0-9a-fA-F]{40}$`. Only valid for cross-chain swaps (`--to-chain` differs from `--from-chain`); rejected for same-chain swaps |+| `--password` | Must be a non-empty string. Never log, display, or store the value. |++Do not pass unvalidated user input into any command.++### Confirmation Requirements++| Operation type | Confirmation rule |+| --- | --- |+| Transfers | Always confirm recipient, amount, token, and chain before executing |+| Raw transactions | Always confirm transaction payload, chain, recipient, value, and calldata summary before executing |+| Message signing | Always show exact message and chain before signing |+| Typed-data signing | Always show domain, primary type, chain, verifying contract, and message summary before signing |+| Swaps / bridges | Always confirm from/to tokens, amount, source/destination chain, slippage, quoted output, and recipient address (if `--to-address` is set) before executing |+| Perps trading | Always confirm symbol, side, size, leverage, venue, order type, and limit price if present before executing |+| Perps deposit/withdraw | Always confirm amount, asset, venue, network, and destination where applicable before executing |+| Predict trading | Always confirm token ID, side, size, price, order type, market, and outcome before executing |+| Predict deposit | Always confirm amount before executing |+| Predict withdraw | Always confirm amount and recipient (`--to` defaults to owner EOA) before executing |+| Predict redeem | Always confirm the target (condition ID or `--all`) before executing; `--all` redeems every winning position |+| Cancel-all operations | Always confirm scope and exact destructive effect before executing |+| Auth / wallet management | May execute without confirmation, except `reset` which requires explicit user confirmation |+| Read-only queries | May execute without confirmation |++### Credential Safety++- Never store, log, or display private keys, mnemonics, passwords, or auth tokens.+- Never pass `--password` or `--mnemonic` as inline flags. Always instruct the user to set the `MM_PASSWORD` and `MM_MNEMONIC` environment variables instead to avoid exposing secrets in shell history.++### Suspicious Content Warnings++Flag to the user before proceeding if a signing payload or transaction contains:++- URLs or contract addresses the user did not provide+- `permit`, `approve`, `setApprovalForAll`, or allowance-like fields+- Unusually large values or unfamiliar contract interactions++When raw calldata is unfamiliar or was not constructed by you, run `mm decode --payload <0x-calldata>` first and confirm the decoded intent with the user before signing or sending. See [decode.md](references/decode.md).++## Server Wallet Async Model++In server-wallet mode, signing and transaction commands return a `pollingId` instead of an immediate result. Handle this consistently:++1. Prefer `--wait` to block until complete.+2. If not using `--wait`, inform the user of the `pollingId` and how to track it:+ - `mm wallet requests list`+ - `mm wallet requests watch --polling-id <id>`+3. In BYOK mode, results are returned immediately. If the mnemonic is password-encrypted, the user must set `MM_PASSWORD` environment variable to unlock it for the operation.++Transfers, swaps, perps, predict orders, and predict withdraws attach a human-readable `intent` summary to their wallet request (e.g. `Transfer 0.5 ETH to 0x...`, `Withdraw 10 pUSD to 0x...`). When surfacing a pending request from `wallet requests list` or `wallet requests watch`, show the `intent` summary so the user can confirm what they are approving.++## Output Rules++- Route silently. Do not announce which reference you are loading.+- Surface errors from commands verbatim. Do not mask or reword them.+- If a command fails, check `mm <command> --help` and guide from there.diff --git a/data/skills/metamask-agent-wallet/references/auth.md b/data/skills/metamask-agent-wallet/references/auth.mdnew file mode 100644index 000000000..1f70aef90--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/auth.md@@ -0,0 +1,301 @@+# Authentication Commands++Use these commands to initialize wallet mode, sign in, inspect authentication status, and clear local session state.++## `init` Command++Initialize the project by selecting wallet mode and trading mode. Requires an authenticated session — run `mm login` first.++### Syntax++```bash+mm init [--wallet <mode>] [--mode <mode>] [--mnemonic <phrase>] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--wallet` | No | Wallet mode: `server-wallet` or `byok` |+| `--mode` | No | Trading mode: `guard` or `beast` (server-wallet only) |+| `--mnemonic` | No | BIP-39 mnemonic phrase for BYOK wallet. Never pass inline — set `MM_MNEMONIC` env var instead. |+| `--password` | No | Password to encrypt the BYOK mnemonic at rest. Never pass inline — set `MM_PASSWORD` env var instead. If omitted in interactive mode, the CLI prompts. If omitted in non-interactive mode, mnemonic is stored unencrypted. |++### Example++```bash+mm init+mm init --wallet server-wallet --mode beast+export MM_MNEMONIC="word1 word2 ..."+mm init --wallet byok++export MM_MNEMONIC="word1 word2 ..."+export MM_PASSWORD="mypassword"+mm init --wallet byok+```++### Note++- In server-wallet mode, if the account already has a remote EVM wallet, `mm init` syncs it and loads the existing trading mode and policies instead of prompting for a new trading mode or creating a wallet.++## `init show` Command++Display the current initialization settings (wallet mode, trading mode, policies).++### Syntax++```bash+mm init show+```++### Supported Flags++This command does not support additional flags beyond output format options.++### Example++```bash+mm init show+```++## `login` Command++Sign in to the CLI. On a TTY, bare `mm login` shows a method picker (MetaMask Mobile QR, Google, or email). QR is recommended but not auto-selected.++### Syntax++```bash+mm login [qr | google | email] [--token <token>] [--timeout <seconds>] [--no-wait]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--token` | No | Pre-minted CLI token in `cliToken:cliRefreshToken` format [env: `MM_CLI_TOKEN`] |+| `--timeout` | No | Seconds to wait for QR or browser callback |+| `--no-wait` | No | Print the sign-in URL and exit without waiting (for non-interactive/CI use). Not supported with QR login. Complete later with `mm login --token` |++### Example++```bash+mm login --no-wait+mm login google --no-wait+mm login email --no-wait+mm login --token "cliToken:cliRefreshToken"+```++### Note++- If already authenticated, the CLI returns `ALREADY_AUTHENTICATED`. Run `mm logout` first, then log in again.+- `mm login qr` (scan with MetaMask Mobile) is available on non-production builds (dev/uat). On production it returns `COMING_SOON`; use Google or email sign-in instead.+- Pairing codes tolerate `-` and whitespace separators (e.g. `608-225` is equivalent to `608225`).+- Use `mm login google --no-wait` or `mm login email --no-wait` for non-interactive/CI flows. Bare `mm login --no-wait` fails without a TTY because no method is selected.+- `--no-wait` is not supported with QR login. Complete authentication later with `mm login --token`.++## `auth status` Command++Show the current authentication status.++### Syntax++```bash+mm auth status [--toon]+```++### Supported Flags++This command does not support additional flags beyond output format options.++### Example++```bash+mm auth status+mm auth status --toon+```++## `logout` Command++Sign out and clear auth credentials plus local init state, wallet selection, and stored BYOK mnemonic.++### Syntax++```bash+mm logout+```++### Supported Flags++This command does not support flags.++### Example++```bash+mm logout+```++## `config get` Command++Show persisted CLI configuration. Does not require authentication.++### Syntax++```bash+mm config get [env|verbose|format]+```++### Supported Keys++| Key | Description |+| --- | --- |+| `env` | Target API environment: `prod`, `dev`, or `uat` (defaults to `prod` when unset) |+| `verbose` | Whether verbose logging is persisted (`true` or `false`) |+| `format` | Default output format: `json`, `text`, `yaml`, `toml`, or `toon` |++Omit the key to return all values.++### Example++```bash+mm config get+mm config get env+```++## `config set` Command++Persist a CLI configuration value in `~/.metamask/config.json`. Does not require authentication.++### Syntax++```bash+mm config set <env|verbose|format> <value>+```++### Supported Keys++| Key | Values |+| --- | --- |+| `env` | `prod`, `dev`, or `uat` |+| `verbose` | `true` or `false` |+| `format` | `json`, `text`, `yaml`, `toml`, or `toon` |++### Overrides++Persisted values can be overridden per invocation without changing `~/.metamask/config.json`:++| Key | Override |+| --- | --- |+| `env` | `MM_ENV` environment variable |+| `verbose` | `--verbose` / `-v` flag |+| `format` | `--format`, `--json`, `--toon`, etc. |++### Example++```bash+mm config set env prod+mm config set env dev+mm config set env uat+mm config set format toon+```++### Note++- Switch environments at any time with `mm config set env <prod|dev|uat>`.+- Non-prod sessions are stored in env-scoped files under `~/.metamask/` (e.g. `session.dev.json`, `session.uat.json`); prod uses `session.json`.++## `reset` Command++Clear the local CLI session entirely, including auth credentials, wallet state, mnemonic, swap quotes, and persisted config.++### Syntax++```bash+mm reset+```++### Supported Flags++This command does not support flags.++### Example++```bash+mm reset+```++## `wallet password set` Command++Set a password to encrypt the BYOK mnemonic at rest. Only available in BYOK mode when the mnemonic is currently unencrypted.++### Syntax++```bash+mm wallet password set [--new <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--new` | No | New password. If omitted, the CLI prompts interactively. |++### Example++```bash+mm wallet password set+mm wallet password set --new "mypassword"+```++## `wallet password change` Command++Change the BYOK mnemonic encryption password. Only available when the mnemonic is currently encrypted.++### Syntax++```bash+mm wallet password change [--current <password>] [--new <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--current` | No | Current password. If omitted, the CLI prompts interactively. |+| `--new` | No | New password. If omitted, the CLI prompts interactively. |++### Example++```bash+mm wallet password change+mm wallet password change --current "oldpassword" --new "newpassword"+```++## `wallet password remove` Command++Remove the BYOK mnemonic encryption password, storing the mnemonic as plaintext. Only available when the mnemonic is currently encrypted.++### Syntax++```bash+mm wallet password remove [--current <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--current` | No | Current password. If omitted, the CLI prompts interactively. |++### Example++```bash+mm wallet password remove+mm wallet password remove --current "mypassword"+```++## Wallet Modes++| Mode | Behavior |+| --- | --- |+| `server-wallet` | Keys hosted by MetaMask infrastructure. Signing and transaction operations may return async job handles. |+| `byok` | Bring your own local mnemonic. Operation results are returned immediately. If the mnemonic is encrypted with a password, the CLI requires `--password` or interactive prompt to unlock before any operation that needs the private key. |diff --git a/data/skills/metamask-agent-wallet/references/chain.md b/data/skills/metamask-agent-wallet/references/chain.mdnew file mode 100644index 000000000..a09e4a622--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/chain.md@@ -0,0 +1,30 @@+# Chain Commands++Use `chains` commands to discover supported blockchain networks.++## `chains list` Command++List all supported EVM blockchain networks (EIP-155).++### Syntax++```bash+mm chains list [--toon]+```++### Supported Flags++This command does not support additional flags beyond output format options.++### Example++```bash+mm chains list+mm chains list --toon+```++## Supported Namespaces++| Namespace | Notes |+| --- | --- |+| `eip155` | Major EVM chains, such as Ethereum, Polygon, Arbitrum, Optimism, and BSC |diff --git a/data/skills/metamask-agent-wallet/references/decode.md b/data/skills/metamask-agent-wallet/references/decode.mdnew file mode 100644index 000000000..5a36084df--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/decode.md@@ -0,0 +1,38 @@+# Decode Commands++Use `decode` to turn raw EVM calldata into a human-readable intent before signing or sending a transaction. Requires authentication and a completed `init`.++## `decode` Command++Decode hex-encoded EVM calldata into its function name, parameters, and a plain-language summary.++### Syntax++```bash+mm decode --payload <0x-calldata> [--toon]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--payload` | Yes | Hex-encoded EVM calldata to decode (e.g. `0x095ea7b3...`). |++### Output++| Field | Description |+| --- | --- |+| `functionName` | Decoded function name, when the selector is recognized |+| `params` | Array of decoded parameters, each with `name` and `value` |+| `intent` | Plain-language summary of the call (e.g. `Call approve(spender: 0x..., amount: ...)`) |++### Example++```bash+mm decode --payload 0x095ea7b3000000000000000000000000... --toon+```++## Notes++- Use this before `mm wallet send-transaction` whenever the calldata is unfamiliar or was not constructed by you, to confirm what the transaction actually does.+- If the selector is not recognized, `intent` falls back to `Call unknown function`. Treat unrecognized calldata as higher risk and warn the user before proceeding.diff --git a/data/skills/metamask-agent-wallet/references/errors.md b/data/skills/metamask-agent-wallet/references/errors.mdnew file mode 100644index 000000000..5e6b89052--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/errors.md@@ -0,0 +1,158 @@+# Error Codes++This reference lists error codes the CLI actually emits. SDK-only or remapped codes are noted where relevant. Workflows for diagnosing failures live in `../workflows/troubleshooting.md`.++## Auth Errors++| Code | Meaning |+| --- | --- |+| `ALREADY_AUTHENTICATED` | Valid session already exists; run `mm logout` before logging in again |+| `AUTH_FAILED` | Authentication failed (includes missing refresh token cases) |+| `AUTH_ERROR` | Generic authentication error (includes missing auth token cases) |+| `TOKEN_INVALID` | Invalid CLI token, token pair, or project ID |+| `TOKEN_REFRESH_FAILED` | Failed to refresh token |+| `PAIRING_TIMEOUT` | Login pairing timed out |+| `PAIRING_EXPIRED` | Pairing session expired |+| `INVALID_OTP` | Invalid one-time password |+| `MWP_TIMEOUT` | Mobile Wallet Protocol timeout |+| `MWP_CANCELLED` | Mobile Wallet Protocol cancelled (pairing aborted) |+| `LOGOUT_FAILED` | Logout operation failed (includes token revoke failures) |++## Validation Errors++| Code | Meaning |+| --- | --- |+| `MISSING_FLAG` | Required flag is missing in headless mode |+| `MISSING_INPUT` | Required input is missing |+| `MISSING_CHAIN` | Chain value is missing |+| `MISSING_CHAIN_ID` | Chain ID is missing |+| `INVALID_CHAIN` | Chain value is invalid |+| `MISSING_TO` | Recipient address is missing |+| `INVALID_TO` | Recipient address is invalid |+| `INVALID_DATA` | Transaction data is invalid |+| `INVALID_INPUT` | Invalid user input |+| `INVALID_QUANTITY` | EVM quantity is invalid |+| `INVALID_LIMIT` | Invalid limit value |+| `INVALID_INTERVAL` | Invalid time interval |+| `INVALID_TIMESTAMP` | Invalid timestamp |+| `INVALID_ASSET_ID` | Invalid asset identifier |+| `MISSING_ASSET_IDS` | Missing asset IDs |+| `MISSING_ASSET_TYPE` | Missing asset type |+| `MISSING_QUERY` | Missing search query |+| `MISSING_WALLET_REF` | Missing wallet reference |+| `MISSING_TRANSACTION_PAYLOAD` | Transaction payload is missing |+| `INVALID_TRANSACTION_PAYLOAD` | Transaction payload is invalid |+| `MISSING_TYPED_DATA` | EIP-712 typed data payload is missing |+| `INVALID_TYPED_DATA` | EIP-712 typed data payload is invalid |+| `CHAIN_ID_MISMATCH` | Typed-data domain chain ID differs from `--chain-id` |+| `INVALID_MNEMONIC` | BYOK mnemonic is invalid |++## Wallet Errors++| Code | Meaning |+| --- | --- |+| `MISSING_MNEMONIC` | BYOK wallet mode is missing a mnemonic |+| `MNEMONIC_LOCKED` | Mnemonic unlock failed after maximum attempts |+| `WRONG_PASSWORD` | Current password is incorrect |+| `ALREADY_ENCRYPTED` | Mnemonic is already password-encrypted (use `wallet password change` instead) |+| `NOT_ENCRYPTED` | Mnemonic is not encrypted (use `wallet password set` instead) |+| `PASSWORD_MISMATCH` | Password confirmation does not match |+| `EMPTY_PASSWORD` | Empty password provided |+| `WALLET_NOT_FOUND` | Wallet not found |+| `WALLET_ERROR` | Wallet provider or wallet operation error (includes on-chain reverts and network failures from wallet paths) |+| `WALLET_METADATA` | Wallet metadata error |+| `WRONG_NAMESPACE` | Wrong namespace for wallet |+| `UNSUPPORTED_NAMESPACE` | Unsupported wallet namespace |+| `NO_AUTH_TOKEN` | Missing authentication token for wallet operations |+| `NO_PROJECT_ID` | Project ID not configured for wallet |+| `MISSING_PROJECT_ID` | Project ID is not configured |+| `INVALID_TRADING_MODE` | Invalid trading mode; use `guard` or `beast` |+| `ALREADY_SET_TRADING_MODE` | Trading mode is already set to the requested value |++## Command Errors++| Code | Meaning |+| --- | --- |+| `ABORTED` | Operation aborted by user |+| `NOT_INITIALIZED` | Project not initialized — run `mm init` |+| `NO_MNEMONIC` | Mnemonic not stored |+| `NO_TTY` | No TTY available for interactive prompts |+| `MISSING_ID` | Missing ID parameter |+| `MISSING_QUOTE_ID` | Missing quote ID |+| `MISSING_SWAP_PARAMS` | Missing swap parameters |+| `COMING_SOON` | Feature not yet available (e.g. `mm login qr` on production) |+| `INVALID_CONFIG_KEY` | Unknown config key passed to `mm config get` or `mm config set` |+| `INVALID_CONFIG_VALUE` | Invalid value for a config key (e.g. env not in `prod|dev|uat`) |++## Swap & Bridge Errors++| Code | Meaning |+| --- | --- |+| `NO_QUOTES` | No swap or bridge quotes available |+| `BRIDGE_API_ERROR` | Bridge API error |+| `TOKEN_NOT_FOUND` | Token not found |+| `INVALID_SWAP_PARAMS` | Invalid swap parameters |+| `NATIVE_ASSET_UNSUPPORTED` | Native asset not supported for this swap route |+| `QUOTE_PERSIST_FAILED` | Failed to persist quote |+| `QUOTE_NOT_FOUND` | Quote not found |+| `EXECUTE_FAILED` | Swap execution failed |+| `NO_TRADE_DATA` | No trade data available |+| `STATUS_UNAVAILABLE` | Swap status unavailable |+| `SWAP_ERROR` | Generic swap error |++## Perps Errors++| Code | Meaning |+| --- | --- |+| `UNSUPPORTED_VENUE` | Unsupported perpetual venue |+| `UNSUPPORTED_NETWORK` | Unsupported network for perps |+| `UNSUPPORTED_ROUTE` | Unsupported deposit or withdraw route |+| `UNSUPPORTED_ASSET` | Unsupported asset |+| `UNSUPPORTED_SOURCE_CHAIN` | Unsupported source chain for perps deposit |+| `INVALID_SYMBOL` | Unknown perpetual market symbol |+| `INVALID_AMOUNT` | Invalid amount |+| `INVALID_SIZE` | Invalid position size |+| `INVALID_LEVERAGE` | Invalid leverage value |+| `INVALID_PRICE` | Invalid price |+| `INVALID_SLIPPAGE` | Invalid slippage value |+| `INVALID_ADDRESS` | Invalid address |+| `INSUFFICIENT_BALANCE` | Insufficient balance |+| `POSITION_NOT_FOUND` | Position not found |+| `QUOTE_FAILED` | Quote generation failed |+| `ORDER_REJECTED` | Order rejected |+| `CANCEL_FAILED` | Order cancellation failed |+| `SIGNING_FAILED` | Signing operation failed |+| `WITHDRAW_FAILED` | Withdrawal failed |+| `DEPOSIT_FAILED` | Deposit failed |+| `HYPERLIQUID_ERROR` | Hyperliquid protocol error |+| `PERPS_ERROR` | Generic perpetuals error |++## Predict Errors++| Code | Meaning |+| --- | --- |+| `PREDICT_SETUP_REQUIRED` | Predict setup required before operation |+| `PREDICT_AUTH_REQUIRED` | Predict authentication required |+| `PREDICT_AUTH_INVALID` | Predict credentials invalid or incomplete |+| `PREDICT_RELAYER_CONFIG_REQUIRED` | Relayer configuration required |+| `PREDICT_INVALID_DEPOSIT_AMOUNT` | Invalid deposit amount |+| `PREDICT_WITHDRAW_ZERO` | Withdraw amount must be greater than zero |+| `PREDICT_WITHDRAW_INSUFFICIENT_BALANCE` | Withdraw amount exceeds deposit wallet pUSD balance |+| `PREDICT_FUNDING_CHAIN_UNSUPPORTED` | Funding chain not supported |+| `PREDICT_INSUFFICIENT_BALANCE` | Insufficient Predict balance |+| `PREDICT_INSUFFICIENT_ALLOWANCE` | Insufficient Predict allowance |+| `PREDICT_INSUFFICIENT_FUNDING_BALANCE` | Insufficient funding balance for Predict deposit |+| `PREDICT_CANCEL_TARGET_REQUIRED` | Cancel target not specified |+| `PREDICT_WALLET_STATE_REQUIRED` | Wallet state required for Predict |+| `PREDICT_METHOD_UNAVAILABLE` | Predict method not available |+| `PREDICT_DEPOSIT_FAILED` | Predict deposit failed |+| `PREDICT_ERROR` | Generic Predict error |+| `PREDICT_GEOBLOCKED` | Polymarket is not available in your region; Predict features cannot be used from this location. Emitted by `mm predict setup` (region guard) and surfaced by `mm predict geoblock` |+| `UNSUPPORTED_PREDICT_CHAIN` | Predict chain not supported |++## Network & Filesystem Errors++| Code | Meaning |+| --- | --- |+| `NETWORK_UNREACHABLE` | Network unreachable |+| `RESET_FAILED` | Failed to reset CLI session |diff --git a/data/skills/metamask-agent-wallet/references/market-data.md b/data/skills/metamask-agent-wallet/references/market-data.mdnew file mode 100644index 000000000..ef83b4e0d--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/market-data.md@@ -0,0 +1,188 @@+# Market Data Commands++Use `price` and `token` commands for read-only token metadata, token discovery, and price data.++## `price spot` Command++Fetch spot prices for one or more CAIP-19 assets.++### Syntax++```bash+mm price spot --asset-ids <asset-ids> [--vs <currency>] [--market-data]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--asset-ids` | Yes | Comma-separated CAIP-19 asset IDs |+| `--vs` | No | Quote currency; defaults to `usd` |+| `--market-data` | No | Include market cap, supply, and change percent |++### Example++```bash+mm price spot --asset-ids "eip155:1/slip44:60,eip155:137/slip44:966"+mm price spot --asset-ids "eip155:1/slip44:60" --vs eur+mm price spot --asset-ids "eip155:1/slip44:60" --market-data+```++## `price history` Command++Fetch historical prices for an asset.++### Syntax++```bash+mm price history --chain-id <caip2-chain-id> --asset-type <asset-type> [--time-period <period>] [--interval <interval>] [--from <unix>] [--to <unix>] [--vs <currency>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--chain-id` | Yes | CAIP-2 chain ID (e.g. `eip155:1`). Run `mm price networks` to see supported chains |+| `--asset-type` | Yes | CAIP-19 asset type (e.g. `slip44:60` for ETH, `erc20:0x...` for ERC-20 tokens) |+| `--time-period` | No | Time period (e.g. `1d`, `7d`, `30d`, `2M`, `1y`, `3y`) |+| `--interval` | No | Sampling interval: `5m`, `hourly`, or `daily` |+| `--from` | No | Start time as a Unix timestamp in seconds. Use with `--to` instead of `--time-period` for custom ranges |+| `--to` | No | End time as a Unix timestamp in seconds. Use with `--from` instead of `--time-period` for custom ranges |+| `--vs` | No | Quote currency code (defaults to `usd`). Run `mm price currencies` to see options |++### Example++```bash+mm price history --chain-id eip155:1 --asset-type slip44:60 --time-period 7d --interval daily+```++## `price currencies` Command++List supported quote currencies.++### Syntax++```bash+mm price currencies+```++### Example++```bash+mm price currencies+```++## `price networks` Command++List CAIP-2 networks supported by the price API.++### Syntax++```bash+mm price networks+```++### Example++```bash+mm price networks+```++## `token list` Commands++List popular, trending, or top-gainer tokens.++### Syntax++```bash+mm token list popular [--chain <chain>]+mm token list trending [--chain <chain>]+mm token list top-gainer [--chain <chain>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--chain` | No | Chain id, CAIP-2 id, or configured chain key. Defaults to the active wallet chain, or `eip155:1` if none is selected |++### Example++```bash+mm token list popular --chain 1+mm token list trending --chain 1+mm token list top-gainer --chain 1+```++## `token list search` Command++Search tokens by query.++### Syntax++```bash+mm token list search --query <query> [--chain <chains>] [--limit <n>] [--after <cursor>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--query` | Yes | Search query by symbol or name (e.g. USDC, Wrapped Ether) |+| `--chain` | No | Comma-separated chain IDs, CAIP-2 IDs, or configured chain keys. Defaults to the active wallet chain, or `eip155:1` if none is selected |+| `--limit` | No | Maximum results (defaults to 10; 1-500) |+| `--after` | No | Pagination cursor |++### Example++```bash+mm token list search --query USDC --chain 1,137 --limit 25+mm token list search --query WETH --chain eip155:8453+```++## `token networks` Command++List networks supported by token APIs.++### Syntax++```bash+mm token networks+```++### Example++```bash+mm token networks+```++## `token assets` Command++Fetch asset metadata for one or more CAIP-19 assets.++### Syntax++```bash+mm token assets --asset-ids <asset-ids> [--include-market-data] [--include-token-security-data] [--include-labels] [--include-aggregators] [--include-coingecko-id] [--include-occurrences] [--include-rwa-data]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--asset-ids` | Yes | Comma-separated CAIP-19 asset IDs (e.g. `eip155:1/erc20:0xa0b8...`). Run `mm token networks` to see supported chains |+| `--include-market-data` | No | Include market cap, volume, and price data |+| `--include-token-security-data` | No | Include token security signals (scam risk, honeypot detection) |+| `--include-labels` | No | Include token labels and categories |+| `--include-aggregators` | No | Include aggregator sources that list this token |+| `--include-coingecko-id` | No | Include the CoinGecko identifier for cross-referencing |+| `--include-occurrences` | No | Include occurrence count across chains |+| `--include-rwa-data` | No | Include real-world asset (RWA) data |++### Example++```bash+mm token assets --asset-ids "eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,eip155:137/slip44:966"+mm token assets --asset-ids "eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" --include-market-data --include-token-security-data --include-labels+mm token assets --asset-ids "eip155:1/slip44:60" --include-aggregators --include-coingecko-id --include-rwa-data+```diff --git a/data/skills/metamask-agent-wallet/references/perps.md b/data/skills/metamask-agent-wallet/references/perps.mdnew file mode 100644index 000000000..5861111ab--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/perps.md@@ -0,0 +1,399 @@+# Perpetual Trading Commands++Use `perps` commands to trade perpetual futures on supported venues. Currently supported venue: `hyperliquid`.++## Common Flags++Most `perps` commands accept these flags (`list-venues` does not):++| Name | Required | Description |+| --- | --- | --- |+| `--venue` | No | Perpetual venue (defaults to `hyperliquid`) |+| `--network` | No | Target network: `mainnet` or `testnet` (defaults to `mainnet`) |++The `--yes` flag skips interactive confirmation on `open`, `close`, `modify`, and `cancel` only. On `deposit`, `transfer`, and `withdraw`, `--yes` is accepted but has no effect because those commands do not prompt. Perps commands do not use `--wait`. In BYOK mode with an encrypted mnemonic, state-changing commands also accept `--password` to unlock the mnemonic [env: `MM_PASSWORD`].++## `perps markets` Command++List perpetual markets for a venue.++### Syntax++```bash+mm perps markets [--venue <venue>] [--network <network>] [--symbol <symbol>] [--symbols <list>] [--dex <name>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--venue` | No | Perpetual venue (defaults to `hyperliquid`). Run `mm perps list-venues` to see options (allowed: `hyperliquid`) |+| `--network` | No | Target network: `mainnet` or `testnet` (defaults to `mainnet`) (allowed: `mainnet`, `testnet`) |+| `--symbol` | No | Filter to a single market symbol (e.g. BTC) |+| `--symbols` | No | Comma-separated market symbols to filter (e.g. BTC,ETH,SOL) |+| `--dex` | No | HIP-3 DEX name; omit for the main Hyperliquid DEX. Run `mm perps dexs` to see options |++### Example++```bash+mm perps markets --venue hyperliquid+mm perps markets --venue hyperliquid --symbol BTC+mm perps markets --venue hyperliquid --symbols BTC,ETH,SOL --network testnet+mm perps markets --venue hyperliquid --dex myDex+```++## `perps balance` Command++Show the connected wallet's perpetual account balances for a venue.++### Syntax++```bash+mm perps balance [--venue <venue>] [--network <network>]+```++### Example++```bash+mm perps balance --venue hyperliquid+mm perps balance --venue hyperliquid --network testnet+```++## `perps positions` Command++List open positions for the connected wallet on a venue.++### Syntax++```bash+mm perps positions [--venue <venue>] [--network <network>]+```++### Example++```bash+mm perps positions --venue hyperliquid+mm perps positions --venue hyperliquid --network testnet+```++## `perps quote` Command++Estimate entry price, notional, fees, and liquidation price without placing an order.++### Syntax++```bash+mm perps quote [--venue <venue>] --symbol <symbol> --side <side> --size <size> --leverage <leverage> [--type <type>] [--limit-px <price>] [--network <network>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--venue` | No | Perpetual venue (defaults to `hyperliquid`) |+| `--symbol` | Yes | Market symbol (e.g. BTC, ETH, SOL) |+| `--side` | Yes | Position direction (allowed: `long`, `short`) |+| `--size` | Yes | Size in base asset, human-readable (e.g. 0.01, 1) |+| `--leverage` | Yes | Leverage multiplier as a positive integer (e.g. 5, 10) |+| `--type` | No | Order type (allowed: `market`, `limit`). Default is `market` |+| `--limit-px` | If `--type limit` | Limit price, human-readable (e.g. 60000 for BTC) |+| `--network` | No | Target network: `mainnet` or `testnet` (defaults to `mainnet`) |++### Example++```bash+mm perps quote --venue hyperliquid --symbol BTC --side long --size 0.01 --leverage 5+mm perps quote --venue hyperliquid --symbol ETH --side short --size 1 --leverage 10 --type limit --limit-px 2500+```++## `perps open` Command++Open a new perpetual position by placing an order.++### Syntax++```bash+mm perps open [--venue <venue>] --symbol <symbol> --side <side> --size <size> --leverage <leverage> [--type <type>] [--limit-px <price>] [--max-slippage-bps <bps>] [--network <network>] [--dry-run] [--yes] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--venue` | No | Perpetual venue (defaults to `hyperliquid`) |+| `--symbol` | Yes | Market symbol (e.g. BTC, ETH, SOL) |+| `--side` | Yes | Position direction (allowed: `long`, `short`) |+| `--size` | Yes | Size in base asset, human-readable (e.g. 0.01, 1) |+| `--leverage` | Yes | Leverage multiplier as a positive integer (e.g. 5, 10) |+| `--type` | No | Order type (allowed: `market`, `limit`; defaults to `market`) |+| `--limit-px` | If `--type limit` | Limit price; required when `--type` is `limit` (e.g. 60000 for BTC) |+| `--max-slippage-bps` | No | Slippage cap in basis points for IOC market pricing (e.g. 50) |+| `--network` | No | Target network: `mainnet` or `testnet` (defaults to `mainnet`) |+| `--dry-run` | No | Validate and preview the order without signing or submitting |+| `--yes` | No | Skip interactive confirmation |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm perps open --venue hyperliquid --symbol BTC --side long --size 0.01 --leverage 5+mm perps open --venue hyperliquid --symbol ETH --side short --size 1 --leverage 10 --type limit --limit-px 2500+mm perps open --venue hyperliquid --symbol BTC --side long --size 0.05 --leverage 3 --dry-run+```++## `perps orders` Command++List resting orders for the connected wallet on a venue.++### Syntax++```bash+mm perps orders [--venue <venue>] [--network <network>]+```++### Example++```bash+mm perps orders --venue hyperliquid+mm perps orders --venue hyperliquid --network testnet+```++## `perps close` Command++Close one position, part of a position, or all open positions.++### Syntax++```bash+mm perps close [--venue <venue>] [--symbol <symbol>] [--size <size>] [--all] [--max-slippage-bps <bps>] [--network <network>] [--dry-run] [--yes] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--venue` | No | Perpetual venue (defaults to `hyperliquid`) |+| `--symbol` | Yes, unless `--all` | Market symbol to close (e.g. BTC, ETH) |+| `--size` | No | Partial close size in base asset (e.g. 0.5); omit for full close. Not allowed with `--all` |+| `--all` | No | Close all open positions; mutually exclusive with `--symbol` |+| `--max-slippage-bps` | No | Slippage cap in basis points for IOC pricing (e.g. 50) |+| `--network` | No | Target network: `mainnet` or `testnet` (defaults to `mainnet`) |+| `--dry-run` | No | Preview the close action without signing or submitting |+| `--yes` | No | Skip interactive confirmation |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Validation Rules++- `--size` is not allowed with `--all`.++### Example++```bash+mm perps close --venue hyperliquid --symbol BTC+mm perps close --venue hyperliquid --symbol ETH --size 0.5+mm perps close --venue hyperliquid --all+mm perps close --venue hyperliquid --symbol BTC --dry-run+```++## `perps modify` Command++Modify leverage, take-profit, or stop-loss for an existing position.++### Syntax++```bash+mm perps modify [--venue <venue>] --symbol <symbol> [--leverage <leverage>] [--tp <price>] [--sl <price>] [--network <network>] [--dry-run] [--yes] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--venue` | No | Perpetual venue (defaults to `hyperliquid`) |+| `--symbol` | Yes | Market symbol (e.g. BTC, ETH, SOL) |+| `--leverage` | No | New leverage multiplier as a positive integer (e.g. 5, 10) |+| `--tp` | No | Take-profit trigger price, human-readable (e.g. 3000, 2500.50) |+| `--sl` | No | Stop-loss trigger price, human-readable (e.g. 2000, 1800.75) |+| `--network` | No | Target network: `mainnet` or `testnet` (defaults to `mainnet`) |+| `--dry-run` | No | Preview the modify action without signing or submitting |+| `--yes` | No | Skip interactive confirmation |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Validation Rules++- At least one of `--leverage`, `--tp`, or `--sl` must be provided.++### Example++```bash+mm perps modify --venue hyperliquid --symbol BTC --leverage 10+mm perps modify --venue hyperliquid --symbol ETH --tp 3000 --sl 2000+mm perps modify --venue hyperliquid --symbol BTC --leverage 3 --dry-run+```++## `perps cancel` Command++Cancel a resting perps order.++### Syntax++```bash+mm perps cancel [--venue <venue>] --order-id <id> [--symbol <symbol>] [--network <network>] [--dry-run] [--yes] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--venue` | No | Perpetual venue (defaults to `hyperliquid`). Run `mm perps list-venues` to see options (allowed: `hyperliquid`) |+| `--order-id` | Yes | Venue order ID to cancel (positive integer) |+| `--symbol` | No | Market symbol; speeds up cancel by avoiding an open-order lookup (e.g. BTC, ETH) |+| `--network` | No | Target network: `mainnet` or `testnet` (defaults to `mainnet`) (allowed: `mainnet`, `testnet`) |+| `--dry-run` | No | Preview the cancel action without signing or submitting |+| `--yes` | No | Skip interactive confirmation |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm perps cancel --venue hyperliquid --order-id 12345+mm perps cancel --venue hyperliquid --order-id 12345 --symbol BTC+mm perps cancel --venue hyperliquid --order-id 12345 --dry-run+mm perps cancel --venue hyperliquid --order-id 12345 --yes+```++## `perps deposit` Command++Deposit USDC into a perpetual venue.++### Syntax++```bash+mm perps deposit [--venue <venue>] --amount <amount> [--asset <asset>] [--source-chain <chain>] [--network <network>] [--dry-run] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--venue` | No | Perpetual venue (defaults to `hyperliquid`). Run `mm perps list-venues` to see options (allowed: `hyperliquid`) |+| `--amount` | Yes | Human-readable USDC amount to deposit (e.g. 100, 50.5) |+| `--asset` | No | Deposit asset (defaults to `USDC`) (allowed: `USDC`) |+| `--source-chain` | No | Source chain as a CAIP-2 ID or decimal chain ID (defaults to Arbitrum for the selected network: `eip155:42161` on mainnet, `eip155:421614` on testnet) |+| `--network` | No | Target network: `mainnet` or `testnet` (defaults to `mainnet`) (allowed: `mainnet`, `testnet`) |+| `--dry-run` | No | Preview the transaction without signing or submitting |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm perps deposit --venue hyperliquid --amount 100 --asset USDC+mm perps deposit --venue hyperliquid --amount 100 --asset USDC --dry-run+```++## `perps withdraw` Command++Withdraw USDC from a perpetual venue.++### Syntax++```bash+mm perps withdraw [--venue <venue>] --amount <amount> [--asset <asset>] [--destination <address>] [--network <network>] [--dry-run] [--include-spot] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--venue` | No | Perpetual venue (defaults to `hyperliquid`). Run `mm perps list-venues` to see options (allowed: `hyperliquid`) |+| `--amount` | Yes | Human-readable USDC amount to withdraw (e.g. 50, 25.5) |+| `--asset` | No | Withdrawal asset (defaults to `USDC`) (allowed: `USDC`) |+| `--destination` | No | EVM destination address (defaults to your connected wallet) |+| `--network` | No | Target network: `mainnet` or `testnet` (defaults to `mainnet`) (allowed: `mainnet`, `testnet`) |+| `--dry-run` | No | Preview the withdrawal without signing or submitting |+| `--include-spot` | No | Move free spot USDC to perp before withdrawing if needed |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm perps withdraw --venue hyperliquid --amount 50 --asset USDC+mm perps withdraw --venue hyperliquid --amount 50 --asset USDC --include-spot+mm perps withdraw --venue hyperliquid --amount 50 --asset USDC --destination 0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18+```++## `perps transfer` Command++Transfer USDC between spot and perp accounts on a perpetual venue.++### Syntax++```bash+mm perps transfer [--venue <venue>] --amount <amount> --direction <direction> [--asset <asset>] [--network <network>] [--dry-run] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--venue` | No | Perpetual venue (defaults to `hyperliquid`) |+| `--amount` | Yes | Human-readable USDC amount to transfer (e.g. 100, 50.5) |+| `--direction` | Yes | Transfer direction (allowed: `spot-to-perp`, `perp-to-spot`) |+| `--asset` | No | Transfer asset (defaults to `USDC`) (allowed: `USDC`) |+| `--network` | No | Target network: `mainnet` or `testnet` (defaults to `mainnet`) |+| `--dry-run` | No | Preview the transfer without signing or submitting |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm perps transfer --venue hyperliquid --amount 100 --direction spot-to-perp --asset USDC+mm perps transfer --venue hyperliquid --amount 50 --direction perp-to-spot --asset USDC+```++## `perps list-venues` Command++List available perpetual futures venues.++### Syntax++```bash+mm perps list-venues+```++### Supported Flags++This command does not support additional flags beyond output format options.++### Example++```bash+mm perps list-venues+```++## `perps dexs` Command++List available DEX identifiers a venue exposes. For Hyperliquid, this includes the main DEX and any HIP-3 builder-deployed DEXs.++### Syntax++```bash+mm perps dexs [--venue <venue>] [--network <network>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--venue` | No | Perpetual venue (defaults to `hyperliquid`) |+| `--network` | No | Target network: `mainnet` or `testnet` (defaults to `mainnet`) |++### Example++```bash+mm perps dexs --venue hyperliquid+```++## Notes++- If the user does not mention a token symbol, use `mm perps markets` to list available markets and confirm the symbol with the user before proceeding.diff --git a/data/skills/metamask-agent-wallet/references/polling.md b/data/skills/metamask-agent-wallet/references/polling.mdnew file mode 100644index 000000000..3b0fec4c7--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/polling.md@@ -0,0 +1,52 @@+# Polling Commands++In server wallet mode, signing and transaction commands return a `pollingId` instead of an immediate result. Use these commands to track and wait for results. Both commands are server-wallet mode only.++Transfers, swaps, perps, predict orders, and predict withdraws attach a human-readable `intent` summary to their request (e.g. `Transfer 0.5 ETH to 0x...`, `Withdraw 10 pUSD to 0x...`). When listing or watching requests, surface the `intent` so the user can confirm what they are approving.++## `wallet requests list` Command++List all pending wallet requests.++### Syntax++```bash+mm wallet requests list [--sync] [--toon]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--sync` | No | Refresh pending requests before listing (defaults to true; use `--no-sync` to skip) |++### Example++```bash+mm wallet requests list+mm wallet requests list --no-sync --toon+```++## `wallet requests watch` Command++Wait for a specific wallet request to complete by its polling ID. MFA prompts are surfaced once when a job enters the `AWAITING_MFA` state.++### Syntax++```bash+mm wallet requests watch <polling-id> [--polling-id <id>] [--toon]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<polling-id>` | Yes | Request polling ID returned by a previous command (positional) |+| `--polling-id` | No | Same as positional `<polling-id>` |++### Example++```bash+mm wallet requests watch abc-123+mm wallet requests watch --polling-id abc-123 --toon+```diff --git a/data/skills/metamask-agent-wallet/references/predict.md b/data/skills/metamask-agent-wallet/references/predict.mdnew file mode 100644index 000000000..9f57f50c1--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/predict.md@@ -0,0 +1,730 @@+# Predict Commands++Use the `predict` commands to trade on prediction markets (Polymarket via the CLOB).++## `predict mode` Command++Choose or display the current Predict trading mode.++### Syntax++```bash+mm predict mode [mainnet|testnet]+```++### Example++```bash+mm predict mode mainnet+mm predict mode testnet+mm predict mode+```++## `predict setup` Command++One-time Predict setup: creates trading credentials, deploys the deposit wallet, and sets approvals.++### Syntax++```bash+mm predict setup [--wait] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--wait` | No | Block until the job completes |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict setup --wait+```++## `predict auth` Command++Create or refresh Predict trading credentials (API key + CLOB signing).++### Syntax++```bash+mm predict auth [--refresh] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--refresh` | No | Force-create or refresh trading credentials |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict auth+mm predict auth --refresh+```++## `predict approve` Command++Repair missing deposit-wallet approvals.++### Syntax++```bash+mm predict approve [--wait] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--wait` | No | Block until the job completes |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict approve --wait+```++## `predict status` Command++Probe Predict back-end reachability (Gamma + CLOB) and report account setup status: deposit wallet address, on-chain deployment, stored CLOB credentials, and a `setupComplete` flag.++### Syntax++```bash+mm predict status+```++### Example++```bash+mm predict status+```++## `predict geoblock` Command++Check whether Polymarket access is geoblocked for your current IP. Returns `blocked`, `ip`, `country`, and `region`.++### Syntax++```bash+mm predict geoblock+```++### Example++```bash+mm predict geoblock+```++## `predict markets list` Command++List tradeable Predict markets with Gamma-style filters.++### Syntax++```bash+mm predict markets list [--slug <slug>] [--limit <n>] [--offset <n>] [--order <fields>] [--ascending] [--tag <tag>] [--liquidity-num-min <n>] [--liquidity-num-max <n>] [--volume-num-min <n>] [--volume-num-max <n>] [--start-date-min <datetime>] [--start-date-max <datetime>] [--end-date-min <datetime>] [--end-date-max <datetime>] [--active] [--closed]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--slug` | No | Market slug to filter by |+| `--limit` | No | Maximum markets to return, 1-500 |+| `--offset` | No | Market result offset (0-based) |+| `--order` | No | Comma-separated market fields to order by |+| `--ascending` | No | Sort markets in ascending order |+| `--tag` | No | Market tag or category (e.g. sports, politics) |+| `--liquidity-num-min` | No | Minimum market liquidity |+| `--liquidity-num-max` | No | Maximum market liquidity |+| `--volume-num-min` | No | Minimum market volume |+| `--volume-num-max` | No | Maximum market volume |+| `--start-date-min` | No | Minimum market start date-time |+| `--start-date-max` | No | Maximum market start date-time |+| `--end-date-min` | No | Minimum market end date-time |+| `--end-date-max` | No | Maximum market end date-time |+| `--active` | No | Only include active markets |+| `--closed` | No | Include closed markets |++### Example++```bash+mm predict markets list --slug will-this-work --limit 5+mm predict markets list --tag sports --liquidity-num-min 10000 --limit 10+mm predict markets list --active --limit 50+```++## `predict markets search` Command++Search Predict markets with Polymarket public search.++### Syntax++```bash+mm predict markets search <query> [--limit <n>] [--page <n>] [--sort <field>] [--ascending] [--search-tags] [--events-status] [--recurrence <recurrence>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<query>` | Yes | Search string (positional) |+| `--limit` | No | Results per type (defaults to 10) |+| `--page` | No | Search result page |+| `--sort` | No | Search sort field |+| `--ascending` | No | Sort search results in ascending order |+| `--search-tags` | No | Include tag matches in search results (defaults to true; use `--no-search-tags` to disable) |+| `--events-status` | No | Restrict to active events (defaults to true; use `--no-events-status` for all) |+| `--recurrence` | No | Filter by series recurrence: `daily`, `weekly`, or `monthly` |++### Example++```bash+mm predict markets search "Knicks NBA Finals" --limit 5+mm predict markets search "election" --limit 5+```++## `predict markets get` Command++Inspect a specific market and show outcome token IDs needed for quoting and placing orders.++### Syntax++```bash+mm predict markets get <market> [--market <market>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<market>` | Yes | Market slug, ID, or condition ID (positional). Run `mm predict markets search` or `mm predict markets list` to find markets |+| `--market` | No | Same as positional `<market>` |++### Example++```bash+mm predict markets get will-the-new-york-knicks-win-the-2026-nba-finals+mm predict markets get 0x713641f745d71f6ec61f906237ffca3c8583f251e49384429a63ceb0ccdb2d37+```++## `predict events list` Command++List Polymarket events (groupings of related markets) with Gamma-style filters.++### Syntax++```bash+mm predict events list [--tag-slug <slug>] [--tag-id <n>] [--active] [--closed] [--featured] [--order <field>] [--ascending] [--liquidity-min <n>] [--start-date-min <datetime>] [--start-date-max <datetime>] [--end-date-min <datetime>] [--end-date-max <datetime>] [--limit <n>] [--offset <n>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--tag-slug` | No | Filter by tag slug (e.g. sports, politics) |+| `--tag-id` | No | Filter by tag ID (from `mm predict tags list`) |+| `--active` | No | Active events only |+| `--closed` | No | Include closed/resolved events |+| `--featured` | No | Only featured/trending events |+| `--order` | No | Sort field: `volume_24hr`, `volume`, `liquidity`, `start_date`, `end_date` |+| `--ascending` | No | Sort ascending (defaults to descending) |+| `--liquidity-min` | No | Minimum event liquidity |+| `--start-date-min` | No | Minimum event start date-time |+| `--start-date-max` | No | Maximum event start date-time |+| `--end-date-min` | No | Minimum event end date-time |+| `--end-date-max` | No | Maximum event end date-time |+| `--limit` | No | Maximum events to return, 1-500 |+| `--offset` | No | Result offset (0-based) |++### Example++```bash+mm predict events list --tag-slug sports --limit 10+mm predict events list --active --featured+```++## `predict events get` Command++Inspect a single Polymarket event by slug or ID.++### Syntax++```bash+mm predict events get <event>+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<event>` | Yes | Event slug or ID (positional) |++### Example++```bash+mm predict events get some-event-slug+```++## `predict series list` Command++List Polymarket event series (recurring groupings of events).++### Syntax++```bash+mm predict series list [--recurrence <recurrence>] [--active] [--featured] [--tag-slug <slug>] [--limit <n>] [--offset <n>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--recurrence` | No | Filter by recurrence: `annual`, `daily`, `weekly`, or `monthly` |+| `--active` | No | Active series only |+| `--featured` | No | Only featured series |+| `--tag-slug` | No | Filter by tag slug |+| `--limit` | No | Maximum series to return, 1-500 |+| `--offset` | No | Result offset (0-based) |++### Example++```bash+mm predict series list --recurrence weekly --limit 10+```++## `predict series get` Command++Inspect a single event series by ID.++### Syntax++```bash+mm predict series get <id>+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<id>` | Yes | Series ID (positional) |++### Example++```bash+mm predict series get 12345+```++## `predict tags list` Command++List Polymarket tags, useful for `--tag-slug` / `--tag-id` filters on events and markets.++### Syntax++```bash+mm predict tags list [--limit <n>] [--offset <n>] [--is-carousel]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--limit` | No | Maximum tags to return, 1-500 |+| `--offset` | No | Result offset (0-based) |+| `--is-carousel` | No | Only carousel tags |++### Example++```bash+mm predict tags list --limit 50+```++## `predict tags get` Command++Fetch a single Polymarket tag by numeric ID or slug.++### Syntax++```bash+mm predict tags get <tag>+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<tag>` | Yes | Tag ID (integer) or slug string (positional) |++### Example++```bash+mm predict tags get sports+mm predict tags get 100+```++## `predict quote` Command++Preview order cost and fill before placing.++### Syntax++```bash+mm predict quote <token-id> [--token-id <token-id>] --side <side> --size <size> [--limit-price <price>] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<token-id>` | Yes | Outcome token ID (positional). Run `mm predict markets get <slug>` to get token IDs |+| `--token-id` | No | Same as positional `<token-id>` |+| `--side` | Yes | Order side: `buy` or `sell` |+| `--size` | Yes | Order size in shares, human-readable (e.g. 1, 100) |+| `--limit-price` | No | Execution price per share, between 0 and 1 |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict quote --token-id <token-id> --side buy --size 1+mm predict quote --token-id <token-id> --side sell --size 5 --limit-price 0.60+```++## `predict place` Command++Place a Predict order (GTC/GTD limit, FOK/FAK market).++### Syntax++```bash+mm predict place <token-id> [--token-id <token-id>] --side <side> --size <size> --price <price> [--order-type <type>] [--post-only] [--expiration <unix>] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<token-id>` | Yes | Outcome token ID (positional). Run `mm predict markets get <slug>` to get token IDs |+| `--token-id` | No | Same as positional `<token-id>` |+| `--side` | Yes | Order side: `buy` or `sell` |+| `--size` | Yes | Order size in shares, human-readable (e.g. 1, 100) |+| `--price` | Yes | Worst price per share (0-1); limit price for GTC/GTD, worst fill for FOK/FAK |+| `--order-type` | No | Order type: `GTC`, `GTD`, `FOK`, or `FAK` (defaults to `GTC`) |+| `--post-only` | No | Reject if the order would cross the book. Not supported with FOK/FAK orders |+| `--expiration` | If `GTD` | Expiration as a Unix timestamp in seconds (only valid for GTD orders) |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Validation Rules++- `--post-only` cannot be used with FOK or FAK orders.+- `--expiration` is only valid for GTD orders.++### Example++```bash+mm predict place --token-id <token-id> --side buy --size 1 --price 0.80+mm predict place --token-id <token-id> --side buy --size 5 --price 1 --order-type FOK+mm predict place --token-id <token-id> --side sell --size 2 --price 0.7 --order-type GTD --expiration 1735689600+```++## `predict cancel` Command++Cancel Predict orders by ID, market, asset, or all open orders.++### Syntax++```bash+mm predict cancel [<order-id>] [--order-id <id>] [--all] [--market <condition-id>] [--asset <token-id>] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<order-id>` | Yes (unless `--all`/`--market`/`--asset`) | Order ID to cancel (positional) |+| `--order-id` | No | Same as positional `<order-id>` |+| `--all` | No | Cancel all open orders |+| `--market` | No | Cancel orders for a given market condition ID |+| `--asset` | No | Cancel orders for a specific outcome token ID |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Validation Rules++- Use only one of `--order-id`, `--all`, or `--market`/`--asset` (market and asset can be combined as one target).++### Example++```bash+mm predict cancel <order-id>+mm predict cancel --order-id <order-id>+mm predict cancel --all+mm predict cancel --market <condition-id>+mm predict cancel --asset <token-id>+```++## `predict positions` Command++View your Predict positions.++### Syntax++```bash+mm predict positions [--market <id>] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--market` | No | Market slug, ID, or condition ID. Run `mm predict markets search` or `mm predict markets list` to find markets |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict positions+mm predict positions --market <condition-id>+```++## `predict portfolio` Command++Full portfolio snapshot: deposit wallet pUSD balance, open positions with estimated value, and outstanding redeemable winnings.++### Syntax++```bash+mm predict portfolio [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict portfolio+```++## `predict redeem list` Command++List all redeemable (winning) positions in your deposit wallet, with position size and market question.++### Syntax++```bash+mm predict redeem list [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict redeem list+```++## `predict redeem` Command++Redeem winning tokens after market resolution. Redeem one position by condition ID, or all redeemable positions with `--all`. With `--wait`, polls for the transaction receipt.++### Syntax++```bash+mm predict redeem [<condition-id>] [--all] [--wait] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<condition-id>` | Yes (unless `--all`) | Market condition ID to redeem (positional) |+| `--all` | No | Redeem all redeemable positions |+| `--wait` | No | Block until the redemption transaction is confirmed |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Validation Rules++- Provide either a `<condition-id>` or `--all`, not both.++### Example++```bash+mm predict redeem 0xABC123... --wait+mm predict redeem --all --wait+```++## `predict orders` Command++View open Predict orders.++### Syntax++```bash+mm predict orders [--market <condition-id>] [--cursor <cursor>] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--market` | No | Market slug, ID, or condition ID. Run `mm predict markets search` or `mm predict markets list` to find markets |+| `--cursor` | No | Pagination cursor from a previous response |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict orders+mm predict orders --market <condition-id>+```++## `predict balance` Command++Check deposit wallet funds, approvals, and setup status.++### Syntax++```bash+mm predict balance [--token-id <token-id>] [--sync] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--token-id` | No | Outcome token ID. Run `mm predict markets get <slug>` to get token IDs |+| `--sync` | No | Refresh balances and allowances before reading |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict balance --sync+mm predict balance --token-id <token-id> --sync+```++## `predict withdraw` Command++Withdraw pUSD from your Predict deposit wallet to your owner EOA or another address. Validates the amount against the on-chain deposit wallet balance before signing. Uses the Polymarket Relayer batch mechanism.++### Syntax++```bash+mm predict withdraw --amount <amount> [--to <address>] [--wait] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--amount` | Yes | pUSD amount to withdraw, human-readable (e.g. 0.1, 5, 100) |+| `--to` | No | Recipient address. Defaults to your owner EOA |+| `--wait` | No | Block until the job completes |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict withdraw --amount 10 --wait+mm predict withdraw --amount 5 --to 0xAbc... --wait+```++## `predict deposit` Command++Convert USDC.e from your EOA to pUSD in your Predict deposit wallet.++### Syntax++```bash+mm predict deposit --amount <amount> [--wait] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--amount` | Yes | pUSD amount to deposit, human-readable (e.g. 5, 100) |+| `--wait` | No | Block until the job completes |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict deposit --amount 5 --wait+```++## `predict book` Command++Fetch the raw order book for an outcome token.++### Syntax++```bash+mm predict book <token-id> [--token-id <token-id>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<token-id>` | Yes | Outcome token ID (positional). Run `mm predict markets get <slug>` to get token IDs |+| `--token-id` | No | Same as positional `<token-id>` |++### Example++```bash+mm predict book --token-id <token-id>+```++## `predict watch` Command++Watch a setup, approval, deposit, withdraw, or order job until it completes.++### Syntax++```bash+mm predict watch <id> [--id <id>] [--wait] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<id>` | Yes | Job or transaction ID to watch (positional) |+| `--id` | No | Same as positional `<id>` |+| `--wait` | No | Block until the job completes |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm predict watch <job-id> --wait+mm predict watch --id <job-id> --wait+```++## Notes++- Before trading, run `mm predict setup --wait` to initialize credentials, deploy the deposit wallet, and set approvals.+- `mm predict setup` aborts early with `PREDICT_GEOBLOCKED` if your IP resolves to a restricted region, before any wallet interaction. Use `mm predict geoblock` to check region status without running setup.+- Use `mm predict markets get <slug>` to get outcome token IDs required by `quote`, `place`, `book`, and `balance --token-id`.+- Use `mm predict events`, `mm predict series`, and `mm predict tags` to browse Polymarket content; tag slugs/IDs from `mm predict tags list` feed the `--tag-slug` / `--tag-id` filters on `events` and `markets`.+- After a market resolves, use `mm predict redeem list` to see winnings and `mm predict redeem <condition-id> --wait` (or `--all`) to claim them. `mm predict portfolio` shows balance, open positions, and redeemable winnings in one snapshot.+- Prices are per-share and must be in the range [0, 1].+- Side must be `buy` or `sell`.+- The `predict mode` command switches between `mainnet` and `testnet`.+- If the user does not specify a mode, the CLI uses the previously set mode.+- Setup, approve, deposit, withdraw, redeem, and order flows can return job IDs. Track them with `mm predict watch <job-id> --wait`.diff --git a/data/skills/metamask-agent-wallet/references/signing.md b/data/skills/metamask-agent-wallet/references/signing.mdnew file mode 100644index 000000000..460296f99--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/signing.md@@ -0,0 +1,70 @@+# Signing Commands++Use `wallet sign-message` and `wallet sign-typed-data` to produce+cryptographic signatures with the active wallet.++## `wallet sign-message` Command++Sign a plaintext message with the active wallet.++### Syntax++```bash+mm wallet sign-message --message <text> --chain-id <id> [--wait] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--chain-id` | Yes | EVM chain ID as a positive integer (e.g. 1, 137). If not mentioned, ask the user. |+| `--message` | Yes | Plain-text message to sign |+| `--wait` | No | Block until the signature request completes (server-wallet mode only; BYOK returns immediately) |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm wallet sign-message --message "Hello, world!" --chain-id 1+mm wallet sign-message --message "Hello" --chain-id 1 --wait+```++## `wallet sign-typed-data` Command++Sign EIP-712 typed data with the active wallet.++### Syntax++```bash+mm wallet sign-typed-data --chain-id <id> --payload '<JSON>' [--wait] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--chain-id` | Yes | EVM chain ID as a positive integer (e.g. 1, 137) |+| `--payload` | Yes | EIP-712 typed data as a JSON string with `domain`, `types`, `primaryType`, and `message` |+| `--wait` | No | Block until the signature request completes (server-wallet mode only; BYOK returns immediately) |+| `--intent` | No | Human-readable summary of what is being signed, forwarded with the request |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm wallet sign-typed-data --chain-id 1 --payload '{"types":...,"primaryType":...,"domain":...,"message":...}'+mm wallet sign-typed-data --chain-id 137 --payload '{"types":...}' --wait --intent "Approve 10 USDC"+```++## EIP-712 Typed Data++The `--payload` must be valid JSON with these required fields:+- `types` -- type definitions+- `primaryType` -- the main type being signed+- `domain` -- domain separator (name, version, chainId, verifyingContract)+- `message` -- the actual data to sign++## Notes++- If the Chain is not mentioned by the user, ask for the chain.+- In server-wallet mode, signing returns a `pollingId` when `--wait` is omitted. See `references/polling.md` to track requests.diff --git a/data/skills/metamask-agent-wallet/references/swap.md b/data/skills/metamask-agent-wallet/references/swap.mdnew file mode 100644index 000000000..c9a942e06--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/swap.md@@ -0,0 +1,109 @@+# Swap & Bridge Commands++Use the `swap` commands to perform same-chain token swaps or cross-chain bridges. When `--from-chain` and `--to-chain` differ, the CLI automatically routes through a bridge.++## `swap quote` Command++Get a swap or bridge quote showing expected output, fees, and route.++### Syntax++```bash+mm swap quote --from <token> --to <token> --amount <amount> --from-chain <chain-id> [--to-chain <chain-id>] [--to-address <address>] [--slippage <percent>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--from` | Yes | Source token symbol (e.g. ETH, POL, USDC) |+| `--to` | Yes | Destination token symbol (e.g. USDC, USDT) |+| `--amount` | Yes | Human-readable amount to swap (e.g. 0.5, 100) |+| `--from-chain` | Yes | Source EVM chain ID (e.g. 1 for Ethereum, 137 for Polygon) |+| `--to-chain` | No | Destination EVM chain ID. Defaults to `--from-chain` for same-chain swaps |+| `--to-address` | No | Recipient address for bridged output tokens. Only valid for cross-chain swaps. Defaults to the signer's wallet |+| `--slippage` | No | Maximum slippage as a percentage, 0-100 (defaults to 0.5) |++### Example++```bash+mm swap quote --from ETH --to USDC --amount 0.5 --from-chain 1+mm swap quote --from USDC --to USDT --amount 100 --from-chain 137+mm swap quote --from ETH --to USDC --amount 1 --from-chain 1 --to-chain 137+mm swap quote --from ETH --to USDC --amount 0.5 --from-chain 1 --slippage 1+mm swap quote --from ETH --to pUSD --amount 0.5 --from-chain 1 --to-chain 137 --to-address 0x742d...f2bD18+```++## `swap execute` Command++Execute a swap or bridge, either by referencing a previous quote ID or by providing parameters for an automatic re-quote and execute.++### Syntax++```bash+mm swap execute --quote-id <id> [--password <password>]+mm swap execute --from <token> --to <token> --amount <amount> --from-chain <chain-id> [--to-chain <chain-id>] [--to-address <address>] [--slippage <percent>] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--quote-id` | Yes (unless re-quote args given) | Quote ID returned by `mm swap quote`. If omitted, provide `--from`, `--to`, `--amount`, and `--from-chain` to re-quote |+| `--from` | Yes (unless `--quote-id`) | Source token symbol |+| `--to` | Yes (unless `--quote-id`) | Destination token symbol |+| `--amount` | Yes (unless `--quote-id`) | Amount to swap |+| `--from-chain` | Yes (unless `--quote-id`) | Source EVM chain ID |+| `--to-chain` | No | Destination EVM chain ID. Defaults to `--from-chain` for same-chain swaps |+| `--to-address` | No | Recipient address for bridged output tokens. Only valid for cross-chain swaps. Defaults to the signer's wallet. Persisted quotes retain the recipient for `--quote-id` execution |+| `--slippage` | No | Maximum slippage as a percentage, 0-100 (defaults to 0.5) |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Validation Rules++- Either `--quote-id` OR the full set of re-quote flags (`--from`, `--to`, `--amount`, `--from-chain`) must be provided.+- When `--quote-id` is given, re-quote flags are ignored.++### Example++```bash+mm swap execute --quote-id <quote-id>+mm swap execute --from ETH --to USDC --amount 0.5 --from-chain 1+mm swap execute --from USDC --to USDT --amount 100 --from-chain 137 --to-chain 137 --slippage 1+```++## `swap status` Command++Check the status of a previously executed swap or bridge by its quote ID.++### Syntax++```bash+mm swap status --quote-id <id> [--tx-hash <hash>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--quote-id` | Yes | Quote ID returned by `mm swap quote` |+| `--tx-hash` | No | Source transaction hash. Overrides the stored hash from execute |++### Example++```bash+mm swap status --quote-id <quote-id>+mm swap status --quote-id <quote-id> --tx-hash 0xabc...123+```++## Notes++- If the chain is not mentioned by the user, ask for the chain.+- Use `mm chains list` to discover supported chain IDs.+- Same-chain swap: omit `--to-chain` (it defaults to `--from-chain`).+- Cross-chain bridge: set `--to-chain` to a different chain than `--from-chain`. The CLI automatically routes through a bridge.+- The typical flow is: `mm swap quote` to preview, then `mm swap execute --quote-id <id>` to submit.+- You can skip the quote step by passing all swap parameters directly to `mm swap execute`.+- Use `mm swap status --quote-id <id>` to track progress after execution.+- If the user asks to "bridge" tokens, use the `swap` commands with different `--from-chain` and `--to-chain` values.+- After execution, track swap progress with `mm swap status --quote-id <id>`.diff --git a/data/skills/metamask-agent-wallet/references/transaction.md b/data/skills/metamask-agent-wallet/references/transaction.mdnew file mode 100644index 000000000..69d0cfaf5--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/transaction.md@@ -0,0 +1,51 @@+# Transaction Commands++Use `wallet send-transaction` to send raw EVM transactions with the active wallet.++## `wallet send-transaction` Command++Send a raw EVM transaction using the active wallet.++### Syntax++```bash+mm wallet send-transaction --chain-id <id> --payload '<JSON>' [--wait] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--chain-id` | Yes | EVM chain ID as a positive integer (e.g. 1, 137) |+| `--payload` | Yes | Transaction as a JSON string with at least a `to` address (e.g. `'{"to":"0x...","value":"0x0"}'}`) |+| `--wait` | No | Block until the transaction completes (server-wallet mode only; BYOK returns immediately) |+| `--intent` | No | Human-readable summary of what the transaction does, forwarded with the request |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm wallet send-transaction --chain-id 1 --payload '{"to":"0x742d...","value":"0xde0b6b3a7640000","data":"0x"}' --intent "Send 1 ETH to 0x742d...f2bD18"+mm wallet send-transaction --chain-id 1 --payload '{"to":"0x...","value":"0x0","data":"0xabcdef"}' --wait+mm wallet send-transaction --chain-id 1 --payload '...' --toon+```++## Transaction Payload++The `--payload` flag takes a JSON string with transaction fields:++```json+{+ "to": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",+ "value": "0xde0b6b3a7640000",+ "data": "0x"+}+```++Optional fields: `gas`, `nonce`, `maxFeePerGas`, `maxPriorityFeePerGas`. The `value` field must be 0x-prefixed hex, not a decimal wei string.++## Notes++- If the chain is not mentioned by the user, ask for the chain.+- When the `data`/calldata is unfamiliar or was not constructed by you, decode it first with `mm decode --payload <0x-calldata>` and confirm the intent before sending. See `references/decode.md`.+- In server-wallet mode, send-transaction returns a `pollingId` when `--wait` is omitted. See `references/polling.md` to track requests.diff --git a/data/skills/metamask-agent-wallet/references/transfer.md b/data/skills/metamask-agent-wallet/references/transfer.mdnew file mode 100644index 000000000..4286708a5--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/transfer.md@@ -0,0 +1,38 @@+# Transfer Commands++Use `transfer` to send native token or ERC-20 tokens from the active wallet.++## `transfer` Command++Transfer native currency or ERC-20 tokens to a recipient address.++### Syntax++```bash+mm transfer --to <address> --amount <value> --chain-id <id> --token <symbol-or-address> [--wait] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--to` | Yes | Recipient hex address (e.g. 0x742d...f2bD18). ENS is not supported. |+| `--amount` | Yes | Human-readable amount to transfer (e.g. 0.5, 100) |+| `--chain-id` | Yes | EVM chain ID as a positive integer (e.g. 1, 137) |+| `--token` | Yes | Token symbol or ERC-20 contract address (e.g. ETH, USDC, 0xa0b8...) |+| `--wait` | No | Block until the transfer completes (server-wallet mode only; BYOK returns immediately) |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm transfer --to 0x742d...f2bD18 --amount 0.5 --chain-id 1 --token ETH+mm transfer --to 0x742d...f2bD18 --amount 100 --chain-id 137 --token USDC+mm transfer --to 0x742d...f2bD18 --amount 1.0 --chain-id 1 --token ETH --toon+```++## Notes++- If the chain is not mentioned by the user, ask for the chain.+- Use `mm chains list` to discover supported chain IDs.+- In server-wallet mode, transfer returns a `pollingId` when `--wait` is omitted. See `references/polling.md` to track requests.diff --git a/data/skills/metamask-agent-wallet/references/wallet.md b/data/skills/metamask-agent-wallet/references/wallet.mdnew file mode 100644index 000000000..e882c1e0c--- /dev/null+++ b/data/skills/metamask-agent-wallet/references/wallet.md@@ -0,0 +1,200 @@+# Wallet Commands++Use the `wallet` commands to create, list, select, inspect wallets, and check balances.++## `wallet create` Command++Create a new wallet under the authenticated account.++### Syntax++```bash+mm wallet create [--chain-namespace <namespace>] [--name <name>] [--trading-mode <mode>] [--password <password>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--chain-namespace` | No | Wallet chain namespace: `evm` (EIP-155) (allowed: `evm`) |+| `--name` | No | Display name for the wallet |+| `--trading-mode` | No | `guard` enforces outflow/whitelist policies and blocks malicious transactions. `beast` skips policy checks but still blocks malicious transactions. Only applies to server-wallet mode (allowed: `guard`, `beast`) |+| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |++### Example++```bash+mm wallet create --chain-namespace evm+mm wallet create --chain-namespace evm --name "Trading"+mm wallet create --chain-namespace evm --name "Fast Trading" --trading-mode beast+```++## `wallet list` Command++List all wallets associated with the authenticated account.++### Syntax++```bash+mm wallet list [--chain-namespace <namespace>] [--toon]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--chain-namespace` | No | Filter by namespace: `evm` (EIP-155) (allowed: `evm`) |++### Example++```bash+mm wallet list+mm wallet list --chain-namespace evm --toon+```++## `wallet select` Command++Switch the active wallet used for subsequent commands.++### Syntax++```bash+mm wallet select [--chain-namespace <namespace>] [--id <id>] [--address <address>] [--name <name>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--chain-namespace` | No | Filter by namespace: `evm` (EIP-155) (allowed: `evm`) |+| `--id` | No | Wallet ID |+| `--address` | No | Wallet address (0x-prefixed hex) |+| `--name` | No | Wallet display name |++### Example++```bash+mm wallet select --address 0x742d...f2bD18+mm wallet select --name "Trading"+```++## `wallet show` Command++Display details for a specific wallet or the currently active wallet.++### Syntax++```bash+mm wallet show [--chain-namespace <namespace>] [--id <id>] [--address <address>] [--name <name>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--chain-namespace` | No | Filter by namespace: `evm` (EIP-155) (allowed: `evm`) |+| `--id` | No | Wallet ID |+| `--address` | No | Wallet address (0x-prefixed hex) |+| `--name` | No | Wallet display name |++### Example++```bash+mm wallet show+mm wallet show --address 0x742d...f2bD18+```++## `wallet address` Command++Print the address of the currently active wallet.++### Syntax++```bash+mm wallet address [--chain-namespace <namespace>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--chain-namespace` | No | Wallet chain namespace: `evm` (EIP-155) (allowed: `evm`) |++### Example++```bash+mm wallet address+mm wallet address --chain-namespace evm+```++## `wallet trading-mode get` Command++Show the current trading mode, active server-wallet address, and policies for the selected wallet. Server-wallet mode only.++### Syntax++```bash+mm wallet trading-mode get+```++### Example++```bash+mm wallet trading-mode get+```++## `wallet trading-mode set` Command++Set the trading mode for the active server wallet. Prompts for confirmation when switching to Beast mode. Rejects if the mode is already set or the session isn't in server-wallet mode.++### Syntax++```bash+mm wallet trading-mode set <guard|beast>+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `<mode>` | Yes | `guard` enforces outflow/whitelist policies and blocks malicious transactions. `beast` skips policy checks but still blocks malicious transactions |++### Example++```bash+mm wallet trading-mode set guard+mm wallet trading-mode set beast+```++## `wallet balance` Command++Show native and token balances for the active wallet.++### Syntax++```bash+mm wallet balance [--currency <code>] [--chain <chains>] [--token <token>] [--address <address>] [--testnet] [--testnet-chain-id <ids>] [--token-contracts <addresses>]+```++### Supported Flags++| Name | Required | Description |+| --- | --- | --- |+| `--currency` | No | Fiat currency code for price conversion (e.g. usd, eur) |+| `--chain` | No | Comma-separated chain filters (e.g. `1,137` or `eip155:1`). Run `mm chains list` to see options |+| `--token` | No | Filter by token symbol, contract address, or CAIP-19 asset ID (e.g. USDC, 0xa0b8...) |+| `--address` | No | Wallet address (0x-prefixed hex) |+| `--testnet` | No | Read balances via RPC on Arbitrum Sepolia, Amoy, and Sepolia testnets |+| `--testnet-chain-id` | No | Comma-separated EVM testnet chain IDs for on-chain RPC balance reads (e.g. `421614,80002`) |+| `--token-contracts` | No | Comma-separated ERC-20 contract addresses for testnet RPC chains (0x-prefixed hex). Use with `--testnet-chain-id` to read specific token balances on testnets |++### Example++```bash+mm wallet balance+mm wallet balance --chain 8453+mm wallet balance --token USDC+mm wallet balance --currency eur+mm wallet balance --testnet+mm wallet balance --testnet-chain-id 421614 --token-contracts 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48+```diff --git a/data/skills/metamask-agent-wallet/scripts/amount_to_hex.py b/data/skills/metamask-agent-wallet/scripts/amount_to_hex.pynew file mode 100644index 000000000..fe18b7b97--- /dev/null+++ b/data/skills/metamask-agent-wallet/scripts/amount_to_hex.py@@ -0,0 +1,23 @@+#!/usr/bin/env python3+"""Convert a human-readable token amount to 0x-prefixed hex for EVM calldata.++Usage:+ python3 amount_to_hex.py <amount> <decimals>++Examples:+ python3 amount_to_hex.py 1.5 18 # 1.5 ETH -> 0x14d1120d7b160000+ python3 amount_to_hex.py 100 6 # 100 USDC -> 0x5f5e100+ python3 amount_to_hex.py 0.001 8 # 0.001 WBTC -> 0x186a0+"""++import sys+from decimal import Decimal++if len(sys.argv) != 3:+ print(f"Usage: {sys.argv[0]} <amount> <decimals>", file=sys.stderr)+ sys.exit(1)++decimals = int(sys.argv[2])+value = int(Decimal(sys.argv[1]) * 10 ** decimals)++print(hex(value))diff --git a/data/skills/metamask-agent-wallet/workflows/aave-borrow.md b/data/skills/metamask-agent-wallet/workflows/aave-borrow.mdnew file mode 100644index 000000000..08372dc35--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/aave-borrow.md@@ -0,0 +1,81 @@+# Aave V3 borrow workflow++Use this workflow to borrow assets from Aave V3 against supplied collateral.++## Flow++1. Resolve chain, asset address, and pool address.+2. Check collateral and borrow capacity.+3. Preview health factor impact.+4. Query the Aave API for the borrow transaction and execute.++## Resolve chain and addresses++If the user doesn't specify a chain, ask. Look up the pool address:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++## Check collateral++Before borrowing, check the user's positions using `aave-positions.md`. Verify the following.++1. The user has supplied collateral. If not, follow `aave-supply.md` to supply assets first.+2. Collateral is enabled on at least one supplied asset (`isCollateral` is `true`). If not, follow `aave-collateral.md` to enable it.+3. Available borrow capacity covers the requested amount.++Query available markets to check the target asset's borrow APY and whether `borrowCapReached` is `true`. See `aave-markets.md`.++## Preview health factor++Preview the health factor impact before borrowing:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ healthFactorPreview(request: { action: { borrow: { market: \"<POOL_ADDRESS>\", sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID>, amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: \"<AMOUNT>\" } } } } }) { before after } }"+ }'+```++Show the health factor before and after. If the projected health factor (`after`) drops below 1.5, warn about liquidation risk. If it drops below 1.0, stop and tell the user to reduce the borrow amount or repay existing debt.++## Query borrow transaction++Get the wallet address and query the Aave V3 GraphQL API. Don't include `onBehalfOf` when borrowing for the user's own account. It triggers a credit delegation requirement even for self-borrows.++```bash+mm wallet address+```++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ borrow(request: { market: \"<POOL_ADDRESS>\", amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: \"<AMOUNT>\" } }, sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID> }) { __typename ... on TransactionRequest { to from data value chainId } ... on ApprovalRequired { approval { to from data value chainId } originalTransaction { to from data value chainId } } ... on InsufficientBalanceError { required { value decimals } available { value decimals } } } }"+ }'+```++The `value` in the amount is a human-readable decimal string (e.g., `"2"`, `"100"`). The API handles conversion.++## Execute borrow++Confirm the asset, amount, chain, and projected health factor with the user. The `value` field must be `0x`-prefixed hex (typically `"0x0"` for ERC-20 borrows).++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<TO>","value":"0x0","data":"<DATA>"}' --wait --intent "Borrow <AMOUNT> <SYMBOL> from Aave V3 on <CHAIN_NAME>"+```++If the response is `InsufficientBalanceError`, show the required and available amounts and stop.++## Notes++- After the transaction confirms, use `aave-positions.md` to verify the updated position and health factor.+- The borrowed amount accrues interest over time. Check debt at any time using `aave-positions.md`.+- To repay the borrow, see `aave-repay.md`.diff --git a/data/skills/metamask-agent-wallet/workflows/aave-collateral.md b/data/skills/metamask-agent-wallet/workflows/aave-collateral.mdnew file mode 100644index 000000000..70df58406--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/aave-collateral.md@@ -0,0 +1,64 @@+# Aave V3 collateral workflow++Use this workflow to enable or disable an asset as collateral on Aave V3.++## Flow++1. Resolve chain, asset address, and pool address.+2. Check current collateral status and health factor.+3. Query the Aave API for the collateral toggle transaction.+4. Execute toggle.++## Resolve chain and addresses++If the user doesn't specify a chain, ask. Look up the pool address:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++## Check status++Query the user's positions using `aave-positions.md`. For the target asset, check whether collateral is enabled or disabled (`isCollateral`).++The user must have a non-zero supply of the asset to toggle collateral.++When disabling collateral, check the health factor. If the user has outstanding borrows, disabling collateral lowers the health factor. Show the impact. If the health factor would drop below 1.0, stop and tell the user to repay debt first via `aave-repay.md`.++## Query collateral toggle transaction++Get the wallet address and query the Aave V3 GraphQL API:++```bash+mm wallet address+```++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ collateralToggle(request: { market: \"<POOL_ADDRESS>\", underlyingToken: \"<ASSET_ADDRESS>\", user: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID> }) { to from data value chainId } }"+ }'+```++The API returns a `TransactionRequest` with `{to, from, data, value, chainId}`. The toggle direction is determined automatically based on the current collateral state.++## Execute toggle++Confirm the asset, toggle direction (enabling or disabling), and chain with the user. The `value` field must be `0x`-prefixed hex.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<TO>","value":"0x0","data":"<DATA>"}' --wait --intent "Toggle <SYMBOL> as collateral on Aave V3 on <CHAIN_NAME>"+```++## Notes++- Enabling collateral lets the asset back borrows, increasing borrow capacity.+- Disabling collateral removes it from the borrow calculation. This may trigger liquidation if remaining collateral can't cover existing debt.+- Not all assets support collateral usage. If the transaction reverts, the reserve may not be eligible.+- After the transaction confirms, verify the updated status using `aave-positions.md`.diff --git a/data/skills/metamask-agent-wallet/workflows/aave-markets.md b/data/skills/metamask-agent-wallet/workflows/aave-markets.mdnew file mode 100644index 000000000..4b791c40f--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/aave-markets.md@@ -0,0 +1,46 @@+# Aave V3 markets workflow++Use this workflow to discover available Aave V3 tokens, supply/borrow rates, and borrowing capacity on a chain.++## Flow++1. Resolve chain.+2. Query available markets.+3. Present results.++## Resolve chain++If the user doesn't specify a chain, ask. Aave V3 is deployed on these chains:++| Chain | Chain ID |+| --- | --- |+| Ethereum | 1 |+| Polygon | 137 |+| Arbitrum | 42161 |+| Optimism | 10 |+| Avalanche | 43114 |+| Base | 8453 |++## Query available markets++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ markets(request: { chainIds: [<CHAIN_ID>] }) { reserves { underlyingToken { symbol decimals } supplyInfo { apy { formatted } } borrowInfo { apy { formatted } availableLiquidity { amount { value } usd } borrowCapReached } isFrozen isPaused } } }"+ }'+```++## Present results++Filter out reserves where `isFrozen` or `isPaused` is `true`. For each active reserve, show:++- Token symbol and decimals (`underlyingToken.symbol`, `underlyingToken.decimals`)+- Supply APY (`supplyInfo.apy.formatted`)+- Borrow APY (`borrowInfo.apy.formatted`)+- Available liquidity (`borrowInfo.availableLiquidity.amount.value`, `borrowInfo.availableLiquidity.usd`)+- Borrow cap reached (`borrowInfo.borrowCapReached`)++The `apy.formatted` field returns a percentage directly (e.g., `"2.12"` means 2.12%). No conversion is needed.++If `borrowCapReached` is `true`, tell the user that borrowing isn't available for that asset.diff --git a/data/skills/metamask-agent-wallet/workflows/aave-positions.md b/data/skills/metamask-agent-wallet/workflows/aave-positions.mdnew file mode 100644index 000000000..cae93a2fe--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/aave-positions.md@@ -0,0 +1,72 @@+# Aave V3 positions workflow++Use this workflow to check Aave V3 positions, health factor, interest rates, or reserve data.++## Flow++1. Get wallet address and chain.+2. Query supply and borrow positions via GraphQL.+3. Present summary.++## Resolve chain++Get the wallet address:++```bash+mm wallet address+```++If the user doesn't specify a chain, ask. Aave V3 is deployed on these chains:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++## Query positions++Query supply and borrow positions in a single request:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ userSupplies(request: { markets: [{ address: \"<POOL_ADDRESS>\", chainId: <CHAIN_ID> }], user: \"<WALLET_ADDRESS>\" }) { currency { symbol decimals } balance { amount { value } usd } apy { formatted } isCollateral } userBorrows(request: { markets: [{ address: \"<POOL_ADDRESS>\", chainId: <CHAIN_ID> }], user: \"<WALLET_ADDRESS>\" }) { currency { symbol decimals } debt { amount { value } usd } apy { formatted } } }"+ }'+```++The response contains both `userSupplies` and `userBorrows` arrays.++## Health factor preview++Preview the health factor impact of a planned operation:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ healthFactorPreview(request: { action: { <OPERATION>: { market: \"<POOL_ADDRESS>\", sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID>, amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: \"<AMOUNT>\" } } } } }) { before after } }"+ }'+```++Replace `<OPERATION>` with `supply`, `borrow`, `withdraw`, or `repay`. All action types require `market`, `sender`, and `chainId`.++## Present summary++Format the data into three sections:++Supplied assets:+- Symbol, balance (`balance.amount.value`), USD value (`balance.usd`), supply APY (`apy.formatted`), used as collateral (`isCollateral`)++Borrowed assets:+- Symbol, debt amount (`debt.amount.value`), USD value (`debt.usd`), borrow APY (`apy.formatted`)++Account summary:+- Total collateral value, total debt value, available borrows, health factor+- Health factor guidance: above 2.0 is safe, 1.5–2.0 is moderate, 1.0–1.5 is risky and approaching liquidation, below 1.0 is liquidatable++The `apy.formatted` field returns a percentage directly (e.g., `"2.12"` means 2.12%). No conversion is needed.\ No newline at end of filediff --git a/data/skills/metamask-agent-wallet/workflows/aave-repay.md b/data/skills/metamask-agent-wallet/workflows/aave-repay.mdnew file mode 100644index 000000000..ac458a62f--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/aave-repay.md@@ -0,0 +1,101 @@+# Aave V3 repay workflow++Use this workflow to repay borrowed assets on Aave V3.++## Flow++1. Resolve chain, asset address, and pool address.+2. Check outstanding debt.+3. Query the Aave API for the repay transaction.+4. Handle approval if required, then repay.++## Resolve chain and addresses++If the user doesn't specify a chain, ask. Look up the pool address:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++## Check debt++Query the user's outstanding debt using `userBorrows` from `aave-positions.md`. Identify the following.++- The asset being repaid and its contract address+- Current debt amount (`debt.amount.value`)+- Current borrow APY (`apy.formatted`)++Show the debt amount and current rate.++## Query repay transaction++Get the wallet address and query the Aave V3 GraphQL API:++```bash+mm wallet address+```++For a specific repayment amount:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ repay(request: { market: \"<POOL_ADDRESS>\", amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: { exact: \"<AMOUNT>\" } } }, sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID> }) { __typename ... on TransactionRequest { to from data value chainId } ... on ApprovalRequired { reason requiredAmount { value decimals } currentAllowance { value decimals } approval { to from data value chainId } originalTransaction { to from data value chainId } } ... on InsufficientBalanceError { required { value decimals } available { value decimals } } } }"+ }'+```++To repay the full debt, use `{ max: true }` instead of `{ exact: \"<AMOUNT>\" }` in the value field. This lets the contract calculate the exact outstanding debt at execution time, including accrued interest.++You can't use `{ max: true }` when `onBehalfOf` is set in the request. If repaying on behalf of another address, specify the exact repayment amount. Query the current debt via `userBorrows` and add a small buffer (e.g., 0.5%) to account for interest accrued between query and execution.++## Handle response++The API returns one of three response types:++### `TransactionRequest`++The transaction is ready to send. Confirm with the user, then send. The `value` field must be `0x`-prefixed hex (typically `"0x0"` for ERC-20 repayments).++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<TO>","value":"0x0","data":"<DATA>"}' --wait --intent "Repay <AMOUNT> <SYMBOL> on Aave V3 on <CHAIN_NAME>"+```++### `ApprovalRequired`++An ERC-20 approval is needed before repayment. Confirm the token being approved, the spender, and the amount with the user. Then send the approval.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<APPROVAL_TO>","value":"0x0","data":"<APPROVAL_DATA>"}' --wait --intent "Approve <AMOUNT> <SYMBOL> for Aave V3 Pool <POOL_ADDRESS> on <CHAIN_NAME>"+```++After the approval confirms, send the original repay transaction.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<ORIGINAL_TX_TO>","value":"0x0","data":"<ORIGINAL_TX_DATA>"}' --wait --intent "Repay <AMOUNT> <SYMBOL> on Aave V3 on <CHAIN_NAME>"+```++ERC-20 approvals are consumed by the repay transaction. If the user approved an exact amount and needs to repay again (e.g., for remaining dust debt), a new approval is required. Consider approving slightly more than the debt amount to avoid this.++### `InsufficientBalanceError`++The user doesn't have enough tokens to repay. Show the required and available amounts, then stop.++## Handling dust debt++Interest accrues continuously between borrow and repay transactions. When repaying an exact amount equal to the original borrow, a small "dust" debt remains.++To handle this:+1. Use `{ max: true }` (only works without `onBehalfOf`) to let the contract calculate the exact outstanding debt at execution time.+2. Over-repay slightly: query the current debt via `userBorrows`, then repay with the debt amount plus a small buffer (e.g., 0.5%). The contract only deducts the actual debt and refunds the excess.+3. Acquire more tokens: if the wallet balance equals the exact original borrow amount, acquire slightly more of the token to cover interest.++## Notes++- After the transaction confirms, use `aave-positions.md` to verify the debt is cleared or reduced.+- All debt (including dust amounts) must be cleared before a full collateral withdrawal. See `aave-withdraw.md`.diff --git a/data/skills/metamask-agent-wallet/workflows/aave-supply.md b/data/skills/metamask-agent-wallet/workflows/aave-supply.mdnew file mode 100644index 000000000..1e914d2b2--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/aave-supply.md@@ -0,0 +1,100 @@+# Aave V3 supply workflow++Use this workflow to supply (deposit) assets into Aave V3 and earn interest.++## Flow++1. Resolve chain, asset address, and pool address.+2. Check wallet balance.+3. Query the Aave API for the supply transaction.+4. Handle approval if required, then supply.++## Resolve chain and addresses++If the user doesn't specify a chain, ask. Look up the pool address:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++Resolve the asset's contract address on the target chain. If the user provides a symbol instead of an address, run `mm token list search --query <SYMBOL> --chain <CHAIN_ID>`.++Aave V3 doesn't accept native ETH on most markets. If the reserve accepts native tokens, use `native` instead of `erc20` in the GraphQL request.++## Check balance++Check that the user has sufficient funds:++```bash+mm wallet balance --chain <CHAIN_ID>+```++If the user doesn't have enough of the supply token or native gas token, check balances on other chains. If the user has assets on the same chain, prompt them to swap. If the user has assets on another chain, prompt them to bridge to the target chain before proceeding.++## Query supply transaction++Get the wallet address and query the Aave V3 GraphQL API for the supply execution plan:++```bash+mm wallet address+```++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ supply(request: { market: \"<POOL_ADDRESS>\", amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: \"<AMOUNT>\" } }, sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID> }) { __typename ... on TransactionRequest { to from data value chainId } ... on ApprovalRequired { reason requiredAmount { value decimals } currentAllowance { value decimals } approval { to from data value chainId } originalTransaction { to from data value chainId } } ... on InsufficientBalanceError { required { value decimals } available { value decimals } } } }"+ }'+```++The `value` in the amount is a human-readable decimal string (e.g., `"42"`, `"0.5"`). The API handles decimal-to-wei conversion.++## Handle response++The API returns one of three response types:++### `TransactionRequest`++The transaction is ready to send. Confirm with the user, then send.++The `value` field in the transaction payload must be `0x`-prefixed hex. For ERC-20 supplies, this is `"0x0"`. For native token supplies, convert the amount to hex using the helper script:++```bash+python3 scripts/amount_to_hex.py <AMOUNT> <DECIMALS>+```++If python3 isn't available, multiply the amount by `10^decimals` manually and convert the result to hex.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<TO>","value":"0x0","data":"<DATA>"}' --wait --intent "Supply <AMOUNT> <SYMBOL> to Aave V3 on <CHAIN_NAME>"+```++### `ApprovalRequired`++An ERC-20 approval is needed before supply. Confirm the token being approved, the spender, and the amount with the user. Then send the approval.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<APPROVAL_TO>","value":"0x0","data":"<APPROVAL_DATA>"}' --wait --intent "Approve <AMOUNT> <SYMBOL> for Aave V3 Pool <POOL_ADDRESS> on <CHAIN_NAME>"+```++After the approval confirms, send the original supply transaction.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<ORIGINAL_TX_TO>","value":"0x0","data":"<ORIGINAL_TX_DATA>"}' --wait --intent "Supply <AMOUNT> <SYMBOL> to Aave V3 on <CHAIN_NAME>"+```++Security note: The Aave API returns `max uint256` (unlimited) as the default approval amount. Tell the user. For better security, construct a limited approval by encoding `approve(address,uint256)` calldata (selector `0x095ea7b3`) with the exact supply amount instead of using the API-provided approval transaction.++### `InsufficientBalanceError`++The user doesn't have enough tokens. Show the required and available amounts, then stop.++## Notes++- After the transaction confirms, the user receives aTokens representing their deposit. Use `aave-positions.md` to verify the updated position.+- To check current supply rates before supplying, see `aave-positions.md`.diff --git a/data/skills/metamask-agent-wallet/workflows/aave-withdraw.md b/data/skills/metamask-agent-wallet/workflows/aave-withdraw.mdnew file mode 100644index 000000000..d8ebde886--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/aave-withdraw.md@@ -0,0 +1,76 @@+# Aave V3 withdraw workflow++Use this workflow to withdraw supplied assets from Aave V3.++## Flow++1. Resolve chain, asset address, and pool address.+2. Check positions and health factor.+3. Query the Aave API for the withdraw transaction.+4. Execute withdrawal.++## Resolve chain and addresses++If the user doesn't specify a chain, ask. Look up the pool address:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++## Check positions++Check the user's current positions using `aave-positions.md`. Confirm the asset and available balance.++Before a full withdrawal, query `userBorrows` and verify there's no outstanding debt. A full collateral withdrawal fails if any debt exists, even tiny "dust" amounts. The transaction reverts with error `0x6679996d`. Follow `aave-repay.md` to clear all debt first.++For a partial withdrawal with outstanding borrows, preview the health factor impact:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ healthFactorPreview(request: { action: { withdraw: { market: \"<POOL_ADDRESS>\", sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID>, amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: { exact: \"<AMOUNT>\" } } } } } }) { before after } }"+ }'+```++If the projected health factor (`after`) drops below 1.5, warn about liquidation risk. If it drops below 1.0, stop and tell the user to repay debt first.++## Query withdraw transaction++Get the wallet address and query the Aave V3 GraphQL API:++```bash+mm wallet address+```++For a specific amount:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ withdraw(request: { market: \"<POOL_ADDRESS>\", amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: { exact: \"<AMOUNT>\" } } }, sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID> }) { __typename ... on TransactionRequest { to from data value chainId } ... on ApprovalRequired { approval { to from data value chainId } originalTransaction { to from data value chainId } } ... on InsufficientBalanceError { required { value decimals } available { value decimals } } } }"+ }'+```++To withdraw the full balance, use `{ max: true }` instead of `{ exact: \"<AMOUNT>\" }` in the value field.++## Execute withdrawal++Confirm the asset, amount (or "full balance"), destination, and chain with the user. The `value` field must be `0x`-prefixed hex (typically `"0x0"` for ERC-20 withdrawals).++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<TO>","value":"0x0","data":"<DATA>"}' --wait --intent "Withdraw <AMOUNT> <SYMBOL> from Aave V3 on <CHAIN_NAME>"+```++If the response is `ApprovalRequired`, send the approval transaction first, then the withdrawal transaction (same pattern as `aave-supply.md`).++## Notes++- After the transaction confirms, use `aave-positions.md` to verify the updated position.+- Add a `recipient` field to the request to withdraw to a different address than the sender.diff --git a/data/skills/metamask-agent-wallet/workflows/bridge.md b/data/skills/metamask-agent-wallet/workflows/bridge.mdnew file mode 100644index 000000000..a21133c7e--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/bridge.md@@ -0,0 +1,55 @@+# Bridge workflow++Use this workflow when the user wants to bridge tokens across chains.++Reference command syntax in `references/swap.md`. The CLI uses the same `swap` commands for bridging — set `--to-chain` to a different chain than `--from-chain`.++## Flow++1. Quote.+2. Confirm with the user.+3. Execute and track status.++Don't skip the quote review step. The user needs to see output amount, fees, route, and slippage before executing.++## Quote++```bash+mm swap quote --from ETH --to USDC --amount 1 --from-chain 1 --to-chain 137 --slippage 0.5+```++Required flags: `--from`, `--to`, `--amount`, `--from-chain`, and `--to-chain`.++If the user wants the bridged tokens sent to a different wallet on the destination chain, add `--to-address`:++```bash+mm swap quote --from ETH --to USDC --amount 1 --from-chain 1 --to-chain 137 --to-address 0x742d...f2bD18+```++Persist the quote id for execution. Show the quote to the user before execution.+Confirm source token, destination token, amount, source chain, destination chain, slippage, expected output, fees, route, and recipient address (if `--to-address` was set).++## Execute++```bash+mm 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.++## Status++```bash+mm swap status --quote-id "QUOTE_ID"+mm swap status --quote-id "QUOTE_ID" --tx-hash 0xabc123+```++Use status polling for bridges where the destination side can lag behind the source transaction.++## Edge cases++- Quote expired: re-quote and ask the user to review the new quote.+- Insufficient balance: surface the error verbatim.+- Slippage exceeded: only increase `--slippage` if 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 chains list` before guessing a chain ID.diff --git a/data/skills/metamask-agent-wallet/workflows/login.md b/data/skills/metamask-agent-wallet/workflows/login.mdnew file mode 100644index 000000000..fcf689aca--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/login.md@@ -0,0 +1,38 @@+# Login Workflow++Use this workflow when the user needs to log in to the CLI.++Reference command syntax in `references/auth.md`.++## Flow++1. Ask the user which login method they want: MetaMask Mobile QR, Google, or Email.+2. Execute login.+3. Verify with token.++## Login++For non-interactive/CI flows, use Google or email with `--no-wait`:++```bash+mm login google --no-wait+mm login email --no-wait+```++The command prints a sign-in URL.++`mm login qr` (scan with MetaMask Mobile) is available on non-production builds (dev/uat); on production it returns `COMING_SOON`. QR login keeps the CLI attached to the relay, so it does not support `--no-wait`.++## Verify++Once the user completes sign-in, verify with:++```bash+mm login --token "<TOKEN>"+```++## Confirm++```bash+mm auth status+```diff --git a/data/skills/metamask-agent-wallet/workflows/market-data.md b/data/skills/metamask-agent-wallet/workflows/market-data.mdnew file mode 100644index 000000000..872563ad6--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/market-data.md@@ -0,0 +1,62 @@+# Market Data Workflow++Use this workflow when the user wants to look up token prices, discover tokens, or explore market data.++Reference command syntax in `references/market-data.md`.++## Find a Token++If the user mentions a token by name or symbol, search for it first to get the correct asset ID:++```bash+mm token list search --query "USDC" --chain 1+```++To browse popular, trending, or top-gainer tokens on a chain:++```bash+mm token list popular --chain 1+mm token list trending --chain 1+mm token list top-gainer --chain 1+```++Use `mm token networks` to discover which chains support token data.++## Get Token Metadata++Once you have the CAIP-19 asset ID, fetch detailed metadata:++```bash+mm token assets --asset-ids "eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" --include-market-data --include-token-security-data+```++## Get Spot Price++Fetch the current price for one or more tokens:++```bash+mm price spot --asset-ids "eip155:1/slip44:60"+mm price spot --asset-ids "eip155:1/slip44:60,eip155:137/slip44:966" --vs eur --market-data+```++Use `mm price networks` to discover supported CAIP-2 chain IDs and `mm price currencies` to list quote currencies.++## Get Historical Price++Fetch historical price data for an asset:++```bash+mm price history --chain-id eip155:1 --asset-type slip44:60 --time-period 7d --interval daily+```++Common time periods: `1d`, `7d`, `30d`, `2M`, `1y`, `3y`. Intervals: `5m`, `hourly`, `daily`.++For a custom date range, use `--from` and `--to` with Unix timestamps instead of `--time-period`.++## Edge Cases++- If the chain is not mentioned by the user, ask for the chain.+- Use `mm chains list` to discover supported chain IDs.+- If a token search returns no results, try broader chains or alternate names.+- CAIP-19 asset IDs follow the format `eip155:<chainId>/slip44:<coinType>` for native tokens or `eip155:<chainId>/erc20:<contractAddress>` for ERC-20s.+- Use `--include-token-security-data` on `token assets` to surface scam or risk signals before the user trades an unfamiliar token.diff --git a/data/skills/metamask-agent-wallet/workflows/onboarding.md b/data/skills/metamask-agent-wallet/workflows/onboarding.mdnew file mode 100644index 000000000..e479be529--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/onboarding.md@@ -0,0 +1,109 @@+# Onboarding Workflow++Use this workflow when the user is setting up the MetaMask Agentic CLI for the first time.++Reference command syntax in `references/auth.md` and `references/wallet.md`.++## Flow++1. Check CLI installation.+2. Login.+3. Initialize wallet mode.+4. Verify auth status.+5. Show wallet address.++## Check CLI Installation++```bash+mm --version+```++If this fails, the CLI is not installed. Guide the user to install it with `npm install -g @metamask/agentic-cli@latest` before proceeding.++Then run the version compatibility check from the skill `Preflight` section: compare the installed `major.minor` against the pinned `cliVersion` and the latest published release, and warn the user if they are out of sync.++## Login Flow++Ask the user which login method they want to use: MetaMask Mobile QR, Google, or Email. QR (`mm login qr`) is available on non-production builds (dev/uat); on production it returns `COMING_SOON`, so fall back to Google or email there.++### Login++```bash+mm login google --no-wait+mm login email --no-wait+```++Use `--no-wait` for non-interactive environments. The command prints a sign-in URL.++### Verify++Once the user completes sign-in, verify with:++```bash+mm login --token "<TOKEN>"+```++## Initialize Project++First check if the project is already initialized:++```bash+mm init show+```++If already initialized, skip this step.++For server-wallet mode, if the account already has a remote wallet, `mm init` syncs it and reuses the existing trading mode — no trading-mode prompt.++Otherwise, ask the user which wallet mode they want:+- `server-wallet` (recommended) — keys are hosted by MetaMask infrastructure. No need to manage private keys or mnemonics.+- `byok` — bring your own mnemonic. The user manages their own keys locally.++Ask the user which trading mode they want (server-wallet only):+- `guard` — enforces outflow and whitelist policies. When a policy is violated, the CLI requires MFA confirmation before proceeding.+- `beast` — skips all policy checks and confirmations. Useful for scripting or experienced users who want faster execution.++Server wallet:++```bash+mm init --wallet server-wallet --mode guard+```++BYOK:++Never pass `--mnemonic` or `--password` as inline flags. Always instruct the user to set environment variables instead.++```bash+export MM_MNEMONIC="word1 word2 ..."+mm init --wallet byok+```++If the user wants to encrypt their mnemonic with a password during init:++```bash+export MM_MNEMONIC="word1 word2 ..."+export MM_PASSWORD="mypassword"+mm init --wallet byok+```++If the mnemonic was stored unencrypted, suggest setting a password afterward:++```bash+mm wallet password set+```++Once the mnemonic is encrypted, all subsequent operations that need the private key require the `MM_PASSWORD` environment variable to be set. Never instruct the user to pass `--password` inline.++## Verify Auth Status++```bash+mm auth status+```++Confirm the session is authenticated, the wallet mode is correct, and the token is valid.++## Show Wallet Address++```bash+mm wallet address+```diff --git a/data/skills/metamask-agent-wallet/workflows/perps-close-position.md b/data/skills/metamask-agent-wallet/workflows/perps-close-position.mdnew file mode 100644index 000000000..8aa26ec13--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/perps-close-position.md@@ -0,0 +1,54 @@+# Perps Close Position Workflow++Use this workflow when the user wants to close a perpetual position.++Reference command syntax in `references/perps.md`.++## Flow++1. Check open positions.+2. Dry run the close.+3. Confirm with the user and close.++## Confirm Symbol++If the user does not mention a token symbol, list open positions and confirm with the user:++```bash+mm perps positions+```++## Check Positions++`--venue` defaults to `hyperliquid`. It can be omitted.++```bash+mm perps positions+```++## Dry Run++Preview the close before executing:++```bash+mm perps close --symbol BTC --dry-run+```++For partial close, include `--size <amount>`.++## Close++Remove `--dry-run` only after explicit user confirmation:++```bash+mm perps close --symbol BTC+mm perps close --symbol BTC --size 0.005+```++`--all` closes every open position. Require explicit confirmation that the user wants all positions closed.++```bash+mm perps close --all+```++Do not add `--yes` unless the user explicitly asked for unattended execution.diff --git a/data/skills/metamask-agent-wallet/workflows/perps-modify-position.md b/data/skills/metamask-agent-wallet/workflows/perps-modify-position.mdnew file mode 100644index 000000000..3f28f06c1--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/perps-modify-position.md@@ -0,0 +1,49 @@+# Perps Modify Position Workflow++Use this workflow when the user wants to modify leverage, take-profit, or stop-loss on an existing position.++Reference command syntax in `references/perps.md`.++## Flow++1. Check open positions.+2. Dry run the modification.+3. Confirm with the user and modify.++## Confirm Symbol++If the user does not mention a token symbol, list open positions and confirm with the user:++```bash+mm perps positions+```++## Check Positions++`--venue` defaults to `hyperliquid`. It can be omitted.++```bash+mm perps positions+```++## Dry Run++Preview the modification before executing:++```bash+mm perps modify --symbol BTC --leverage 10 --dry-run+mm perps modify --symbol ETH --tp 3000 --sl 2000 --dry-run+```++At least one of `--leverage`, `--tp`, or `--sl` must be provided.++## Modify++Remove `--dry-run` only after explicit user confirmation:++```bash+mm perps modify --symbol BTC --leverage 10+mm perps modify --symbol ETH --tp 3000 --sl 2000+```++Do not add `--yes` unless the user explicitly asked for unattended execution.diff --git a/data/skills/metamask-agent-wallet/workflows/perps-open-position.md b/data/skills/metamask-agent-wallet/workflows/perps-open-position.mdnew file mode 100644index 000000000..27123415e--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/perps-open-position.md@@ -0,0 +1,102 @@+# Perps open position workflow++Use this workflow when the user wants to open a new perpetual position.++Reference command syntax in `references/perps.md`.++## Flow++1. Check balance and deposit if needed.+2. Quote the position.+3. Dry run.+4. Confirm with the user and open.++## Confirm symbol++If the user doesn't mention a token symbol, list available markets and confirm with the user:++```bash+mm perps markets+```++## Check balance++`--venue` defaults to `hyperliquid`. You can omit it.++```bash+mm perps balance+```++If available margin is zero or insufficient, deposit USDC before proceeding. Hyperliquid only supports deposits from Arbitrum mainnet (`eip155:42161`).++Check the user's Arbitrum balance for USDC and ETH (for gas).++```bash+mm wallet balance --chain 42161+```++### No ETH and no USDC on Arbitrum++Inform the user that ETH on Arbitrum is required for gas. Without ETH, no on-chain transaction is possible. Bridge from another chain.++```bash+mm swap quote --from <TOKEN> --to ETH --amount 0.001 --from-chain <SOURCE_CHAIN_ID> --to-chain 42161+mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command+```++Once the user has ETH for gas, swap or bridge to get USDC on Arbitrum.++```bash+mm swap quote --from <TOKEN> --to USDC --amount <AMOUNT> --from-chain <SOURCE_CHAIN_ID> --to-chain 42161+mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command+```++### Has ETH or another token on Arbitrum (but no USDC)++Swap to USDC on Arbitrum.++```bash+mm swap quote --from <TOKEN> --to USDC --amount <AMOUNT> --from-chain 42161+mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command+```++### Has ETH and USDC on Arbitrum++Deposit USDC directly into Hyperliquid.++```bash+mm perps deposit --amount <AMOUNT> --asset USDC+```+++## Quote++Always quote before opening:++```bash+mm perps quote --symbol BTC --side long --size 0.01 --leverage 5+```++Show the user estimated entry, notional, fees, liquidation price, side, size, leverage, and venue before proceeding.++## Dry run++Preview the order before signing:++```bash+mm perps open --symbol BTC --side long --size 0.01 --leverage 5 --dry-run+```++For limit orders, include `--type limit --limit-px <price>`.++`--max-slippage-bps` is the slippage cap in basis points for IOC market pricing.++## Open++Remove `--dry-run` only after explicit user confirmation:++```bash+mm perps open --symbol BTC --side long --size 0.01 --leverage 5+```++Don't add `--yes` unless the user explicitly asked for unattended execution.diff --git a/data/skills/metamask-agent-wallet/workflows/predict-funding.md b/data/skills/metamask-agent-wallet/workflows/predict-funding.mdnew file mode 100644index 000000000..2236e8048--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/predict-funding.md@@ -0,0 +1,90 @@+# Predict funding workflow++Use this workflow to deposit or withdraw pUSD from the Predict deposit wallet.++Reference command syntax in `references/predict.md`.++## Flow++1. Check deposit wallet balance.+2. Deposit or withdraw.++## Check deposit wallet balance++```bash+mm predict balance --sync+```++## Deposit++If the user doesn't specify an amount, ask how much they want to deposit. Get the deposit wallet address from `mm predict status`, then check the user's Polygon balance.++```bash+mm wallet balance --chain 137+```++### Has POL and pUSD on Polygon++Use `mm transfer` to send pUSD directly to the deposit wallet address. No conversion needed. Get the pUSD contract address from `mm wallet balance --chain 137` output.++```bash+mm transfer --to <DEPOSIT_WALLET_ADDRESS> --amount <AMOUNT> --chain-id 137 --token <PUSD_CONTRACT_ADDRESS> --wait+```++Get the deposit wallet address from the `mm predict status` output.++### Has POL and USDC.e on Polygon++Run `mm predict deposit`. The CLI converts USDC.e to pUSD in the deposit wallet.++```bash+mm predict deposit --amount <AMOUNT> --wait+```++`--amount` is in USDC.e. The owner EOA needs enough USDC.e and POL for gas on Polygon.++### Has POL or another token on Polygon (but no USDC.e or pUSD)++Swap to pUSD on Polygon, then transfer directly to the deposit wallet. The owner EOA needs POL for gas.++```bash+mm swap quote --from <TOKEN> --to pUSD --amount <AMOUNT> --from-chain 137+mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command+```++After the swap completes, check the balance to verify pUSD arrived++```bash+mm wallet balance --chain 137+```++Get the pUSD contract address from the balance output, then transfer to the deposit wallet:++```bash+mm transfer --to <DEPOSIT_WALLET_ADDRESS> --amount <AMOUNT> --chain-id 137 --token <PUSD_CONTRACT_ADDRESS> --wait+```++Get the deposit wallet address from the `mm predict status` output.++### Has assets on another chain++Bridge to send pUSD directly to the deposit wallet address on Polygon.++```bash+mm swap quote --from <TOKEN> --to pUSD --amount <AMOUNT> --from-chain <SOURCE_CHAIN_ID> --to-chain 137 --to-address <DEPOSIT_WALLET_ADDRESS>+mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command+```++Get the deposit wallet address from the `mm predict status` output. This avoids the extra deposit step.+++## Withdraw++Withdraw pUSD from the deposit wallet to the owner EOA (default) or a specified address.++```bash+mm predict withdraw --amount <AMOUNT> --wait+mm predict withdraw --amount <AMOUNT> --to <RECIPIENT_ADDRESS> --wait+```++Confirm the amount and recipient with the user before executing. The CLI validates the amount against the on-chain deposit wallet balance before signing.diff --git a/data/skills/metamask-agent-wallet/workflows/predict-manage-orders.md b/data/skills/metamask-agent-wallet/workflows/predict-manage-orders.mdnew file mode 100644index 000000000..5fd10d749--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/predict-manage-orders.md@@ -0,0 +1,50 @@+# Predict manage orders workflow++Use this workflow to view, cancel, or manage open Predict orders and positions.++Reference command syntax in `references/predict.md`.++## View orders++```bash+mm predict orders+mm predict orders --market <CONDITION_ID>+```++## View positions++```bash+mm predict positions+mm predict positions --market <CONDITION_ID>+```++## Cancel orders++Cancel a single order:++```bash+mm predict cancel --order-id <ORDER_ID>+```++Cancel by market or asset:++```bash+mm predict cancel --market <CONDITION_ID>+mm predict cancel --asset <OUTCOME_TOKEN_ID>+```++Cancel all open orders:++```bash+mm predict cancel --all+```++`predict cancel --all` cancels every open order. Require explicit confirmation from the user before executing.++## Watch async jobs++```bash+mm predict watch --id <JOB_ID> --wait+```++Use this for setup, approve, deposit, withdraw, redeem, and order jobs that haven't reached a terminal state.diff --git a/data/skills/metamask-agent-wallet/workflows/predict-markets.md b/data/skills/metamask-agent-wallet/workflows/predict-markets.mdnew file mode 100644index 000000000..64d37e062--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/predict-markets.md@@ -0,0 +1,45 @@+# Predict markets workflow++Use this workflow to search, browse, and inspect prediction markets on Polymarket.++Reference command syntax in `references/predict.md`.++## Flow++1. Search or browse markets.+2. Inspect the selected market to get outcome token IDs.++## Search markets++```bash+mm predict markets search "Knicks NBA Finals" --limit 5 --toon+```++Search can return loosely related markets, so always inspect the selected market before quoting.++If search is noisy, list active markets and filter manually:++```bash+mm predict markets list --active --limit 50 --toon+```++## Browse by topic++Use events, series, and tags to browse by topic. Resolve a tag slug or ID first, then filter:++```bash+mm predict tags list --limit 50 --toon+mm predict events list --tag-slug sports --active --limit 10 --toon+mm predict events get <EVENT_SLUG_OR_ID> --toon+mm predict series list --recurrence weekly --limit 10 --toon+```++These browse commands don't return outcome token IDs. Drill into a specific market with `mm predict markets get` before quoting or placing.++## Inspect a market++```bash+mm predict markets get <MARKET_SLUG_OR_ID> --toon+```++The market detail prints outcome token IDs. Outcome token IDs aren't market IDs. Use the token ID for `quote`, `place`, `book`, and `balance --token-id`.diff --git a/data/skills/metamask-agent-wallet/workflows/predict-place-order.md b/data/skills/metamask-agent-wallet/workflows/predict-place-order.mdnew file mode 100644index 000000000..c5372a879--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/predict-place-order.md@@ -0,0 +1,72 @@+# Predict place order workflow++Use this workflow to quote and place a prediction market order.++Reference command syntax in `references/predict.md`.++## Flow++1. Check setup and balance.+2. Inspect the market to get the outcome token ID.+3. Quote the order.+4. Confirm with the user and place.++## Check setup and balance++Verify that Predict is fully set up and get the deposit wallet address:++```bash+mm predict status+```++Check `setupComplete` is `true`. If not, follow `predict-setup.md` to run first-time setup.++Then check the deposit wallet balance:++```bash+mm predict balance --sync+```++If the balance is zero or insufficient for the order, follow `predict-funding.md` to deposit funds. Use the deposit wallet address from `mm predict status` when funding.++## Get outcome token ID++If the user hasn't already identified the market, follow `predict-markets.md` to find and inspect it.++```bash+mm predict markets get <MARKET_SLUG_OR_ID> --toon+```++Map the user's intended outcome to the correct token ID from the market detail.++## Quote++Preview the order cost and fill before placing:++```bash+mm predict quote \+ --token-id <OUTCOME_TOKEN_ID> \+ --side buy --size 100 --limit-price 0.55+```++Show the user the estimated cost and fill.++## Place++After the user confirms token ID, outcome, side, size, price, and order type:++```bash+mm predict place \+ --token-id <OUTCOME_TOKEN_ID> \+ --side buy --size 100 --price 0.55 \+ --order-type GTC+```++`--order-type` is one of `GTC`, `GTD`, `FOK`, or `FAK`. `--post-only` only applies to GTC/GTD. `--expiration` is unix seconds for GTD.++## Safety notes++- Placing orders between a market's end date and its final UMA resolution carries major financial risk. Prices during this window don't reflect true odds and arbitrage strategies can fail if UMA resolves unexpectedly. If the order creation time is after the market end date but before UMA resolution, warn the user about potential financial loss and get explicit confirmation before proceeding.+- Prices are 0-1 floats. Treat `--price 1` as suspicious unless the user explicitly confirms.+- Trades are signed by the deposit wallet address from `mm predict status`, not the connected owner EOA.+- Always inspect the market to map the user's intended outcome to the correct token ID.diff --git a/data/skills/metamask-agent-wallet/workflows/predict-portfolio.md b/data/skills/metamask-agent-wallet/workflows/predict-portfolio.mdnew file mode 100644index 000000000..05357a2c1--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/predict-portfolio.md@@ -0,0 +1,35 @@+# Predict portfolio workflow++Use this workflow to view the Predict portfolio or redeem winning positions.++Reference command syntax in `references/predict.md`.++## View portfolio++Get a single snapshot of balance, open positions, and redeemable winnings:++```bash+mm predict portfolio --toon+```++## Redeem winnings++After a market resolves, list and claim winning positions:++```bash+mm predict redeem list --toon+```++Redeem a single position:++```bash+mm predict redeem <CONDITION_ID> --wait+```++Redeem all winning positions:++```bash+mm predict redeem --all --wait+```++`predict redeem --all` redeems every winning position. Confirm the target (condition ID or `--all`) with the user before executing. With `--wait`, the CLI polls for the redemption transaction receipt.diff --git a/data/skills/metamask-agent-wallet/workflows/predict-setup.md b/data/skills/metamask-agent-wallet/workflows/predict-setup.mdnew file mode 100644index 000000000..3aa29858c--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/predict-setup.md@@ -0,0 +1,54 @@+# Predict setup workflow++Use this workflow for first-time Predict setup, refreshing credentials, or repairing approvals.++Reference command syntax in `references/predict.md`.++## Flow++1. Choose Predict mode.+2. Run one-time setup.+3. Verify status.++## Choose mode++```bash+mm predict mode mainnet+```++Replace `mainnet` with `testnet` if the user wants to paper trade.++## Run setup++```bash+mm predict setup --wait+```++This blocks until credential, deposit-wallet, and approval jobs complete. Without `--wait`, track returned jobs with `mm predict watch --id <JOB_ID> --wait`.++The owner EOA needs POL on Polygon for gas to complete the setup transactions.++Polymarket is geoblocked in some regions. `predict setup` checks the caller's IP first and aborts with `PREDICT_GEOBLOCKED` before any wallet interaction if the region is restricted. To check region status independently:++```bash+mm predict geoblock+```++## Verify status++Confirm `setupComplete` is `true` and note the deposit wallet address:++```bash+mm predict status+```++## Refresh credentials or approvals++If credentials or approvals look stale later:++```bash+mm predict auth --refresh+mm predict approve --wait+```++Then verify with `mm predict status`.diff --git a/data/skills/metamask-agent-wallet/workflows/swap.md b/data/skills/metamask-agent-wallet/workflows/swap.mdnew file mode 100644index 000000000..dad35c482--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/swap.md@@ -0,0 +1,48 @@+# Swap workflow++Use this workflow when the user wants to swap tokens on the same chain.++Reference command syntax in `references/swap.md`.++## Flow++1. Quote.+2. Confirm with the user.+3. Execute and track status.++Don't skip the quote review step. The user needs to see output amount, fees, route, and slippage before executing.++## Quote++```bash+mm swap quote --from ETH --to USDC --amount 1 --from-chain 1+```++Required flags: `--from`, `--to`, `--amount`, and `--from-chain`.++`--to-address` isn't supported for same-chain swaps. Output always goes to the signer's wallet.++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.++## Execute++```bash+mm 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.++## Status++```bash+mm swap status --quote-id "$QUOTE_ID"+```++## Edge cases++- Quote expired: re-quote and ask the user to review the new quote.+- Insufficient balance: surface the error verbatim.+- Slippage exceeded: only increase `--slippage` if 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 chains list` before guessing a chain ID.diff --git a/data/skills/metamask-agent-wallet/workflows/troubleshooting.md b/data/skills/metamask-agent-wallet/workflows/troubleshooting.mdnew file mode 100644index 000000000..b0f09b7d6--- /dev/null+++ b/data/skills/metamask-agent-wallet/workflows/troubleshooting.md@@ -0,0 +1,45 @@+# Troubleshooting Workflow++Use this workflow when a command fails, hangs, prompts unexpectedly, or behaves differently in a terminal.++## Universal Triage++Run or suggest these in order:++```bash+mm --version+mm auth status+mm <failing-command> --help+```++If `auth status` reports anything other than authenticated, fix authentication before debugging downstream wallet, signing, swap, perps, or predict commands.++## Common Symptoms++| Symptom | Likely cause | Next step |+| --- | --- | --- |+| `mm: command not found` | Binary not installed or not on `PATH` | Check install and PATH |+| Async command returns a polling id and appears stuck | Request was dispatched without `--wait` | Use `mm wallet requests list` or `mm wallet requests watch --polling-id <id>` |+| Auth errors after previously working | Expired token | Check `mm auth status` and session file under `~/.metamask/` |+| `CHAIN_ID_MISMATCH` on typed data | Payload `domain.chainId` differs from `--chain-id` | Align the two chain IDs |+| `MNEMONIC_LOCKED` or `WRONG_PASSWORD` | BYOK mnemonic is encrypted and password was wrong or missing | Set the correct `MM_PASSWORD` environment variable and re-run |+| `ALREADY_ENCRYPTED` on `wallet password set` | Mnemonic already has a password | Use `mm wallet password change` instead |+| `NOT_ENCRYPTED` on `wallet password change/remove` | Mnemonic is not encrypted | Use `mm wallet password set` instead |++## Verbose Logging++Use `--verbose` when a command appears to hang or hides progress:++```bash+mm wallet balance --json --verbose+```++Structured logs and progress lines go to stderr; command results remain on stdout.++## Error Codes++For raw error-code meanings, load `../references/errors.md`. Relay CLI errors verbatim before explaining them.++## Reset Last++Use `mm reset` only after checking version, auth status, and the failing command's help output. Reset clears local session state and should not be the first troubleshooting step. Always ask the user for explicit confirmation before running reset.diff --git a/data/skills/metamask-agent-workflows b/data/skills/metamask-agent-workflowsdeleted file mode 120000index b3a58bb4f..000000000--- a/data/skills/metamask-agent-workflows+++ /dev/null@@ -1 +0,0 @@-../../.agents/skills/metamask-agent-workflows\ No newline at end of filediff --git a/data/skills/metamask-agent-workflows/SKILL.md b/data/skills/metamask-agent-workflows/SKILL.mdnew file mode 100644index 000000000..ab4962ffe--- /dev/null+++ b/data/skills/metamask-agent-workflows/SKILL.md@@ -0,0 +1,84 @@+---+name: metamask-agent-workflows+description: Use when the user needs to perform multi-step operations with the MetaMask Agentic CLI such as onboarding, login, swapping tokens, bridging across chains, opening/closing/modifying perpetual positions, prediction market trading, Aave V3 lending and borrowing, or troubleshooting CLI issues.+license: MIT+metadata:+ author: metamask+ version: "2.1.0"+ cliVersion: "1.0.0"+---++# MetaMask Agent Workflows++Repeatable multi-step patterns for the `mm` CLI. Load a workflow file when the user's request is a pattern, not a single command.++## Workflow Routing++| Pattern | Workflow |+| --- | --- |+| First time setup and onboarding | [onboarding.md](workflows/onboarding.md) |+| Login flow | [login.md](workflows/login.md) |+| Troubleshooting decision tree | [troubleshooting.md](workflows/troubleshooting.md) |+| Swap quote-review-execute flow | [swap.md](workflows/swap.md) |+| Bridge quote-review-execute flow | [bridge.md](workflows/bridge.md) |+| Open a perpetual position flow | [perps-open-position.md](workflows/perps-open-position.md) |+| Close a perpetual position flow | [perps-close-position.md](workflows/perps-close-position.md) |+| Modify a perpetual position flow | [perps-modify-position.md](workflows/perps-modify-position.md) |+| Predict first-time setup and credentials | [predict-setup.md](workflows/predict-setup.md) |+| Deposit or withdraw pUSD from Predict wallet | [predict-funding.md](workflows/predict-funding.md) |+| Search and browse prediction markets | [predict-markets.md](workflows/predict-markets.md) |+| Quote and place a prediction order | [predict-place-order.md](workflows/predict-place-order.md) |+| View or cancel Predict orders and positions | [predict-manage-orders.md](workflows/predict-manage-orders.md) |+| View Predict portfolio and redeem winnings | [predict-portfolio.md](workflows/predict-portfolio.md) |+| Token discovery, prices, and market data | [market-data.md](workflows/market-data.md) |+| Supply assets to Aave V3 | [aave-supply.md](workflows/aave-supply.md) |+| Withdraw assets from Aave V3 | [aave-withdraw.md](workflows/aave-withdraw.md) |+| Borrow from Aave V3 | [aave-borrow.md](workflows/aave-borrow.md) |+| Repay Aave V3 debt | [aave-repay.md](workflows/aave-repay.md) |+| Toggle Aave V3 collateral | [aave-collateral.md](workflows/aave-collateral.md) |+| Check Aave V3 positions and health factor | [aave-positions.md](workflows/aave-positions.md) |+| Discover Aave V3 tokens, rates, and liquidity | [aave-markets.md](workflows/aave-markets.md) |++Always use `--toon` for command output unless the user explicitly requests a different format.++## Preflight++Run these checks before the first CLI operation in a session, in order.++### 1. Version compatibility++This skill is written for `@metamask/agentic-cli` **v1.0.0** (see `cliVersion` in the frontmatter). Check the installed version:++```bash+mm --version+```++The installed version is the value after `@metamask/agentic-cli/` (e.g. `@metamask/agentic-cli/1.0.0 darwin-arm64 node-v24.14.1`). Compare its `major.minor` against the pinned `cliVersion`. Optionally check the latest published version (best-effort; skip silently on network failure):++```bash+npm view @metamask/agentic-cli version+```++If the installed `major.minor` differs from the pinned `cliVersion`, or the installed version is behind the latest release, warn the user once and continue:++> Version mismatch: installed CLI `<installed>`, this skill is pinned to `1.0.0`, latest release is `<latest>`. Command syntax in this skill may be inaccurate until they are aligned. Update the CLI with `npm install -g @metamask/agentic-cli@latest`, then re-install the skills with `npx skills add metaMask/agent-skills`.++Run this check once per session. Do not block operations on it.++### 2. Authentication++```bash+mm auth status+```++If the user is not authenticated, follow `workflows/onboarding.md` for first time setup, or `workflows/login.md` for login.++## Command Discovery++Before constructing any command, run `mm <command> --help` to confirm the exact flags, syntax, and defaults. Do not guess flags from memory.++## Output Rules++- Route silently. Do not announce which workflow you are loading.+- Surface errors from commands verbatim. Do not mask or reword them.+- If a command fails, check `mm <command> --help` and guide from there.diff --git a/data/skills/metamask-agent-workflows/scripts/amount_to_hex.py b/data/skills/metamask-agent-workflows/scripts/amount_to_hex.pynew file mode 100644index 000000000..fe18b7b97--- /dev/null+++ b/data/skills/metamask-agent-workflows/scripts/amount_to_hex.py@@ -0,0 +1,23 @@+#!/usr/bin/env python3+"""Convert a human-readable token amount to 0x-prefixed hex for EVM calldata.++Usage:+ python3 amount_to_hex.py <amount> <decimals>++Examples:+ python3 amount_to_hex.py 1.5 18 # 1.5 ETH -> 0x14d1120d7b160000+ python3 amount_to_hex.py 100 6 # 100 USDC -> 0x5f5e100+ python3 amount_to_hex.py 0.001 8 # 0.001 WBTC -> 0x186a0+"""++import sys+from decimal import Decimal++if len(sys.argv) != 3:+ print(f"Usage: {sys.argv[0]} <amount> <decimals>", file=sys.stderr)+ sys.exit(1)++decimals = int(sys.argv[2])+value = int(Decimal(sys.argv[1]) * 10 ** decimals)++print(hex(value))diff --git a/data/skills/metamask-agent-workflows/workflows/aave-borrow.md b/data/skills/metamask-agent-workflows/workflows/aave-borrow.mdnew file mode 100644index 000000000..08372dc35--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/aave-borrow.md@@ -0,0 +1,81 @@+# Aave V3 borrow workflow++Use this workflow to borrow assets from Aave V3 against supplied collateral.++## Flow++1. Resolve chain, asset address, and pool address.+2. Check collateral and borrow capacity.+3. Preview health factor impact.+4. Query the Aave API for the borrow transaction and execute.++## Resolve chain and addresses++If the user doesn't specify a chain, ask. Look up the pool address:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++## Check collateral++Before borrowing, check the user's positions using `aave-positions.md`. Verify the following.++1. The user has supplied collateral. If not, follow `aave-supply.md` to supply assets first.+2. Collateral is enabled on at least one supplied asset (`isCollateral` is `true`). If not, follow `aave-collateral.md` to enable it.+3. Available borrow capacity covers the requested amount.++Query available markets to check the target asset's borrow APY and whether `borrowCapReached` is `true`. See `aave-markets.md`.++## Preview health factor++Preview the health factor impact before borrowing:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ healthFactorPreview(request: { action: { borrow: { market: \"<POOL_ADDRESS>\", sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID>, amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: \"<AMOUNT>\" } } } } }) { before after } }"+ }'+```++Show the health factor before and after. If the projected health factor (`after`) drops below 1.5, warn about liquidation risk. If it drops below 1.0, stop and tell the user to reduce the borrow amount or repay existing debt.++## Query borrow transaction++Get the wallet address and query the Aave V3 GraphQL API. Don't include `onBehalfOf` when borrowing for the user's own account. It triggers a credit delegation requirement even for self-borrows.++```bash+mm wallet address+```++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ borrow(request: { market: \"<POOL_ADDRESS>\", amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: \"<AMOUNT>\" } }, sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID> }) { __typename ... on TransactionRequest { to from data value chainId } ... on ApprovalRequired { approval { to from data value chainId } originalTransaction { to from data value chainId } } ... on InsufficientBalanceError { required { value decimals } available { value decimals } } } }"+ }'+```++The `value` in the amount is a human-readable decimal string (e.g., `"2"`, `"100"`). The API handles conversion.++## Execute borrow++Confirm the asset, amount, chain, and projected health factor with the user. The `value` field must be `0x`-prefixed hex (typically `"0x0"` for ERC-20 borrows).++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<TO>","value":"0x0","data":"<DATA>"}' --wait --intent "Borrow <AMOUNT> <SYMBOL> from Aave V3 on <CHAIN_NAME>"+```++If the response is `InsufficientBalanceError`, show the required and available amounts and stop.++## Notes++- After the transaction confirms, use `aave-positions.md` to verify the updated position and health factor.+- The borrowed amount accrues interest over time. Check debt at any time using `aave-positions.md`.+- To repay the borrow, see `aave-repay.md`.diff --git a/data/skills/metamask-agent-workflows/workflows/aave-collateral.md b/data/skills/metamask-agent-workflows/workflows/aave-collateral.mdnew file mode 100644index 000000000..70df58406--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/aave-collateral.md@@ -0,0 +1,64 @@+# Aave V3 collateral workflow++Use this workflow to enable or disable an asset as collateral on Aave V3.++## Flow++1. Resolve chain, asset address, and pool address.+2. Check current collateral status and health factor.+3. Query the Aave API for the collateral toggle transaction.+4. Execute toggle.++## Resolve chain and addresses++If the user doesn't specify a chain, ask. Look up the pool address:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++## Check status++Query the user's positions using `aave-positions.md`. For the target asset, check whether collateral is enabled or disabled (`isCollateral`).++The user must have a non-zero supply of the asset to toggle collateral.++When disabling collateral, check the health factor. If the user has outstanding borrows, disabling collateral lowers the health factor. Show the impact. If the health factor would drop below 1.0, stop and tell the user to repay debt first via `aave-repay.md`.++## Query collateral toggle transaction++Get the wallet address and query the Aave V3 GraphQL API:++```bash+mm wallet address+```++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ collateralToggle(request: { market: \"<POOL_ADDRESS>\", underlyingToken: \"<ASSET_ADDRESS>\", user: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID> }) { to from data value chainId } }"+ }'+```++The API returns a `TransactionRequest` with `{to, from, data, value, chainId}`. The toggle direction is determined automatically based on the current collateral state.++## Execute toggle++Confirm the asset, toggle direction (enabling or disabling), and chain with the user. The `value` field must be `0x`-prefixed hex.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<TO>","value":"0x0","data":"<DATA>"}' --wait --intent "Toggle <SYMBOL> as collateral on Aave V3 on <CHAIN_NAME>"+```++## Notes++- Enabling collateral lets the asset back borrows, increasing borrow capacity.+- Disabling collateral removes it from the borrow calculation. This may trigger liquidation if remaining collateral can't cover existing debt.+- Not all assets support collateral usage. If the transaction reverts, the reserve may not be eligible.+- After the transaction confirms, verify the updated status using `aave-positions.md`.diff --git a/data/skills/metamask-agent-workflows/workflows/aave-markets.md b/data/skills/metamask-agent-workflows/workflows/aave-markets.mdnew file mode 100644index 000000000..4b791c40f--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/aave-markets.md@@ -0,0 +1,46 @@+# Aave V3 markets workflow++Use this workflow to discover available Aave V3 tokens, supply/borrow rates, and borrowing capacity on a chain.++## Flow++1. Resolve chain.+2. Query available markets.+3. Present results.++## Resolve chain++If the user doesn't specify a chain, ask. Aave V3 is deployed on these chains:++| Chain | Chain ID |+| --- | --- |+| Ethereum | 1 |+| Polygon | 137 |+| Arbitrum | 42161 |+| Optimism | 10 |+| Avalanche | 43114 |+| Base | 8453 |++## Query available markets++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ markets(request: { chainIds: [<CHAIN_ID>] }) { reserves { underlyingToken { symbol decimals } supplyInfo { apy { formatted } } borrowInfo { apy { formatted } availableLiquidity { amount { value } usd } borrowCapReached } isFrozen isPaused } } }"+ }'+```++## Present results++Filter out reserves where `isFrozen` or `isPaused` is `true`. For each active reserve, show:++- Token symbol and decimals (`underlyingToken.symbol`, `underlyingToken.decimals`)+- Supply APY (`supplyInfo.apy.formatted`)+- Borrow APY (`borrowInfo.apy.formatted`)+- Available liquidity (`borrowInfo.availableLiquidity.amount.value`, `borrowInfo.availableLiquidity.usd`)+- Borrow cap reached (`borrowInfo.borrowCapReached`)++The `apy.formatted` field returns a percentage directly (e.g., `"2.12"` means 2.12%). No conversion is needed.++If `borrowCapReached` is `true`, tell the user that borrowing isn't available for that asset.diff --git a/data/skills/metamask-agent-workflows/workflows/aave-positions.md b/data/skills/metamask-agent-workflows/workflows/aave-positions.mdnew file mode 100644index 000000000..cae93a2fe--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/aave-positions.md@@ -0,0 +1,72 @@+# Aave V3 positions workflow++Use this workflow to check Aave V3 positions, health factor, interest rates, or reserve data.++## Flow++1. Get wallet address and chain.+2. Query supply and borrow positions via GraphQL.+3. Present summary.++## Resolve chain++Get the wallet address:++```bash+mm wallet address+```++If the user doesn't specify a chain, ask. Aave V3 is deployed on these chains:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++## Query positions++Query supply and borrow positions in a single request:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ userSupplies(request: { markets: [{ address: \"<POOL_ADDRESS>\", chainId: <CHAIN_ID> }], user: \"<WALLET_ADDRESS>\" }) { currency { symbol decimals } balance { amount { value } usd } apy { formatted } isCollateral } userBorrows(request: { markets: [{ address: \"<POOL_ADDRESS>\", chainId: <CHAIN_ID> }], user: \"<WALLET_ADDRESS>\" }) { currency { symbol decimals } debt { amount { value } usd } apy { formatted } } }"+ }'+```++The response contains both `userSupplies` and `userBorrows` arrays.++## Health factor preview++Preview the health factor impact of a planned operation:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ healthFactorPreview(request: { action: { <OPERATION>: { market: \"<POOL_ADDRESS>\", sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID>, amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: \"<AMOUNT>\" } } } } }) { before after } }"+ }'+```++Replace `<OPERATION>` with `supply`, `borrow`, `withdraw`, or `repay`. All action types require `market`, `sender`, and `chainId`.++## Present summary++Format the data into three sections:++Supplied assets:+- Symbol, balance (`balance.amount.value`), USD value (`balance.usd`), supply APY (`apy.formatted`), used as collateral (`isCollateral`)++Borrowed assets:+- Symbol, debt amount (`debt.amount.value`), USD value (`debt.usd`), borrow APY (`apy.formatted`)++Account summary:+- Total collateral value, total debt value, available borrows, health factor+- Health factor guidance: above 2.0 is safe, 1.5–2.0 is moderate, 1.0–1.5 is risky and approaching liquidation, below 1.0 is liquidatable++The `apy.formatted` field returns a percentage directly (e.g., `"2.12"` means 2.12%). No conversion is needed.\ No newline at end of filediff --git a/data/skills/metamask-agent-workflows/workflows/aave-repay.md b/data/skills/metamask-agent-workflows/workflows/aave-repay.mdnew file mode 100644index 000000000..ac458a62f--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/aave-repay.md@@ -0,0 +1,101 @@+# Aave V3 repay workflow++Use this workflow to repay borrowed assets on Aave V3.++## Flow++1. Resolve chain, asset address, and pool address.+2. Check outstanding debt.+3. Query the Aave API for the repay transaction.+4. Handle approval if required, then repay.++## Resolve chain and addresses++If the user doesn't specify a chain, ask. Look up the pool address:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++## Check debt++Query the user's outstanding debt using `userBorrows` from `aave-positions.md`. Identify the following.++- The asset being repaid and its contract address+- Current debt amount (`debt.amount.value`)+- Current borrow APY (`apy.formatted`)++Show the debt amount and current rate.++## Query repay transaction++Get the wallet address and query the Aave V3 GraphQL API:++```bash+mm wallet address+```++For a specific repayment amount:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ repay(request: { market: \"<POOL_ADDRESS>\", amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: { exact: \"<AMOUNT>\" } } }, sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID> }) { __typename ... on TransactionRequest { to from data value chainId } ... on ApprovalRequired { reason requiredAmount { value decimals } currentAllowance { value decimals } approval { to from data value chainId } originalTransaction { to from data value chainId } } ... on InsufficientBalanceError { required { value decimals } available { value decimals } } } }"+ }'+```++To repay the full debt, use `{ max: true }` instead of `{ exact: \"<AMOUNT>\" }` in the value field. This lets the contract calculate the exact outstanding debt at execution time, including accrued interest.++You can't use `{ max: true }` when `onBehalfOf` is set in the request. If repaying on behalf of another address, specify the exact repayment amount. Query the current debt via `userBorrows` and add a small buffer (e.g., 0.5%) to account for interest accrued between query and execution.++## Handle response++The API returns one of three response types:++### `TransactionRequest`++The transaction is ready to send. Confirm with the user, then send. The `value` field must be `0x`-prefixed hex (typically `"0x0"` for ERC-20 repayments).++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<TO>","value":"0x0","data":"<DATA>"}' --wait --intent "Repay <AMOUNT> <SYMBOL> on Aave V3 on <CHAIN_NAME>"+```++### `ApprovalRequired`++An ERC-20 approval is needed before repayment. Confirm the token being approved, the spender, and the amount with the user. Then send the approval.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<APPROVAL_TO>","value":"0x0","data":"<APPROVAL_DATA>"}' --wait --intent "Approve <AMOUNT> <SYMBOL> for Aave V3 Pool <POOL_ADDRESS> on <CHAIN_NAME>"+```++After the approval confirms, send the original repay transaction.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<ORIGINAL_TX_TO>","value":"0x0","data":"<ORIGINAL_TX_DATA>"}' --wait --intent "Repay <AMOUNT> <SYMBOL> on Aave V3 on <CHAIN_NAME>"+```++ERC-20 approvals are consumed by the repay transaction. If the user approved an exact amount and needs to repay again (e.g., for remaining dust debt), a new approval is required. Consider approving slightly more than the debt amount to avoid this.++### `InsufficientBalanceError`++The user doesn't have enough tokens to repay. Show the required and available amounts, then stop.++## Handling dust debt++Interest accrues continuously between borrow and repay transactions. When repaying an exact amount equal to the original borrow, a small "dust" debt remains.++To handle this:+1. Use `{ max: true }` (only works without `onBehalfOf`) to let the contract calculate the exact outstanding debt at execution time.+2. Over-repay slightly: query the current debt via `userBorrows`, then repay with the debt amount plus a small buffer (e.g., 0.5%). The contract only deducts the actual debt and refunds the excess.+3. Acquire more tokens: if the wallet balance equals the exact original borrow amount, acquire slightly more of the token to cover interest.++## Notes++- After the transaction confirms, use `aave-positions.md` to verify the debt is cleared or reduced.+- All debt (including dust amounts) must be cleared before a full collateral withdrawal. See `aave-withdraw.md`.diff --git a/data/skills/metamask-agent-workflows/workflows/aave-supply.md b/data/skills/metamask-agent-workflows/workflows/aave-supply.mdnew file mode 100644index 000000000..1e914d2b2--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/aave-supply.md@@ -0,0 +1,100 @@+# Aave V3 supply workflow++Use this workflow to supply (deposit) assets into Aave V3 and earn interest.++## Flow++1. Resolve chain, asset address, and pool address.+2. Check wallet balance.+3. Query the Aave API for the supply transaction.+4. Handle approval if required, then supply.++## Resolve chain and addresses++If the user doesn't specify a chain, ask. Look up the pool address:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++Resolve the asset's contract address on the target chain. If the user provides a symbol instead of an address, run `mm token list search --query <SYMBOL> --chain <CHAIN_ID>`.++Aave V3 doesn't accept native ETH on most markets. If the reserve accepts native tokens, use `native` instead of `erc20` in the GraphQL request.++## Check balance++Check that the user has sufficient funds:++```bash+mm wallet balance --chain <CHAIN_ID>+```++If the user doesn't have enough of the supply token or native gas token, check balances on other chains. If the user has assets on the same chain, prompt them to swap. If the user has assets on another chain, prompt them to bridge to the target chain before proceeding.++## Query supply transaction++Get the wallet address and query the Aave V3 GraphQL API for the supply execution plan:++```bash+mm wallet address+```++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ supply(request: { market: \"<POOL_ADDRESS>\", amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: \"<AMOUNT>\" } }, sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID> }) { __typename ... on TransactionRequest { to from data value chainId } ... on ApprovalRequired { reason requiredAmount { value decimals } currentAllowance { value decimals } approval { to from data value chainId } originalTransaction { to from data value chainId } } ... on InsufficientBalanceError { required { value decimals } available { value decimals } } } }"+ }'+```++The `value` in the amount is a human-readable decimal string (e.g., `"42"`, `"0.5"`). The API handles decimal-to-wei conversion.++## Handle response++The API returns one of three response types:++### `TransactionRequest`++The transaction is ready to send. Confirm with the user, then send.++The `value` field in the transaction payload must be `0x`-prefixed hex. For ERC-20 supplies, this is `"0x0"`. For native token supplies, convert the amount to hex using the helper script:++```bash+python3 scripts/amount_to_hex.py <AMOUNT> <DECIMALS>+```++If python3 isn't available, multiply the amount by `10^decimals` manually and convert the result to hex.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<TO>","value":"0x0","data":"<DATA>"}' --wait --intent "Supply <AMOUNT> <SYMBOL> to Aave V3 on <CHAIN_NAME>"+```++### `ApprovalRequired`++An ERC-20 approval is needed before supply. Confirm the token being approved, the spender, and the amount with the user. Then send the approval.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<APPROVAL_TO>","value":"0x0","data":"<APPROVAL_DATA>"}' --wait --intent "Approve <AMOUNT> <SYMBOL> for Aave V3 Pool <POOL_ADDRESS> on <CHAIN_NAME>"+```++After the approval confirms, send the original supply transaction.++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<ORIGINAL_TX_TO>","value":"0x0","data":"<ORIGINAL_TX_DATA>"}' --wait --intent "Supply <AMOUNT> <SYMBOL> to Aave V3 on <CHAIN_NAME>"+```++Security note: The Aave API returns `max uint256` (unlimited) as the default approval amount. Tell the user. For better security, construct a limited approval by encoding `approve(address,uint256)` calldata (selector `0x095ea7b3`) with the exact supply amount instead of using the API-provided approval transaction.++### `InsufficientBalanceError`++The user doesn't have enough tokens. Show the required and available amounts, then stop.++## Notes++- After the transaction confirms, the user receives aTokens representing their deposit. Use `aave-positions.md` to verify the updated position.+- To check current supply rates before supplying, see `aave-positions.md`.diff --git a/data/skills/metamask-agent-workflows/workflows/aave-withdraw.md b/data/skills/metamask-agent-workflows/workflows/aave-withdraw.mdnew file mode 100644index 000000000..d8ebde886--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/aave-withdraw.md@@ -0,0 +1,76 @@+# Aave V3 withdraw workflow++Use this workflow to withdraw supplied assets from Aave V3.++## Flow++1. Resolve chain, asset address, and pool address.+2. Check positions and health factor.+3. Query the Aave API for the withdraw transaction.+4. Execute withdrawal.++## Resolve chain and addresses++If the user doesn't specify a chain, ask. Look up the pool address:++| Chain | Chain ID | Pool address |+| --- | --- | --- |+| Ethereum | 1 | `0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2` |+| Polygon | 137 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Arbitrum | 42161 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Optimism | 10 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Avalanche | 43114 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |+| Base | 8453 | `0x794a61358D6845594F94dc1DB02A252b5b4814aD` |++## Check positions++Check the user's current positions using `aave-positions.md`. Confirm the asset and available balance.++Before a full withdrawal, query `userBorrows` and verify there's no outstanding debt. A full collateral withdrawal fails if any debt exists, even tiny "dust" amounts. The transaction reverts with error `0x6679996d`. Follow `aave-repay.md` to clear all debt first.++For a partial withdrawal with outstanding borrows, preview the health factor impact:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ healthFactorPreview(request: { action: { withdraw: { market: \"<POOL_ADDRESS>\", sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID>, amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: { exact: \"<AMOUNT>\" } } } } } }) { before after } }"+ }'+```++If the projected health factor (`after`) drops below 1.5, warn about liquidation risk. If it drops below 1.0, stop and tell the user to repay debt first.++## Query withdraw transaction++Get the wallet address and query the Aave V3 GraphQL API:++```bash+mm wallet address+```++For a specific amount:++```bash+curl -s -X POST https://api.v3.aave.com/graphql \+ -H 'Content-Type: application/json' \+ -d '{+ "query": "{ withdraw(request: { market: \"<POOL_ADDRESS>\", amount: { erc20: { currency: \"<ASSET_ADDRESS>\", value: { exact: \"<AMOUNT>\" } } }, sender: \"<WALLET_ADDRESS>\", chainId: <CHAIN_ID> }) { __typename ... on TransactionRequest { to from data value chainId } ... on ApprovalRequired { approval { to from data value chainId } originalTransaction { to from data value chainId } } ... on InsufficientBalanceError { required { value decimals } available { value decimals } } } }"+ }'+```++To withdraw the full balance, use `{ max: true }` instead of `{ exact: \"<AMOUNT>\" }` in the value field.++## Execute withdrawal++Confirm the asset, amount (or "full balance"), destination, and chain with the user. The `value` field must be `0x`-prefixed hex (typically `"0x0"` for ERC-20 withdrawals).++```bash+mm wallet send-transaction --chain-id <CHAIN_ID> --payload '{"to":"<TO>","value":"0x0","data":"<DATA>"}' --wait --intent "Withdraw <AMOUNT> <SYMBOL> from Aave V3 on <CHAIN_NAME>"+```++If the response is `ApprovalRequired`, send the approval transaction first, then the withdrawal transaction (same pattern as `aave-supply.md`).++## Notes++- After the transaction confirms, use `aave-positions.md` to verify the updated position.+- Add a `recipient` field to the request to withdraw to a different address than the sender.diff --git a/data/skills/metamask-agent-workflows/workflows/bridge.md b/data/skills/metamask-agent-workflows/workflows/bridge.mdnew file mode 100644index 000000000..a21133c7e--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/bridge.md@@ -0,0 +1,55 @@+# Bridge workflow++Use this workflow when the user wants to bridge tokens across chains.++Reference command syntax in `references/swap.md`. The CLI uses the same `swap` commands for bridging — set `--to-chain` to a different chain than `--from-chain`.++## Flow++1. Quote.+2. Confirm with the user.+3. Execute and track status.++Don't skip the quote review step. The user needs to see output amount, fees, route, and slippage before executing.++## Quote++```bash+mm swap quote --from ETH --to USDC --amount 1 --from-chain 1 --to-chain 137 --slippage 0.5+```++Required flags: `--from`, `--to`, `--amount`, `--from-chain`, and `--to-chain`.++If the user wants the bridged tokens sent to a different wallet on the destination chain, add `--to-address`:++```bash+mm swap quote --from ETH --to USDC --amount 1 --from-chain 1 --to-chain 137 --to-address 0x742d...f2bD18+```++Persist the quote id for execution. Show the quote to the user before execution.+Confirm source token, destination token, amount, source chain, destination chain, slippage, expected output, fees, route, and recipient address (if `--to-address` was set).++## Execute++```bash+mm 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.++## Status++```bash+mm swap status --quote-id "QUOTE_ID"+mm swap status --quote-id "QUOTE_ID" --tx-hash 0xabc123+```++Use status polling for bridges where the destination side can lag behind the source transaction.++## Edge cases++- Quote expired: re-quote and ask the user to review the new quote.+- Insufficient balance: surface the error verbatim.+- Slippage exceeded: only increase `--slippage` if 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 chains list` before guessing a chain ID.diff --git a/data/skills/metamask-agent-workflows/workflows/login.md b/data/skills/metamask-agent-workflows/workflows/login.mdnew file mode 100644index 000000000..fcf689aca--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/login.md@@ -0,0 +1,38 @@+# Login Workflow++Use this workflow when the user needs to log in to the CLI.++Reference command syntax in `references/auth.md`.++## Flow++1. Ask the user which login method they want: MetaMask Mobile QR, Google, or Email.+2. Execute login.+3. Verify with token.++## Login++For non-interactive/CI flows, use Google or email with `--no-wait`:++```bash+mm login google --no-wait+mm login email --no-wait+```++The command prints a sign-in URL.++`mm login qr` (scan with MetaMask Mobile) is available on non-production builds (dev/uat); on production it returns `COMING_SOON`. QR login keeps the CLI attached to the relay, so it does not support `--no-wait`.++## Verify++Once the user completes sign-in, verify with:++```bash+mm login --token "<TOKEN>"+```++## Confirm++```bash+mm auth status+```diff --git a/data/skills/metamask-agent-workflows/workflows/market-data.md b/data/skills/metamask-agent-workflows/workflows/market-data.mdnew file mode 100644index 000000000..872563ad6--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/market-data.md@@ -0,0 +1,62 @@+# Market Data Workflow++Use this workflow when the user wants to look up token prices, discover tokens, or explore market data.++Reference command syntax in `references/market-data.md`.++## Find a Token++If the user mentions a token by name or symbol, search for it first to get the correct asset ID:++```bash+mm token list search --query "USDC" --chain 1+```++To browse popular, trending, or top-gainer tokens on a chain:++```bash+mm token list popular --chain 1+mm token list trending --chain 1+mm token list top-gainer --chain 1+```++Use `mm token networks` to discover which chains support token data.++## Get Token Metadata++Once you have the CAIP-19 asset ID, fetch detailed metadata:++```bash+mm token assets --asset-ids "eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" --include-market-data --include-token-security-data+```++## Get Spot Price++Fetch the current price for one or more tokens:++```bash+mm price spot --asset-ids "eip155:1/slip44:60"+mm price spot --asset-ids "eip155:1/slip44:60,eip155:137/slip44:966" --vs eur --market-data+```++Use `mm price networks` to discover supported CAIP-2 chain IDs and `mm price currencies` to list quote currencies.++## Get Historical Price++Fetch historical price data for an asset:++```bash+mm price history --chain-id eip155:1 --asset-type slip44:60 --time-period 7d --interval daily+```++Common time periods: `1d`, `7d`, `30d`, `2M`, `1y`, `3y`. Intervals: `5m`, `hourly`, `daily`.++For a custom date range, use `--from` and `--to` with Unix timestamps instead of `--time-period`.++## Edge Cases++- If the chain is not mentioned by the user, ask for the chain.+- Use `mm chains list` to discover supported chain IDs.+- If a token search returns no results, try broader chains or alternate names.+- CAIP-19 asset IDs follow the format `eip155:<chainId>/slip44:<coinType>` for native tokens or `eip155:<chainId>/erc20:<contractAddress>` for ERC-20s.+- Use `--include-token-security-data` on `token assets` to surface scam or risk signals before the user trades an unfamiliar token.diff --git a/data/skills/metamask-agent-workflows/workflows/onboarding.md b/data/skills/metamask-agent-workflows/workflows/onboarding.mdnew file mode 100644index 000000000..e479be529--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/onboarding.md@@ -0,0 +1,109 @@+# Onboarding Workflow++Use this workflow when the user is setting up the MetaMask Agentic CLI for the first time.++Reference command syntax in `references/auth.md` and `references/wallet.md`.++## Flow++1. Check CLI installation.+2. Login.+3. Initialize wallet mode.+4. Verify auth status.+5. Show wallet address.++## Check CLI Installation++```bash+mm --version+```++If this fails, the CLI is not installed. Guide the user to install it with `npm install -g @metamask/agentic-cli@latest` before proceeding.++Then run the version compatibility check from the skill `Preflight` section: compare the installed `major.minor` against the pinned `cliVersion` and the latest published release, and warn the user if they are out of sync.++## Login Flow++Ask the user which login method they want to use: MetaMask Mobile QR, Google, or Email. QR (`mm login qr`) is available on non-production builds (dev/uat); on production it returns `COMING_SOON`, so fall back to Google or email there.++### Login++```bash+mm login google --no-wait+mm login email --no-wait+```++Use `--no-wait` for non-interactive environments. The command prints a sign-in URL.++### Verify++Once the user completes sign-in, verify with:++```bash+mm login --token "<TOKEN>"+```++## Initialize Project++First check if the project is already initialized:++```bash+mm init show+```++If already initialized, skip this step.++For server-wallet mode, if the account already has a remote wallet, `mm init` syncs it and reuses the existing trading mode — no trading-mode prompt.++Otherwise, ask the user which wallet mode they want:+- `server-wallet` (recommended) — keys are hosted by MetaMask infrastructure. No need to manage private keys or mnemonics.+- `byok` — bring your own mnemonic. The user manages their own keys locally.++Ask the user which trading mode they want (server-wallet only):+- `guard` — enforces outflow and whitelist policies. When a policy is violated, the CLI requires MFA confirmation before proceeding.+- `beast` — skips all policy checks and confirmations. Useful for scripting or experienced users who want faster execution.++Server wallet:++```bash+mm init --wallet server-wallet --mode guard+```++BYOK:++Never pass `--mnemonic` or `--password` as inline flags. Always instruct the user to set environment variables instead.++```bash+export MM_MNEMONIC="word1 word2 ..."+mm init --wallet byok+```++If the user wants to encrypt their mnemonic with a password during init:++```bash+export MM_MNEMONIC="word1 word2 ..."+export MM_PASSWORD="mypassword"+mm init --wallet byok+```++If the mnemonic was stored unencrypted, suggest setting a password afterward:++```bash+mm wallet password set+```++Once the mnemonic is encrypted, all subsequent operations that need the private key require the `MM_PASSWORD` environment variable to be set. Never instruct the user to pass `--password` inline.++## Verify Auth Status++```bash+mm auth status+```++Confirm the session is authenticated, the wallet mode is correct, and the token is valid.++## Show Wallet Address++```bash+mm wallet address+```diff --git a/data/skills/metamask-agent-workflows/workflows/perps-close-position.md b/data/skills/metamask-agent-workflows/workflows/perps-close-position.mdnew file mode 100644index 000000000..8aa26ec13--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/perps-close-position.md@@ -0,0 +1,54 @@+# Perps Close Position Workflow++Use this workflow when the user wants to close a perpetual position.++Reference command syntax in `references/perps.md`.++## Flow++1. Check open positions.+2. Dry run the close.+3. Confirm with the user and close.++## Confirm Symbol++If the user does not mention a token symbol, list open positions and confirm with the user:++```bash+mm perps positions+```++## Check Positions++`--venue` defaults to `hyperliquid`. It can be omitted.++```bash+mm perps positions+```++## Dry Run++Preview the close before executing:++```bash+mm perps close --symbol BTC --dry-run+```++For partial close, include `--size <amount>`.++## Close++Remove `--dry-run` only after explicit user confirmation:++```bash+mm perps close --symbol BTC+mm perps close --symbol BTC --size 0.005+```++`--all` closes every open position. Require explicit confirmation that the user wants all positions closed.++```bash+mm perps close --all+```++Do not add `--yes` unless the user explicitly asked for unattended execution.diff --git a/data/skills/metamask-agent-workflows/workflows/perps-modify-position.md b/data/skills/metamask-agent-workflows/workflows/perps-modify-position.mdnew file mode 100644index 000000000..3f28f06c1--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/perps-modify-position.md@@ -0,0 +1,49 @@+# Perps Modify Position Workflow++Use this workflow when the user wants to modify leverage, take-profit, or stop-loss on an existing position.++Reference command syntax in `references/perps.md`.++## Flow++1. Check open positions.+2. Dry run the modification.+3. Confirm with the user and modify.++## Confirm Symbol++If the user does not mention a token symbol, list open positions and confirm with the user:++```bash+mm perps positions+```++## Check Positions++`--venue` defaults to `hyperliquid`. It can be omitted.++```bash+mm perps positions+```++## Dry Run++Preview the modification before executing:++```bash+mm perps modify --symbol BTC --leverage 10 --dry-run+mm perps modify --symbol ETH --tp 3000 --sl 2000 --dry-run+```++At least one of `--leverage`, `--tp`, or `--sl` must be provided.++## Modify++Remove `--dry-run` only after explicit user confirmation:++```bash+mm perps modify --symbol BTC --leverage 10+mm perps modify --symbol ETH --tp 3000 --sl 2000+```++Do not add `--yes` unless the user explicitly asked for unattended execution.diff --git a/data/skills/metamask-agent-workflows/workflows/perps-open-position.md b/data/skills/metamask-agent-workflows/workflows/perps-open-position.mdnew file mode 100644index 000000000..d47033105--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/perps-open-position.md@@ -0,0 +1,102 @@+# Perps open position workflow++Use this workflow when the user wants to open a new perpetual position.++Reference command syntax in `references/perps.md`.++## Flow++1. Check balance and deposit if needed.+2. Quote the position.+3. Dry run.+4. Confirm with the user and open.++## Confirm symbol++If the user doesn't mention a token symbol, list available markets and confirm with the user:++```bash+mm perps markets+```++## Check balance++`--venue` defaults to `hyperliquid`. You can omit it.++```bash+mm perps balance+```++If available margin is zero or insufficient, deposit USDC before proceeding. Hyperliquid only supports deposits from Arbitrum mainnet (`eip155:42161`).++Check the user's Arbitrum balance for USDC and ETH (for gas).++```bash+mm wallet balance --chain 42161+```++### No ETH and no USDC on Arbitrum++Inform the user that ETH on Arbitrum is required for gas. Without ETH, no on-chain transaction is possible. Bridge from another chain.++```bash+mm swap quote --from <TOKEN> --to ETH --amount 0.001 --from-chain <SOURCE_CHAIN_ID> --to-chain 42161+mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command+```++Once the user has ETH for gas, swap or bridge to get USDC on Arbitrum.++```bash+mm swap quote --from <TOKEN> --to USDC --amount <AMOUNT> --from-chain <SOURCE_CHAIN_ID> --to-chain 42161+mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command+```++### Has ETH or another token on Arbitrum (but no USDC)++Swap to USDC on Arbitrum.++```bash+mm swap quote --from <TOKEN> --to USDC --amount <AMOUNT> --from-chain 42161+mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command+```++### Has USDC on Arbitrum++Deposit USDC directly into Hyperliquid.++```bash+mm perps deposit --amount <AMOUNT> --asset USDC+```+++## Quote++Always quote before opening:++```bash+mm perps quote --symbol BTC --side long --size 0.01 --leverage 5+```++Show the user estimated entry, notional, fees, liquidation price, side, size, leverage, and venue before proceeding.++## Dry run++Preview the order before signing:++```bash+mm perps open --symbol BTC --side long --size 0.01 --leverage 5 --dry-run+```++For limit orders, include `--type limit --limit-px <price>`.++`--max-slippage-bps` is the slippage cap in basis points for IOC market pricing.++## Open++Remove `--dry-run` only after explicit user confirmation:++```bash+mm perps open --symbol BTC --side long --size 0.01 --leverage 5+```++Don't add `--yes` unless the user explicitly asked for unattended execution.diff --git a/data/skills/metamask-agent-workflows/workflows/predict-funding.md b/data/skills/metamask-agent-workflows/workflows/predict-funding.mdnew file mode 100644index 000000000..37991f5e4--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/predict-funding.md@@ -0,0 +1,90 @@+# Predict funding workflow++Use this workflow to deposit or withdraw pUSD from the Predict deposit wallet.++Reference command syntax in `references/predict.md`.++## Flow++1. Check deposit wallet balance.+2. Deposit or withdraw.++## Check deposit wallet balance++```bash+mm predict balance --sync+```++## Deposit++If the user doesn't specify an amount, ask how much they want to deposit. Get the deposit wallet address from `mm predict status`, then check the user's Polygon balance.++```bash+mm wallet balance --chain 137+```++### Has POL and pUSD on Polygon++Use `mm transfer` to send pUSD directly to the deposit wallet address. No conversion needed. Get the pUSD contract address from `mm wallet balance --chain 137` output.++```bash+mm transfer --to <DEPOSIT_WALLET_ADDRESS> --amount <AMOUNT> --chain-id 137 --token <PUSD_CONTRACT_ADDRESS> --wait+```++Get the deposit wallet address from the `mm predict status` output.++### Has POL and USDC.e on Polygon++Run `mm predict deposit`. The CLI converts USDC.e to pUSD in the deposit wallet.++```bash+mm predict deposit --amount <AMOUNT> --wait+```++`--amount` is in USDC.e. The owner EOA needs enough USDC.e and POL for gas on Polygon.++### Has POL or another token on Polygon (but no USDC.e or pUSD)++Swap to pUSD on Polygon, then transfer directly to the deposit wallet. The owner EOA needs POL for gas.++```bash+mm swap quote --from <TOKEN> --to pUSD --amount <AMOUNT> --from-chain 137+mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command+```++After the swap completes, check the balance to verify pUSD arrived:++```bash+mm wallet balance --chain 137+```++Get the pUSD contract address from the balance output, then transfer to the deposit wallet:++```bash+mm transfer --to <DEPOSIT_WALLET_ADDRESS> --amount <AMOUNT> --chain-id 137 --token <PUSD_CONTRACT_ADDRESS> --wait+```++Get the deposit wallet address from the `mm predict status` output.++### Has assets on another chain++Bridge to send pUSD directly to the deposit wallet address on Polygon.++```bash+mm swap quote --from <TOKEN> --to pUSD --amount <AMOUNT> --from-chain <SOURCE_CHAIN_ID> --to-chain 137 --to-address <DEPOSIT_WALLET_ADDRESS>+mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command+```++Get the deposit wallet address from the `mm predict status` output. This avoids the extra deposit step.+++## Withdraw++Withdraw pUSD from the deposit wallet to the owner EOA (default) or a specified address.++```bash+mm predict withdraw --amount <AMOUNT> --wait+mm predict withdraw --amount <AMOUNT> --to <RECIPIENT_ADDRESS> --wait+```++Confirm the amount and recipient with the user before executing. The CLI validates the amount against the on-chain deposit wallet balance before signing.diff --git a/data/skills/metamask-agent-workflows/workflows/predict-manage-orders.md b/data/skills/metamask-agent-workflows/workflows/predict-manage-orders.mdnew file mode 100644index 000000000..5fd10d749--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/predict-manage-orders.md@@ -0,0 +1,50 @@+# Predict manage orders workflow++Use this workflow to view, cancel, or manage open Predict orders and positions.++Reference command syntax in `references/predict.md`.++## View orders++```bash+mm predict orders+mm predict orders --market <CONDITION_ID>+```++## View positions++```bash+mm predict positions+mm predict positions --market <CONDITION_ID>+```++## Cancel orders++Cancel a single order:++```bash+mm predict cancel --order-id <ORDER_ID>+```++Cancel by market or asset:++```bash+mm predict cancel --market <CONDITION_ID>+mm predict cancel --asset <OUTCOME_TOKEN_ID>+```++Cancel all open orders:++```bash+mm predict cancel --all+```++`predict cancel --all` cancels every open order. Require explicit confirmation from the user before executing.++## Watch async jobs++```bash+mm predict watch --id <JOB_ID> --wait+```++Use this for setup, approve, deposit, withdraw, redeem, and order jobs that haven't reached a terminal state.diff --git a/data/skills/metamask-agent-workflows/workflows/predict-markets.md b/data/skills/metamask-agent-workflows/workflows/predict-markets.mdnew file mode 100644index 000000000..64d37e062--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/predict-markets.md@@ -0,0 +1,45 @@+# Predict markets workflow++Use this workflow to search, browse, and inspect prediction markets on Polymarket.++Reference command syntax in `references/predict.md`.++## Flow++1. Search or browse markets.+2. Inspect the selected market to get outcome token IDs.++## Search markets++```bash+mm predict markets search "Knicks NBA Finals" --limit 5 --toon+```++Search can return loosely related markets, so always inspect the selected market before quoting.++If search is noisy, list active markets and filter manually:++```bash+mm predict markets list --active --limit 50 --toon+```++## Browse by topic++Use events, series, and tags to browse by topic. Resolve a tag slug or ID first, then filter:++```bash+mm predict tags list --limit 50 --toon+mm predict events list --tag-slug sports --active --limit 10 --toon+mm predict events get <EVENT_SLUG_OR_ID> --toon+mm predict series list --recurrence weekly --limit 10 --toon+```++These browse commands don't return outcome token IDs. Drill into a specific market with `mm predict markets get` before quoting or placing.++## Inspect a market++```bash+mm predict markets get <MARKET_SLUG_OR_ID> --toon+```++The market detail prints outcome token IDs. Outcome token IDs aren't market IDs. Use the token ID for `quote`, `place`, `book`, and `balance --token-id`.diff --git a/data/skills/metamask-agent-workflows/workflows/predict-place-order.md b/data/skills/metamask-agent-workflows/workflows/predict-place-order.mdnew file mode 100644index 000000000..c5372a879--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/predict-place-order.md@@ -0,0 +1,72 @@+# Predict place order workflow++Use this workflow to quote and place a prediction market order.++Reference command syntax in `references/predict.md`.++## Flow++1. Check setup and balance.+2. Inspect the market to get the outcome token ID.+3. Quote the order.+4. Confirm with the user and place.++## Check setup and balance++Verify that Predict is fully set up and get the deposit wallet address:++```bash+mm predict status+```++Check `setupComplete` is `true`. If not, follow `predict-setup.md` to run first-time setup.++Then check the deposit wallet balance:++```bash+mm predict balance --sync+```++If the balance is zero or insufficient for the order, follow `predict-funding.md` to deposit funds. Use the deposit wallet address from `mm predict status` when funding.++## Get outcome token ID++If the user hasn't already identified the market, follow `predict-markets.md` to find and inspect it.++```bash+mm predict markets get <MARKET_SLUG_OR_ID> --toon+```++Map the user's intended outcome to the correct token ID from the market detail.++## Quote++Preview the order cost and fill before placing:++```bash+mm predict quote \+ --token-id <OUTCOME_TOKEN_ID> \+ --side buy --size 100 --limit-price 0.55+```++Show the user the estimated cost and fill.++## Place++After the user confirms token ID, outcome, side, size, price, and order type:++```bash+mm predict place \+ --token-id <OUTCOME_TOKEN_ID> \+ --side buy --size 100 --price 0.55 \+ --order-type GTC+```++`--order-type` is one of `GTC`, `GTD`, `FOK`, or `FAK`. `--post-only` only applies to GTC/GTD. `--expiration` is unix seconds for GTD.++## Safety notes++- Placing orders between a market's end date and its final UMA resolution carries major financial risk. Prices during this window don't reflect true odds and arbitrage strategies can fail if UMA resolves unexpectedly. If the order creation time is after the market end date but before UMA resolution, warn the user about potential financial loss and get explicit confirmation before proceeding.+- Prices are 0-1 floats. Treat `--price 1` as suspicious unless the user explicitly confirms.+- Trades are signed by the deposit wallet address from `mm predict status`, not the connected owner EOA.+- Always inspect the market to map the user's intended outcome to the correct token ID.diff --git a/data/skills/metamask-agent-workflows/workflows/predict-portfolio.md b/data/skills/metamask-agent-workflows/workflows/predict-portfolio.mdnew file mode 100644index 000000000..05357a2c1--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/predict-portfolio.md@@ -0,0 +1,35 @@+# Predict portfolio workflow++Use this workflow to view the Predict portfolio or redeem winning positions.++Reference command syntax in `references/predict.md`.++## View portfolio++Get a single snapshot of balance, open positions, and redeemable winnings:++```bash+mm predict portfolio --toon+```++## Redeem winnings++After a market resolves, list and claim winning positions:++```bash+mm predict redeem list --toon+```++Redeem a single position:++```bash+mm predict redeem <CONDITION_ID> --wait+```++Redeem all winning positions:++```bash+mm predict redeem --all --wait+```++`predict redeem --all` redeems every winning position. Confirm the target (condition ID or `--all`) with the user before executing. With `--wait`, the CLI polls for the redemption transaction receipt.diff --git a/data/skills/metamask-agent-workflows/workflows/predict-setup.md b/data/skills/metamask-agent-workflows/workflows/predict-setup.mdnew file mode 100644index 000000000..3aa29858c--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/predict-setup.md@@ -0,0 +1,54 @@+# Predict setup workflow++Use this workflow for first-time Predict setup, refreshing credentials, or repairing approvals.++Reference command syntax in `references/predict.md`.++## Flow++1. Choose Predict mode.+2. Run one-time setup.+3. Verify status.++## Choose mode++```bash+mm predict mode mainnet+```++Replace `mainnet` with `testnet` if the user wants to paper trade.++## Run setup++```bash+mm predict setup --wait+```++This blocks until credential, deposit-wallet, and approval jobs complete. Without `--wait`, track returned jobs with `mm predict watch --id <JOB_ID> --wait`.++The owner EOA needs POL on Polygon for gas to complete the setup transactions.++Polymarket is geoblocked in some regions. `predict setup` checks the caller's IP first and aborts with `PREDICT_GEOBLOCKED` before any wallet interaction if the region is restricted. To check region status independently:++```bash+mm predict geoblock+```++## Verify status++Confirm `setupComplete` is `true` and note the deposit wallet address:++```bash+mm predict status+```++## Refresh credentials or approvals++If credentials or approvals look stale later:++```bash+mm predict auth --refresh+mm predict approve --wait+```++Then verify with `mm predict status`.diff --git a/data/skills/metamask-agent-workflows/workflows/swap.md b/data/skills/metamask-agent-workflows/workflows/swap.mdnew file mode 100644index 000000000..dad35c482--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/swap.md@@ -0,0 +1,48 @@+# Swap workflow++Use this workflow when the user wants to swap tokens on the same chain.++Reference command syntax in `references/swap.md`.++## Flow++1. Quote.+2. Confirm with the user.+3. Execute and track status.++Don't skip the quote review step. The user needs to see output amount, fees, route, and slippage before executing.++## Quote++```bash+mm swap quote --from ETH --to USDC --amount 1 --from-chain 1+```++Required flags: `--from`, `--to`, `--amount`, and `--from-chain`.++`--to-address` isn't supported for same-chain swaps. Output always goes to the signer's wallet.++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.++## Execute++```bash+mm 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.++## Status++```bash+mm swap status --quote-id "$QUOTE_ID"+```++## Edge cases++- Quote expired: re-quote and ask the user to review the new quote.+- Insufficient balance: surface the error verbatim.+- Slippage exceeded: only increase `--slippage` if 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 chains list` before guessing a chain ID.diff --git a/data/skills/metamask-agent-workflows/workflows/troubleshooting.md b/data/skills/metamask-agent-workflows/workflows/troubleshooting.mdnew file mode 100644index 000000000..b0f09b7d6--- /dev/null+++ b/data/skills/metamask-agent-workflows/workflows/troubleshooting.md@@ -0,0 +1,45 @@+# Troubleshooting Workflow++Use this workflow when a command fails, hangs, prompts unexpectedly, or behaves differently in a terminal.++## Universal Triage++Run or suggest these in order:++```bash+mm --version+mm auth status+mm <failing-command> --help+```++If `auth status` reports anything other than authenticated, fix authentication before debugging downstream wallet, signing, swap, perps, or predict commands.++## Common Symptoms++| Symptom | Likely cause | Next step |+| --- | --- | --- |+| `mm: command not found` | Binary not installed or not on `PATH` | Check install and PATH |+| Async command returns a polling id and appears stuck | Request was dispatched without `--wait` | Use `mm wallet requests list` or `mm wallet requests watch --polling-id <id>` |+| Auth errors after previously working | Expired token | Check `mm auth status` and session file under `~/.metamask/` |+| `CHAIN_ID_MISMATCH` on typed data | Payload `domain.chainId` differs from `--chain-id` | Align the two chain IDs |+| `MNEMONIC_LOCKED` or `WRONG_PASSWORD` | BYOK mnemonic is encrypted and password was wrong or missing | Set the correct `MM_PASSWORD` environment variable and re-run |+| `ALREADY_ENCRYPTED` on `wallet password set` | Mnemonic already has a password | Use `mm wallet password change` instead |+| `NOT_ENCRYPTED` on `wallet password change/remove` | Mnemonic is not encrypted | Use `mm wallet password set` instead |++## Verbose Logging++Use `--verbose` when a command appears to hang or hides progress:++```bash+mm wallet balance --json --verbose+```++Structured logs and progress lines go to stderr; command results remain on stdout.++## Error Codes++For raw error-code meanings, load `../references/errors.md`. Relay CLI errors verbatim before explaining them.++## Reset Last++Use `mm reset` only after checking version, auth status, and the failing command's help output. Reset clears local session state and should not be the first troubleshooting step. Always ask the user for explicit confirmation before running reset.