Skip to content

Commit 2ef224e

Browse files
committed
Update prediction market workflows
1 parent 1f0c5d3 commit 2ef224e

4 files changed

Lines changed: 89 additions & 2 deletions

File tree

skills/metamask-agent-wallet/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Match the user's intent to a command and reference file, then read the reference
7676
| View open prediction orders | `mm-dev predict orders` | [predict.md](references/predict.md) |
7777
| Check Predict deposit wallet balance | `mm-dev predict balance` | [predict.md](references/predict.md) |
7878
| Fund Predict deposit wallet | `mm-dev predict deposit` | [predict.md](references/predict.md) |
79+
| Bridge USDC to Polygon for predict | `mm-dev swap quote` + `mm-dev swap execute`, then `predict deposit` | [predict.md](references/predict.md), [predict-trading.md](workflows/predict-trading.md), [bridge.md](workflows/bridge.md) |
7980
| Fetch prediction order book | `mm-dev predict book` | [predict.md](references/predict.md) |
8081
| Watch a Predict job | `mm-dev predict watch` | [predict.md](references/predict.md) |
8182
| Get a swap or bridge quote | `mm-dev swap quote` | [swap.md](references/swap.md) |

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Use the `predict` commands to trade on prediction markets (Polymarket via the CLOB).
44

5+
**Workflow:** [predict-trading.md](../workflows/predict-trading.md) — setup, cross-chain funding, quote, place, and close.
6+
57
## `predict mode` Command
68

79
Choose or display the current Predict trading mode.

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

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,49 @@
22

33
Use this workflow when the user wants to set up prediction market trading, fund the deposit wallet, quote/place orders, or manage Predict orders and positions.
44

5-
Reference command syntax in `../references/predict.md`.
5+
Reference command syntax in `../references/predict.md`. Cross-chain funding: [bridge.md](bridge.md) (§ Fund prediction markets on Polygon).
6+
7+
## End-to-end flow
8+
9+
Typical order:
10+
11+
1. One-time setup (if needed) — `predict setup`, credentials, approvals.
12+
2. Fund — ensure pUSD or USDC.e on Polygon; bridge from other chains when needed.
13+
3. Resolve market and outcome token ID.
14+
4. Quote and place.
15+
5. Manage orders/positions; close or cancel when the user asks to exit.
16+
17+
Complete **funding before** heavy market search when the user already gave you an amount to trade.
18+
19+
## Mandatory: Polygon USDC.e before `predict deposit`
20+
21+
```bash
22+
mm-dev wallet balance --chain 137 --token 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 --json
23+
mm-dev wallet balance --chain 137 --token 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 --json
24+
```
25+
26+
| Token | Polygon contract | Used by `predict deposit`? |
27+
| --- | --- | --- |
28+
| **USDC.e** (bridged) | `0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174` | **Yes** — wrap source for pUSD |
29+
| Native USDC (Circle) | `0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359` | **No** — balance here does not fund deposit |
30+
31+
Required: USDC.e ≥ `--amount` (pUSD) + ~$1 POL on Polygon for gas.
32+
33+
If USDC.e is too low: do **not** retry `predict deposit` in a loop — `execution reverted` usually means native USDC only or insufficient USDC.e.
34+
35+
## Fund from another chain
36+
37+
Polymarket predict uses Polygon (`137`). If USDC.e on the owner EOA is insufficient but USDC exists elsewhere, bridge before `predict deposit` (see [swap.md](swap.md), [bridge.md](../workflows/bridge.md)):
38+
39+
```bash
40+
mm-dev wallet balance --chain 8453 --token USDC
41+
mm-dev swap quote --from USDC --to USDC --amount <amount> --from-chain 8453 --to-chain 137
42+
mm-dev swap execute --quote-id <quote-id>
43+
mm-dev wallet balance --chain 137 --token 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
44+
mm-dev predict deposit --amount <pUSD> --wait
45+
```
46+
47+
Use the chain ID where the wallet actually holds USDC (`8453` Base, `42161` Arbitrum, `1` Ethereum). Include slippage buffer in the bridge amount. Re-check USDC.e (`0x2791…`), not native USDC (`0x3c499…`), before depositing.
648

749
## One-Time Setup
850

skills/metamask-agent-workflows/workflows/predict-trading.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,49 @@
22

33
Use this workflow when the user wants to set up prediction market trading, fund the deposit wallet, quote/place orders, or manage Predict orders and positions.
44

5-
Reference command syntax in `../references/predict.md`.
5+
Reference command syntax in `../references/predict.md`. Cross-chain funding: [bridge.md](bridge.md) (§ Fund prediction markets on Polygon).
6+
7+
## End-to-end flow
8+
9+
Typical order:
10+
11+
1. One-time setup (if needed) — `predict setup`, credentials, approvals.
12+
2. Fund — ensure pUSD or USDC.e on Polygon; bridge from other chains when needed.
13+
3. Resolve market and outcome token ID.
14+
4. Quote and place.
15+
5. Manage orders/positions; close or cancel when the user asks to exit.
16+
17+
Complete **funding before** heavy market search when the user already gave you an amount to trade.
18+
19+
## Mandatory: Polygon USDC.e before `predict deposit`
20+
21+
```bash
22+
mm-dev wallet balance --chain 137 --token 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 --json
23+
mm-dev wallet balance --chain 137 --token 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 --json
24+
```
25+
26+
| Token | Polygon contract | Used by `predict deposit`? |
27+
| --- | --- | --- |
28+
| **USDC.e** (bridged) | `0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174` | **Yes** — wrap source for pUSD |
29+
| Native USDC (Circle) | `0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359` | **No** — balance here does not fund deposit |
30+
31+
Required: USDC.e ≥ `--amount` (pUSD) + ~$1 POL on Polygon for gas.
32+
33+
If USDC.e is too low: do **not** retry `predict deposit` in a loop — `execution reverted` usually means native USDC only or insufficient USDC.e.
34+
35+
## Fund from another chain
36+
37+
Polymarket predict uses Polygon (`137`). If USDC.e on the owner EOA is insufficient but USDC exists elsewhere, bridge before `predict deposit` (see [swap.md](swap.md), [bridge.md](../workflows/bridge.md)):
38+
39+
```bash
40+
mm-dev wallet balance --chain 8453 --token USDC
41+
mm-dev swap quote --from USDC --to USDC --amount <amount> --from-chain 8453 --to-chain 137
42+
mm-dev swap execute --quote-id <quote-id>
43+
mm-dev wallet balance --chain 137 --token 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
44+
mm-dev predict deposit --amount <pUSD> --wait
45+
```
46+
47+
Use the chain ID where the wallet actually holds USDC (`8453` Base, `42161` Arbitrum, `1` Ethereum). Include slippage buffer in the bridge amount. Re-check USDC.e (`0x2791…`), not native USDC (`0x3c499…`), before depositing.
648

749
## One-Time Setup
850

0 commit comments

Comments
 (0)