@goplausible/openclaw-algorand-plugin 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  "id": "openclaw-algorand-plugin",
3
3
  "name": "Algorand Integration",
4
4
  "description": "Algorand blockchain integration with MCP and skills — by GoPlausible",
5
- "version": "1.4.0",
5
+ "version": "1.6.0",
6
6
  "skills": [
7
7
  "skills/algorand-development",
8
8
  "skills/algorand-typescript",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goplausible/openclaw-algorand-plugin",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -193,6 +193,22 @@ Map CAIP-2 network identifiers from `accepts[].network` to `testnet` or `mainnet
193
193
 
194
194
  See [references/examples-algorand-mcp.md](references/examples-algorand-mcp.md) for the full step-by-step workflow.
195
195
 
196
+ ## Alpha Arcade Prediction Markets
197
+
198
+ Trade on-chain prediction markets (YES/NO outcomes) denominated in USDC via the Alpha Arcade integration (14 tools).
199
+
200
+ | Step | Tool | Purpose |
201
+ |------|------|---------|
202
+ | 1 | `wallet_get_info` | Verify active account, check ALGO + USDC balance |
203
+ | 2 | `alpha_get_live_markets` | Browse available markets |
204
+ | 3 | `alpha_get_orderbook` | Check liquidity and prices for a market |
205
+ | 4 | `alpha_create_market_order` or `alpha_create_limit_order` | Place an order |
206
+ | 5 | `alpha_get_positions` / `alpha_get_open_orders` | Check portfolio |
207
+
208
+ All prices and quantities use **microunits** (1,000,000 = $1.00 or 1 share). Orders require both ALGO (~0.957 per escrow) and USDC collateral.
209
+
210
+ > For detailed Alpha Arcade workflows (orderbook mechanics, multi-choice markets, split/merge shares, claiming, collateral model), load the `alpha-arcade-interaction` skill.
211
+
196
212
  ## References
197
213
 
198
214
  For detailed tool documentation:
@@ -26,12 +26,11 @@
26
26
  Secure wallet management. Private keys are never available to you — use these tools to sign.
27
27
 
28
28
  ### wallet_add_account
29
- - **Purpose**: Create a new Algorand account (or import from mnemonic) with nickname and spending limits
29
+ - **Purpose**: Create a new Algorand account with nickname and spending limits
30
30
  - **Parameters**:
31
31
  ```json
32
32
  {
33
33
  "nickname": "my-account",
34
- "mnemonic": "optional 25-word mnemonic to import",
35
34
  "allowance": 5000000,
36
35
  "dailyAllowance": 10000000
37
36
  }
@@ -0,0 +1,180 @@
1
+ ---
2
+ name: alpha-arcade-interaction
3
+ description: Trade on Alpha Arcade prediction markets on Algorand — browse markets, read orderbooks, place limit/market orders, manage positions, cancel/amend orders, split/merge shares, and claim winnings. Use when user asks about prediction markets, event betting, YES/NO shares, orderbooks, or Alpha Arcade.
4
+ ---
5
+
6
+ # Alpha Arcade — Prediction Markets on Algorand
7
+
8
+ Interact with Alpha Arcade prediction markets via the Alpha Arcade MCP server (15 tools across read-only and trading categories).
9
+
10
+ ## Key Characteristics
11
+
12
+ - **On-chain prediction markets** — all orders and settlements happen on Algorand
13
+ - **Binary and multi-choice markets** — bet on YES/NO outcomes or choose from multiple options
14
+ - **USDC-denominated** — all collateral and payouts in USDC (ASA 31566704)
15
+ - **Microunit inputs** — all prices and quantities in tool inputs use microunits (1,000,000 = $1.00 or 1 share)
16
+ - **Formatted outputs** — read tools return human-readable strings like "$0.50" and "2.50 shares"
17
+
18
+ ## Setup
19
+
20
+ Alpha Arcade tools are built into the Algorand MCP server. Trading uses the local wallet (OS keychain) — no separate mnemonic needed.
21
+
22
+ | Variable | Required | Description |
23
+ |----------|----------|-------------|
24
+ | `ALPHA_API_KEY` | For reward markets | Alpha Arcade API key |
25
+ | `ALPHA_API_BASE_URL` | No | API base URL (default: https://platform.alphaarcade.com/api) |
26
+
27
+ Read-only tools work without a wallet. Trading tools require an active wallet account (see `wallet_get_info` and `wallet_add_account`).
28
+
29
+ ## Units & Price Format
30
+
31
+ All prices and quantities in tool **inputs** use **microunits**: 1,000,000 = $1.00 or 1 share.
32
+
33
+ | Human value | Microunit value |
34
+ |---|---|
35
+ | $0.50 | 500,000 |
36
+ | $0.05 slippage | 50,000 |
37
+ | 1 share | 1,000,000 |
38
+ | 30 shares | 30,000,000 |
39
+
40
+ Tool **outputs** from read tools (`get_orderbook`, `get_open_orders`, `get_positions`) return pre-formatted strings. Write tools accept raw microunit integers.
41
+
42
+ ### API probability fields are microunits, NOT percentages
43
+
44
+ **Critical**: The `yesProb` and `noProb` fields returned by market data (e.g., `get_market`, `get_live_markets`) are in **microunits** (0–1,000,000), NOT percentages (0–100).
45
+
46
+ | `yesProb` value | Meaning | Display price |
47
+ |---|---|---|
48
+ | 862,500 | 86.25% chance | $0.86 |
49
+ | 500,000 | 50% chance | $0.50 |
50
+ | 50,000 | 5% chance | $0.05 |
51
+
52
+ To convert for display: `price = yesProb / 1,000,000` → e.g., `862500 / 1000000 = $0.86`
53
+
54
+ **Do NOT** divide by 100 or treat as a percentage — this produces values like 8,625,000,000 which overflow uint64 and cause transaction failures.
55
+
56
+ ## Market Data Model
57
+
58
+ ### Binary markets
59
+ A standard yes/no market has a single `marketAppId`, `yesAssetId`, and `noAssetId`. Use `marketAppId` for all trading calls.
60
+
61
+ ### Multi-choice markets
62
+ Multi-choice markets (e.g., "Who wins the election?") have an `options[]` array. Each option is its own binary market with its own `marketAppId`:
63
+
64
+ ```json
65
+ {
66
+ "title": "Presidential Election Winner 2028",
67
+ "options": [
68
+ { "title": "Candidate A", "marketAppId": 100001, "yesAssetId": 111, "noAssetId": 112 },
69
+ { "title": "Candidate B", "marketAppId": 100002, "yesAssetId": 113, "noAssetId": 114 }
70
+ ]
71
+ }
72
+ ```
73
+
74
+ **Always trade using the option's `marketAppId`, not the parent.**
75
+
76
+ ## Orderbook Mechanics
77
+
78
+ ### Four-sided book
79
+ The orderbook has four sides: YES bids, YES asks, NO bids, NO asks.
80
+
81
+ ### Cross-side equivalence
82
+ Because YES + NO always = $1.00:
83
+ - A **YES bid at $0.30** is equivalent to a **NO ask at $0.70**
84
+ - A **NO bid at $0.71** is equivalent to a **YES ask at $0.29**
85
+
86
+ The `get_orderbook` tool returns a unified YES-perspective view that merges all 4 sides automatically.
87
+
88
+ ### Limit vs market orders
89
+ - **Limit order** (`create_limit_order`): Sits on the orderbook at your exact price. No matching happens. Appears in `get_open_orders` as an unfilled order until matched or cancelled.
90
+ - **Market order** (`create_market_order`): Auto-matches against existing orders within your slippage tolerance. Returns the actual fill price. Filled immediately — does NOT appear in open orders.
91
+
92
+ ### Positions vs open orders
93
+ - **Positions** (`get_positions`): YES/NO token balances the wallet holds. These come from filled market orders, split shares, or received transfers. Positions represent ownership of outcome tokens.
94
+ - **Open orders** (`get_open_orders`): Unfilled limit orders sitting on the orderbook. Each has an `escrowAppId` that can be used to cancel or amend.
95
+
96
+ A common mistake is checking only open orders after a market order — market orders fill immediately and become positions, not open orders. Always check both.
97
+
98
+ ## Collateral
99
+
100
+ Every order requires **both ALGO and USDC/tokens**:
101
+
102
+ - **ALGO**: ~0.957 ALGO locked per order as minimum balance requirement (MBR) for the on-chain escrow. Refunded on cancel or fill.
103
+ - **Buy orders**: Lock USDC as trade collateral (proportional to quantity × price).
104
+ - **Sell orders**: Lock outcome tokens (YES or NO) as collateral.
105
+
106
+ If a trade fails with an "overspend" error, the wallet lacks sufficient ALGO or USDC. Check both balances before retrying.
107
+
108
+ ## Tools
109
+
110
+ ### Read-only tools (no wallet required)
111
+
112
+ | Tool | Purpose |
113
+ |------|---------|
114
+ | `alpha_get_live_markets` | Fetch all live markets with prices, volume, categories |
115
+ | `alpha_get_reward_markets` | Fetch markets with liquidity rewards (requires `ALPHA_API_KEY`) |
116
+ | `alpha_get_market` | Fetch full details for a single market by ID |
117
+ | `alpha_get_orderbook` | Fetch unified YES-perspective orderbook for a market |
118
+ | `alpha_get_open_orders` | Fetch all open orders for a wallet on a specific market |
119
+ | `alpha_get_positions` | Fetch all YES/NO token positions for a wallet across all markets |
120
+
121
+ ### Trading tools (require active wallet account)
122
+
123
+ | Tool | Purpose |
124
+ |------|---------|
125
+ | `alpha_create_limit_order` | Place a limit order at a specific price |
126
+ | `alpha_create_market_order` | Place a market order with auto-matching and slippage |
127
+ | `alpha_cancel_order` | Cancel an open order (refunds collateral) |
128
+ | `alpha_amend_order` | Edit an existing unfilled order in-place |
129
+ | `alpha_propose_match` | Propose a match between a maker order and your wallet |
130
+ | `alpha_split_shares` | Split USDC into equal YES + NO tokens |
131
+ | `alpha_merge_shares` | Merge equal YES + NO tokens back into USDC |
132
+ | `alpha_claim` | Claim USDC from a resolved market |
133
+
134
+ ## Key Workflows
135
+
136
+ ### Buying shares
137
+ 1. `get_live_markets` — find a market (or `get_reward_markets` for markets with liquidity rewards)
138
+ 2. `get_orderbook` — check available liquidity
139
+ 3. `create_market_order` (auto-matches) or `create_limit_order` (rests on book)
140
+ 4. Save the returned `escrowAppId` — you need it to cancel
141
+
142
+ ### Checking your portfolio
143
+ 1. `get_positions` — see all YES/NO token balances with market titles and asset IDs
144
+ 2. For open orders on a specific market: `get_open_orders` with the `marketAppId`
145
+
146
+ ### Editing an order (amend)
147
+ 1. `get_open_orders` — find the `escrowAppId`
148
+ 2. `amend_order` with `marketAppId`, `escrowAppId`, new `price`, and new `quantity`
149
+ 3. Faster and cheaper than cancel + recreate. Only works on unfilled orders.
150
+
151
+ ### Cancelling an order
152
+ 1. `get_open_orders` — find the `escrowAppId` and `owner` address
153
+ 2. `cancel_order` with `marketAppId`, `escrowAppId`, and `orderOwner`
154
+
155
+ ### Claiming from a resolved market
156
+ 1. `get_positions` — find markets with token balances; note the `yesAssetId` or `noAssetId`
157
+ 2. `claim` with `marketAppId` and the winning token's `assetId`
158
+
159
+ ### Providing liquidity (split/merge)
160
+ 1. `split_shares` — convert USDC into equal YES + NO tokens
161
+ 2. Place limit orders on both sides of the book for market making
162
+ 3. `merge_shares` — convert matched YES + NO tokens back to USDC
163
+
164
+ ## Common Pitfalls
165
+
166
+ - **Probabilities are microunits, NOT percentages**: `yesProb` / `noProb` range from 0–1,000,000 (not 0–100). Treating them as percentages causes uint64 overflow and transaction failures. To display: divide by 1,000,000. To pass as price: use as-is.
167
+ - **Market orders become positions, not open orders**: After a market order fills, check `get_positions` for token balances — not `get_open_orders`. Open orders only shows unfilled limit orders.
168
+ - **Multi-choice markets**: The parent has no `marketAppId` for trading. Use `options[].marketAppId`.
169
+ - **Prices are microunits in inputs**: $0.50 = 500,000, not 0.5 or 50.
170
+ - **Both ALGO and USDC needed**: Orders require ALGO for MBR (~0.957 per order) AND USDC for buy collateral. An "overspend" error means one of these is insufficient.
171
+ - **Orderbook cross-side**: If you only check YES asks, you miss cheaper liquidity from NO bids. The `get_orderbook` tool handles this automatically.
172
+ - **Save escrowAppId**: It's the only way to cancel or amend your order later.
173
+ - **USDC opt-in**: The wallet must be opted into USDC (ASA 31566704) before trading.
174
+ - **Wallet required for trading**: Read-only tools work without a wallet, but trading tools require an active wallet account. Check via `wallet_get_info` and if no wallet existed, add one using `wallet_add_account`.
175
+ - **Mainnet by default**: The server defaults to mainnet. Real money is at stake. Pass `network: "testnet"` for testing.
176
+
177
+ ## Links
178
+
179
+ - Alpha Arcade: https://alphaarcade.com
180
+ - Alpha Arcade API: https://platform.alphaarcade.com