Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions skills/metamask-agent-wallet/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Match the user's intent to a command and reference file, then read the reference
| View open prediction orders | `mm-dev predict orders` | [predict.md](references/predict.md) |
| Check Predict deposit wallet balance | `mm-dev predict balance` | [predict.md](references/predict.md) |
| Fund Predict deposit wallet | `mm-dev predict deposit` | [predict.md](references/predict.md) |
| 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) |
| Withdraw pUSD from Predict deposit wallet | `mm-dev predict withdraw` | [predict.md](references/predict.md) |
| Fetch prediction order book | `mm-dev predict book` | [predict.md](references/predict.md) |
| Watch a Predict job | `mm-dev predict watch` | [predict.md](references/predict.md) |
Expand Down
2 changes: 2 additions & 0 deletions skills/metamask-agent-wallet/references/predict.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

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

**Workflow:** [predict-trading.md](../workflows/predict-trading.md) — setup, cross-chain funding, quote, place, and close.

## `predict mode` Command

Choose or display the current Predict trading mode.
Expand Down
44 changes: 43 additions & 1 deletion skills/metamask-agent-wallet/workflows/predict-trading.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,49 @@

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.

Reference command syntax in `../references/predict.md`.
Reference command syntax in `../references/predict.md`. Cross-chain funding: [bridge.md](bridge.md) (§ Fund prediction markets on Polygon).

## End-to-end flow

Typical order:

1. One-time setup (if needed) — `predict setup`, credentials, approvals.
2. Fund — ensure pUSD or USDC.e on Polygon; bridge from other chains when needed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check if pUSD is working? For me USDC.e was only working. Also, it can be swapped.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah usdc.e is only working. I kept pusd thinking it worked for you

@arch1995 arch1995 Jun 2, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you pUSD, you can directly transfer it to the deposit wallet

3. Resolve market and outcome token ID.
4. Quote and place.
5. Manage orders/positions; close or cancel when the user asks to exit.

Complete **funding before** heavy market search when the user already gave you an amount to trade.

## Mandatory: Polygon USDC.e before `predict deposit`

```bash
mm-dev wallet balance --chain 137 --token 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 --json
mm-dev wallet balance --chain 137 --token 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 --json
```

| Token | Polygon contract | Used by `predict deposit`? |
| --- | --- | --- |
| **USDC.e** (bridged) | `0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174` | **Yes** — wrap source for pUSD |
| Native USDC (Circle) | `0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359` | **No** — balance here does not fund deposit |
Comment on lines +26 to +29

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to define, should work fine without this.


Required: USDC.e ≥ `--amount` (pUSD) + ~$1 POL on Polygon for gas.

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.

## Fund from another chain

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)):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fitting to benchmarks. It should check wallet balance instead, giving option to swap and bridge.

Fund from another chain is not accurate.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for other SKILL file.


```bash
mm-dev wallet balance --chain 8453 --token USDC
mm-dev swap quote --from USDC --to USDC --amount <amount> --from-chain 8453 --to-chain 137
mm-dev swap execute --quote-id <quote-id>
mm-dev wallet balance --chain 137 --token 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
mm-dev predict deposit --amount <pUSD> --wait
```

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.

## One-Time Setup

Expand Down
44 changes: 43 additions & 1 deletion skills/metamask-agent-workflows/workflows/predict-trading.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,49 @@

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.

Reference command syntax in `../references/predict.md`.
Reference command syntax in `../references/predict.md`. Cross-chain funding: [bridge.md](bridge.md) (§ Fund prediction markets on Polygon).

## End-to-end flow

Typical order:

1. One-time setup (if needed) — `predict setup`, credentials, approvals.
2. Fund — ensure pUSD or USDC.e on Polygon; bridge from other chains when needed.
3. Resolve market and outcome token ID.
4. Quote and place.
5. Manage orders/positions; close or cancel when the user asks to exit.

Complete **funding before** heavy market search when the user already gave you an amount to trade.

## Mandatory: Polygon USDC.e before `predict deposit`

```bash
mm-dev wallet balance --chain 137 --token 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 --json
mm-dev wallet balance --chain 137 --token 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 --json
```

| Token | Polygon contract | Used by `predict deposit`? |
| --- | --- | --- |
| **USDC.e** (bridged) | `0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174` | **Yes** — wrap source for pUSD |
| Native USDC (Circle) | `0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359` | **No** — balance here does not fund deposit |

Required: USDC.e ≥ `--amount` (pUSD) + ~$1 POL on Polygon for gas.

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.

## Fund from another chain

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)):

```bash
mm-dev wallet balance --chain 8453 --token USDC
mm-dev swap quote --from USDC --to USDC --amount <amount> --from-chain 8453 --to-chain 137
mm-dev swap execute --quote-id <quote-id>
mm-dev wallet balance --chain 137 --token 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
mm-dev predict deposit --amount <pUSD> --wait
```

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.

## One-Time Setup

Expand Down
Loading