Skip to content

Commit 0e8d415

Browse files
minor improvements
1 parent c72bf7b commit 0e8d415

9 files changed

Lines changed: 179 additions & 70 deletions

File tree

skills/metamask-agent-wallet/references/swap.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Get a swap or bridge quote showing expected output, fees, and route.
99
### Syntax
1010

1111
```bash
12-
mm swap quote --from <token> --to <token> --amount <amount> --from-chain <chain-id> [--to-chain <chain-id>] [--slippage <percent>]
12+
mm swap quote --from <token> --to <token> --amount <amount> --from-chain <chain-id> [--to-chain <chain-id>] [--to-address <address>] [--slippage <percent>]
1313
```
1414

1515
### Supported Flags
@@ -21,6 +21,7 @@ mm swap quote --from <token> --to <token> --amount <amount> --from-chain <chain-
2121
| `--amount` | Yes | Human-readable amount to swap (e.g. 0.5, 100) |
2222
| `--from-chain` | Yes | Source EVM chain ID (e.g. 1 for Ethereum, 137 for Polygon) |
2323
| `--to-chain` | No | Destination EVM chain ID; defaults to `--from-chain` for same-chain swaps |
24+
| `--to-address` | No | Recipient address for swapped/bridged output tokens; defaults to the signer's wallet |
2425
| `--slippage` | No | Maximum slippage as a percentage, 0-100 (defaults to 0.5) |
2526

2627
### Example
@@ -30,6 +31,7 @@ mm swap quote --from ETH --to USDC --amount 0.5 --from-chain 1
3031
mm swap quote --from USDC --to USDT --amount 100 --from-chain 137
3132
mm swap quote --from ETH --to USDC --amount 1 --from-chain 1 --to-chain 137
3233
mm swap quote --from ETH --to USDC --amount 0.5 --from-chain 1 --slippage 1
34+
mm swap quote --from ETH --to pUSD --amount 0.5 --from-chain 1 --to-chain 137 --to-address 0x742d...f2bD18
3335
```
3436

3537
## `swap execute` Command
@@ -40,7 +42,7 @@ Execute a swap or bridge, either by referencing a previous quote ID or by provid
4042

4143
```bash
4244
mm swap execute --quote-id <id> [--password <password>]
43-
mm swap execute --from <token> --to <token> --amount <amount> --from-chain <chain-id> [--to-chain <chain-id>] [--slippage <percent>] [--password <password>]
45+
mm swap execute --from <token> --to <token> --amount <amount> --from-chain <chain-id> [--to-chain <chain-id>] [--to-address <address>] [--slippage <percent>] [--password <password>]
4446
```
4547

4648
### Supported Flags
@@ -53,6 +55,7 @@ mm swap execute --from <token> --to <token> --amount <amount> --from-chain <chai
5355
| `--amount` | Yes (unless `--quote-id`) | Amount to swap |
5456
| `--from-chain` | Yes (unless `--quote-id`) | Source EVM chain ID |
5557
| `--to-chain` | No | Destination EVM chain ID; defaults to `--from-chain` for same-chain swaps |
58+
| `--to-address` | No | Recipient address for swapped/bridged output tokens; defaults to the signer's wallet. Persisted quotes retain the recipient for `--quote-id` execution |
5659
| `--slippage` | No | Maximum slippage as a percentage, 0-100 (defaults to 0.5) |
5760
| `--password` | No | Password to unlock the BYOK mnemonic (BYOK mode only) [env: `MM_PASSWORD`] |
5861

skills/metamask-agent-wallet/workflows/bridge.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Bridge Workflow
1+
# Bridge workflow
22

33
Use this workflow when the user wants to bridge tokens across chains.
44

@@ -10,7 +10,7 @@ Reference command syntax in `references/swap.md`. The CLI uses the same `swap` c
1010
2. Confirm with the user.
1111
3. Execute and track status.
1212

13-
Do not skip the quote review step. It is where the user sees output amount, fees, route, and slippage.
13+
Don't skip the quote review step. The user needs to see output amount, fees, route, and slippage before executing.
1414

1515
## Quote
1616

@@ -20,8 +20,14 @@ mm swap quote --from ETH --to USDC --amount 1 --from-chain 1 --to-chain 137 --sl
2020

2121
Required flags: `--from`, `--to`, `--amount`, `--from-chain`, and `--to-chain`.
2222

23+
If the user wants the bridged tokens sent to a different wallet on the destination chain, add `--to-address`:
24+
25+
```bash
26+
mm swap quote --from ETH --to USDC --amount 1 --from-chain 1 --to-chain 137 --to-address 0x742d...f2bD18
27+
```
28+
2329
Persist the quote id for execution. Show the quote to the user before execution.
24-
Confirm source token, destination token, amount, source chain, destination chain, slippage, expected output, fees, and route.
30+
Confirm source token, destination token, amount, source chain, destination chain, slippage, expected output, fees, route, and recipient address (if `--to-address` was set).
2531

2632
## Execute
2733

@@ -40,7 +46,7 @@ mm swap status --quote-id "QUOTE_ID" --tx-hash 0xabc123
4046

4147
Use status polling for bridges where the destination side can lag behind the source transaction.
4248

43-
## Edge Cases
49+
## Edge cases
4450

4551
- Quote expired: re-quote and ask the user to review the new quote.
4652
- Insufficient balance: surface the error verbatim.

skills/metamask-agent-wallet/workflows/perps-open-position.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Perps Open Position Workflow
1+
# Perps open position workflow
22

33
Use this workflow when the user wants to open a new perpetual position.
44

@@ -11,29 +11,63 @@ Reference command syntax in `references/perps.md`.
1111
3. Dry run.
1212
4. Confirm with the user and open.
1313

14-
## Confirm Symbol
14+
## Confirm symbol
1515

16-
If the user does not mention a token symbol, list available markets and confirm with the user:
16+
If the user doesn't mention a token symbol, list available markets and confirm with the user:
1717

1818
```bash
1919
mm perps markets
2020
```
2121

22-
## Check Balance
22+
## Check balance
2323

24-
`--venue` defaults to `hyperliquid`. It can be omitted.
24+
`--venue` defaults to `hyperliquid`. You can omit it.
2525

2626
```bash
2727
mm perps balance
2828
```
2929

3030
If available margin is zero or insufficient, deposit USDC before proceeding. Hyperliquid only supports deposits from Arbitrum mainnet (`eip155:42161`).
3131

32+
Check the user's Arbitrum balance for USDC and ETH (for gas).
33+
34+
```bash
35+
mm wallet balance --chain 42161
36+
```
37+
38+
### No ETH and no USDC on Arbitrum
39+
40+
Inform the user that ETH on Arbitrum is required for gas. Without ETH, no on-chain transaction is possible. Bridge from another chain.
41+
42+
```bash
43+
mm swap quote --from <TOKEN> --to ETH --amount 0.001 --from-chain <SOURCE_CHAIN_ID> --to-chain 42161
44+
mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command
45+
```
46+
47+
Once the user has ETH for gas, swap or bridge to get USDC on Arbitrum.
48+
49+
```bash
50+
mm swap quote --from <TOKEN> --to USDC --amount <AMOUNT> --from-chain <SOURCE_CHAIN_ID> --to-chain 42161
51+
mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command
52+
```
53+
54+
### Has ETH or another token on Arbitrum (but no USDC)
55+
56+
Swap to USDC on Arbitrum.
57+
58+
```bash
59+
mm swap quote --from <TOKEN> --to USDC --amount <AMOUNT> --from-chain 42161
60+
mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command
61+
```
62+
63+
### Has ETH and USDC on Arbitrum
64+
65+
Deposit USDC directly into Hyperliquid.
66+
3267
```bash
33-
mm perps deposit --amount <amount> --asset USDC
68+
mm perps deposit --amount <AMOUNT> --asset USDC
3469
```
3570

36-
To confirm a deposit, wait briefly and poll `mm perps balance`.
3771

3872
## Quote
3973

@@ -45,7 +79,7 @@ mm perps quote --symbol BTC --side long --size 0.01 --leverage 5
4579

4680
Show the user estimated entry, notional, fees, liquidation price, side, size, leverage, and venue before proceeding.
4781

48-
## Dry Run
82+
## Dry run
4983

5084
Preview the order before signing:
5185

@@ -65,4 +99,4 @@ Remove `--dry-run` only after explicit user confirmation:
6599
mm perps open --symbol BTC --side long --size 0.01 --leverage 5
66100
```
67101

68-
Do not add `--yes` unless the user explicitly asked for unattended execution.
102+
Don't add `--yes` unless the user explicitly asked for unattended execution.

skills/metamask-agent-wallet/workflows/predict-funding.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,51 +17,58 @@ mm predict balance --sync
1717

1818
## Deposit
1919

20-
If the user doesn't specify an amount, ask how much they want to deposit. Then check the user's Polygon balance for USDC.e and POL.
20+
If the user doesn't specify an amount, ask how much they want to deposit. Get the deposit wallet address from `mm predict balance --sync`, then check the user's Polygon balance.
2121

2222
```bash
2323
mm wallet balance --chain 137
2424
```
2525

26-
### No POL and no USDC.e
26+
### Has POL and pUSD on Polygon
2727

28-
Tell the user to acquire POL on Polygon first. Without POL, no on-chain transaction is possible. Check if the user has tokens on another chain to bridge POL from.
28+
Use `mm transfer` to send pUSD directly to the deposit wallet address. No conversion needed.
2929

3030
```bash
31-
mm swap quote --from <TOKEN> --to POL --amount 1 --from-chain <SOURCE_CHAIN_ID> --to-chain 137
31+
mm transfer --to <DEPOSIT_WALLET_ADDRESS> --amount <AMOUNT> --chain-id 137 --token pUSD --wait
3232
```
3333

34-
Once the user has POL, swap to USDC.e.
34+
Get the deposit wallet address from the `mm predict balance` output.
35+
36+
### Has POL and USDC.e on Polygon
37+
38+
Run `mm predict deposit`. The CLI converts USDC.e to pUSD in the deposit wallet.
3539

3640
```bash
37-
mm swap quote --from POL --to USDC.e --amount <AMOUNT> --from-chain 137
41+
mm predict deposit --amount <AMOUNT> --wait
3842
```
3943

40-
### Has POL but not enough to swap for USDC.e
44+
`--amount` is in USDC.e. The owner EOA needs enough USDC.e and POL for gas on Polygon.
4145

42-
If the user's POL balance is too low for a swap, bridge USDC.e from another chain.
46+
### Has POL or another token on Polygon (but no USDC.e or pUSD)
47+
48+
Swap to USDC.e on Polygon, then deposit.
4349

4450
```bash
45-
mm swap quote --from <TOKEN> --to USDC.e --amount <AMOUNT> --from-chain <SOURCE_CHAIN_ID> --to-chain 137
51+
mm swap quote --from <TOKEN> --to USDC.e --amount <AMOUNT> --from-chain 137
52+
mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command
4653
```
4754

48-
### Has enough POL or other tokens on Polygon
49-
50-
Swap directly into USDC.e.
55+
After the swap completes, deposit:
5156

5257
```bash
53-
mm swap quote --from <TOKEN> --to USDC.e --amount <AMOUNT> --from-chain 137
58+
mm predict deposit --amount <AMOUNT> --wait
5459
```
5560

56-
After the bridge or swap completes, re-check the balance before proceeding.
61+
### Has assets on another chain
5762

58-
### Execute deposit
63+
Bridge to send pUSD directly to the deposit wallet address on Polygon.
5964

6065
```bash
61-
mm predict deposit --amount <AMOUNT> --wait
66+
mm swap quote --from <TOKEN> --to pUSD --amount <AMOUNT> --from-chain <SOURCE_CHAIN_ID> --to-chain 137 --to-address <DEPOSIT_WALLET_ADDRESS>
67+
mm swap execute --quote-id "$QUOTE_ID" # quote ID from the swap quote command
6268
```
6369

64-
`--amount` is in USDC.e. The CLI converts USDC.e to pUSD in the deposit wallet upon deposit. The owner EOA needs enough USDC.e on Polygon and POL for gas to complete the transaction.
70+
Get the deposit wallet address from the `mm predict balance` output. This avoids the extra deposit step.
71+
6572

6673
## Withdraw
6774

skills/metamask-agent-wallet/workflows/swap.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Swap Workflow
1+
# Swap workflow
22

33
Use this workflow when the user wants to swap tokens on the same chain.
44

@@ -10,7 +10,7 @@ Reference command syntax in `references/swap.md`.
1010
2. Confirm with the user.
1111
3. Execute and track status.
1212

13-
Do not skip the quote review step. It is where the user sees output amount, fees, route, and slippage.
13+
Don't skip the quote review step. The user needs to see output amount, fees, route, and slippage before executing.
1414

1515
## Quote
1616

@@ -20,8 +20,14 @@ mm swap quote --from ETH --to USDC --amount 1 --from-chain 1
2020

2121
Required flags: `--from`, `--to`, `--amount`, and `--from-chain`.
2222

23+
If the user wants the output tokens sent to a different wallet, add `--to-address`:
24+
25+
```bash
26+
mm swap quote --from ETH --to USDC --amount 1 --from-chain 1 --to-address 0x742d...f2bD18
27+
```
28+
2329
Persist the quote id for execution. Show the quote to the user before execution.
24-
Confirm source token, destination token, amount, chain, slippage, expected output, fees, and route.
30+
Confirm source token, destination token, amount, chain, slippage, expected output, fees, route, and recipient address (if `--to-address` was set).
2531

2632
## Execute
2733

@@ -37,7 +43,7 @@ Prefer executing by quote ID. Re-quote-and-execute flags exist, but quote ID exe
3743
mm swap status --quote-id "$QUOTE_ID"
3844
```
3945

40-
## Edge Cases
46+
## Edge cases
4147

4248
- Quote expired: re-quote and ask the user to review the new quote.
4349
- Insufficient balance: surface the error verbatim.

skills/metamask-agent-workflows/workflows/bridge.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Bridge Workflow
1+
# Bridge workflow
22

33
Use this workflow when the user wants to bridge tokens across chains.
44

@@ -10,7 +10,7 @@ Reference command syntax in `references/swap.md`. The CLI uses the same `swap` c
1010
2. Confirm with the user.
1111
3. Execute and track status.
1212

13-
Do not skip the quote review step. It is where the user sees output amount, fees, route, and slippage.
13+
Don't skip the quote review step. The user needs to see output amount, fees, route, and slippage before executing.
1414

1515
## Quote
1616

@@ -20,8 +20,14 @@ mm swap quote --from ETH --to USDC --amount 1 --from-chain 1 --to-chain 137 --sl
2020

2121
Required flags: `--from`, `--to`, `--amount`, `--from-chain`, and `--to-chain`.
2222

23+
If the user wants the bridged tokens sent to a different wallet on the destination chain, add `--to-address`:
24+
25+
```bash
26+
mm swap quote --from ETH --to USDC --amount 1 --from-chain 1 --to-chain 137 --to-address 0x742d...f2bD18
27+
```
28+
2329
Persist the quote id for execution. Show the quote to the user before execution.
24-
Confirm source token, destination token, amount, source chain, destination chain, slippage, expected output, fees, and route.
30+
Confirm source token, destination token, amount, source chain, destination chain, slippage, expected output, fees, route, and recipient address (if `--to-address` was set).
2531

2632
## Execute
2733

@@ -40,7 +46,7 @@ mm swap status --quote-id "QUOTE_ID" --tx-hash 0xabc123
4046

4147
Use status polling for bridges where the destination side can lag behind the source transaction.
4248

43-
## Edge Cases
49+
## Edge cases
4450

4551
- Quote expired: re-quote and ask the user to review the new quote.
4652
- Insufficient balance: surface the error verbatim.

0 commit comments

Comments
 (0)