@arcadia-finance/mcp-server 0.6.1 → 0.7.1

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.
@@ -1,6 +1,6 @@
1
1
  # Strategy Templates
2
2
 
3
- These are templates and examples — not the only valid approaches. Adapt parameters to current conditions. Use selection.md to evaluate whether a strategy fits before executing.
3
+ These are templates and examples, not the only valid approaches. Adapt parameters to current conditions. Use selection.md to evaluate whether a strategy fits before executing.
4
4
 
5
5
  ## Key Parameter Notes
6
6
 
@@ -29,9 +29,9 @@ Close: disable rebalancer → unstake → atomic close (burn LP + swap + repay
29
29
 
30
30
  ### Batching vs splitting
31
31
 
32
- **Default: always use atomic tools.** `write_account_add_liquidity` batches opening, `write_account_close` batches closing, `write_account_deleverage` batches debt repayment from collateral. These reduce transaction count and eliminate exposure to price movement between steps.
32
+ **Default: always use atomic tools.** `write_account_add_liquidity` batches opening, `write_account_close` batches closing, `write_account_deleverage` batches debt repayment from collateral. These reduce transaction count and exposure to price movement between steps.
33
33
 
34
- **When to split:** In high-volatility markets or for low-liquidity pools, atomic transactions may revert because on-chain state diverges from when the backend computed the calldata. If an atomic tool fails, fall back to individual tools with tighter slippage. Always try atomic first — split only on failure.
34
+ **When to split:** In high-volatility markets or for low-liquidity pools, atomic transactions may revert because on-chain state diverges from when the backend computed the calldata. If an atomic tool fails, fall back to individual tools with tighter slippage. Always try atomic first, split only on failure.
35
35
 
36
36
  ---
37
37
 
@@ -43,7 +43,7 @@ Close: disable rebalancer → unstake → atomic close (burn LP + swap + repay
43
43
 
44
44
  **Why it works:**
45
45
 
46
- - LP position is ~50% WETH, ~50% USDC by value at any given price
46
+ - LP position starts roughly 50% WETH, 50% USDC by value at entry
47
47
  - You borrow WETH to provide it → WETH debt ≈ WETH held in LP
48
48
  - Net WETH exposure ≈ 0 (small residual from IL)
49
49
  - You earn LP fees on the full leveraged notional
@@ -68,8 +68,8 @@ read_pool_list(chain_id: 8453)
68
68
  // 3. CREATE MARGIN ACCOUNT (V3 + creditor = can borrow/leverage)
69
69
  write_account_create(
70
70
  salt: <random uint32, e.g. 3141592653>,
71
- account_version: 3, // V3 margin — required for leverage
72
- creditor: "0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2", // WETH lending pool — enables borrow
71
+ account_version: 3, // V3 margin, required for leverage
72
+ creditor: "0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2", // WETH lending pool, enables borrow
73
73
  chain_id: 8453
74
74
  )
75
75
  → Submit tx, note deployed account address from tx receipt
@@ -96,13 +96,13 @@ write_account_add_liquidity(
96
96
  account_address: <account_address>,
97
97
  wallet_address: <owner_wallet>,
98
98
  positions: [{ strategy_id: <integer from step 1> }],
99
- deposits: [{ asset: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", amount: "10000000000", decimals: 6 }], // 10,000 USDC — pulled from wallet
99
+ deposits: [{ asset: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", amount: "10000000000", decimals: 6 }], // 10,000 USDC, pulled from wallet
100
100
  leverage: 2, // 2 = 2x leverage (0 = no leverage, 3 = 3x, etc.)
101
101
  slippage: 100, // 100 = 1% slippage tolerance (basis points)
102
102
  chain_id: 8453
103
103
  )
104
104
 
105
- // 6. ENABLE AUTOMATIONS — one call, one transaction
105
+ // 6. ENABLE AUTOMATIONS: one call, one transaction
106
106
  // Include every automation you want active: the intents array is the full desired state.
107
107
  // Add claim_merkl only if the pool has Merkl incentives (check fee APY breakdown in step 1).
108
108
  write_account_automations(
@@ -115,7 +115,7 @@ write_account_automations(
115
115
  ],
116
116
  chain_id: 8453
117
117
  )
118
- // → Returns { valid, plan, diff, human_summary, transaction } — broadcast the transaction
118
+ // → Returns { valid, plan, diff, human_summary, transaction }; broadcast the transaction
119
119
  ```
120
120
 
121
121
  ### Monitoring
@@ -127,34 +127,34 @@ read_account_info(account_address: <account_address>, chain_id: 8453)
127
127
  1 → no debt (safest)
128
128
  > 0.5 → healthy
129
129
  0.2–0.5 → monitor closely, consider adding collateral or reducing debt
130
- < 0.2 → ACTION REQUIRED — close to liquidation
130
+ < 0.2 → ACTION REQUIRED: close to liquidation
131
131
  0 → liquidation threshold
132
132
  < 0 → past liquidation
133
133
 
134
134
  Note: Each lending pool adds a fixed minimum margin (denominated in the pool's numeraire,
135
135
  typically a few dollars in value) to the debt when computing used_margin
136
136
  (used_margin = open_debt + minimum_margin). For small positions this fixed overhead
137
- dominates, pushing HF lower than the leverage ratio suggests — e.g. HF ~0.3 at 2×
137
+ dominates, pushing HF lower than the leverage ratio suggests, e.g. HF ~0.3 at 2×
138
138
  instead of ~0.5–0.7. Increase position size for a healthier starting HF.
139
139
 
140
140
  read_account_pnl(account_address: <account_address>, chain_id: 8453)
141
141
  → If net yield is consistently negative → evaluate exit
142
142
 
143
143
  read_pool_list(chain_id: 8453)
144
- → If borrow_APY risen above fee_APY → exit signal
144
+ → If borrow_APY has risen above fee_APY → exit signal
145
145
  ```
146
146
 
147
147
  ### Responding to health factor drops
148
148
 
149
149
  ```
150
150
  // Option A: Add collateral (raises health factor, cheapest)
151
- // Check allowance first — skip approve if already sufficient
151
+ // Check allowance first; skip approve if already sufficient
152
152
  read_wallet_allowances(owner_address: <wallet>, spender_address: <account>, token_addresses: ["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"], chain_id: 8453)
153
153
  write_wallet_approve(token_address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", spender_address: <account>, amount: "max_uint256", chain_id: 8453)
154
154
  write_account_deposit(account_address: <account>, asset_addresses: ["0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"], asset_amounts: ["<amount>"], chain_id: 8453)
155
155
 
156
156
  // Option B: Repay some WETH debt (reduces leverage)
157
- // NOTE: you must approve the WETH pool to spend WETH from your wallet first — check allowance, then approve if needed
157
+ // NOTE: you must approve the WETH pool to spend WETH from your wallet first: check allowance, then approve if needed
158
158
  read_wallet_allowances(owner_address: <wallet>, spender_address: "0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2", token_addresses: ["0x4200000000000000000000000000000000000006"], chain_id: 8453)
159
159
  write_wallet_approve(token_address: "0x4200000000000000000000000000000000000006", spender_address: "0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2", amount: "max_uint256", chain_id: 8453)
160
160
  write_account_repay(
@@ -178,7 +178,7 @@ write_account_deleverage(
178
178
 
179
179
  ### Closing
180
180
 
181
- **ALWAYS try the atomic close first** — it batches everything into 1-2 transactions instead of 6+.
181
+ **ALWAYS try the atomic close first**: it batches everything into 1-2 transactions instead of 6+.
182
182
 
183
183
  #### Preferred: Atomic close (1-2 transactions)
184
184
 
@@ -192,13 +192,13 @@ write_account_automations_delta(
192
192
  chain_id: 8453
193
193
  )
194
194
 
195
- // 1. Get account state — need asset list for the close call
195
+ // 1. Get account state (the close call needs the asset list)
196
196
  read_account_info(account_address: <account>, chain_id: 8453)
197
197
 
198
198
  // 2. Unstake if staked (required before close)
199
199
  write_account_stake(action: "unstake", asset_address: <staked_pm_address>, asset_id: <nft_id>, account_address: <account>, chain_id: 8453)
200
200
 
201
- // 3. Atomic close: burns LP + swaps all tokens to USDC + repays debt — ONE transaction
201
+ // 3. Atomic close: burns LP + swaps all tokens to USDC + repays debt in ONE transaction
202
202
  write_account_close(
203
203
  account_address: <account>,
204
204
  assets: [
@@ -242,7 +242,7 @@ write_account_withdraw(...) // withdraw all to wallet
242
242
  - IL: WETH price deviation from entry accumulates IL. Rebalancer mitigates but doesn't eliminate.
243
243
  - Liquidation: If WETH pumps sharply, health factor drops toward 0. Keep health factor above 0.5.
244
244
  - Borrow cost: WETH utilization spikes can make strategy unprofitable quickly.
245
- - Agent role: periodic health monitoring only — the rebalancer handles range management.
245
+ - Agent role: periodic health monitoring only; the rebalancer handles range management.
246
246
 
247
247
  ---
248
248
 
@@ -263,8 +263,8 @@ write_account_withdraw(...) // withdraw all to wallet
263
263
  | Objective | Maximize fees + yield | Reliable market presence |
264
264
  | Range | Narrow (high fee capture) | Wide or dynamic (capital protection) |
265
265
  | Rebalancing | Aggressive (stay in range) | Conservative (minimize cost) |
266
- | Leverage | Yes | No — protect principal |
267
- | IL tolerance | Moderate (offset by fees) | Low — preserving treasury |
266
+ | Leverage | Yes | No, protect principal |
267
+ | IL tolerance | Moderate (offset by fees) | Low, preserving treasury |
268
268
  | Success metric | Fee APY > borrow APY | Liquidity depth maintained |
269
269
 
270
270
  ### POL rebalancer behavior
@@ -274,7 +274,7 @@ The `protocol_owned_liquidity` strategy type uses a dynamic range algorithm (k1/
274
274
  ### Setup
275
275
 
276
276
  ```
277
- // Same tools, different intent — no leverage, wider slippage tolerance
277
+ // Same tools, different intent: no leverage, wider slippage tolerance
278
278
 
279
279
  // 1. Check allowance + approve treasury tokens (skip approve if already sufficient)
280
280
  read_wallet_allowances(owner_address: <treasury_wallet>, spender_address: <account>, token_addresses: [<token>], chain_id: 8453)
@@ -285,27 +285,26 @@ write_wallet_approve(token_address: <token>, spender_address: <account>, amount:
285
285
  // Use V3 + creditor only if you want the option to leverage later.
286
286
  write_account_create(
287
287
  salt: <random uint32>,
288
- account_version: 0, // V4 spot — no leverage needed for POL
288
+ account_version: 0, // V4 spot, no leverage needed for POL
289
289
  chain_id: 8453
290
290
  )
291
291
 
292
292
  // 3. Deposit treasury tokens
293
293
  write_account_deposit(account_address: <account>, ...)
294
294
 
295
- // 4. Open LP (no leverage — deposits are pulled from wallet)
295
+ // 4. Open LP (no leverage; deposits are pulled from wallet)
296
296
  write_account_add_liquidity(
297
297
  account_address: <account>,
298
298
  wallet_address: <treasury_wallet>,
299
299
  positions: [{ strategy_id: <from step 1> }],
300
300
  deposits: [{ asset: <token_address>, amount: <raw_amount>, decimals: <decimals> }],
301
- leverage: 0, // 0 = no leverage (NOT 1 — use 0 for unleveraged)
302
- slippage: 200, // 2% — wider tolerance for POL
301
+ leverage: 0, // 0 = no leverage (NOT 1; use 0 for unleveraged)
302
+ slippage: 200, // 2%, wider tolerance for POL
303
303
  chain_id: 8453
304
304
  )
305
305
 
306
306
  // 5. Enable the rebalancer on the POL strategy
307
- // The backend routes POL to the unified rebalancer and its POL strategy hook;
308
- // tuning params are part of the intent, all optional with the defaults shown.
307
+ // Tuning params are part of the intent, all optional with the defaults shown.
309
308
  write_account_automations(
310
309
  account_address: <account>,
311
310
  position_id: <lp_nft_id>,
@@ -340,11 +339,11 @@ read_account_pnl → track IL vs. fee income
340
339
  read_strategy_recommendation → check if rebalancing is needed
341
340
  ```
342
341
 
343
- **POL monitoring goal:** Ensure sufficient liquidity is deployed and treasury capital is not eroding excessively — not maximizing return.
342
+ **POL monitoring goal:** Ensure sufficient liquidity is deployed and treasury capital is not eroding excessively, not maximizing return.
344
343
 
345
344
  ## Upgrade to Aero (MetadexCL V1)
346
345
 
347
- Aero CL succeeds the Slipstream pools (Aerodrome on Base, Velodrome on Optimism) at the Aero launch, and the new AERO token succeeds the old one on Base. `write_account_aero_upgrade` upgrades one account in one flashAction signed by the owner: every Slipstream V1, V2 and V3 position, staked or not, moves into the Aero CL pool with the same pair and variant at the same range and tick spacing (when Aero has no pool at that tick spacing, the user picks another one), and every unit of old AERO (loose in the account, unclaimed rewards, an old-AERO pair) becomes the new AERO. Chains: Base and Optimism. Robinhood has nothing to upgrade.
346
+ Aero CL succeeds the Slipstream pools (Aerodrome on Base, Velodrome on Optimism) at the Aero launch, and the new AERO token succeeds the old one on Base. `write_account_aero_upgrade` upgrades one account in one flashAction signed by the owner. Every Slipstream V1, V2 and V3 position, staked or not, moves into the Aero CL pool with the same pair and variant, at the same range and tick spacing. When Aero has no pool at that tick spacing, the user picks another one. Every unit of old AERO (loose in the account, unclaimed rewards, an old-AERO pair) becomes the new AERO. Chains: Base and Optimism. Robinhood has nothing to upgrade.
348
347
 
349
348
  The backend decides what can move. Report its statuses and reasons as given; never decide eligibility yourself.
350
349
 
@@ -414,7 +413,7 @@ Pass `accounts` (up to 10 of one owner) instead of `account_address` for one pla
414
413
 
415
414
  ### Reconnecting automations
416
415
 
417
- The move mints a new position, so automations on the old Slipstream position stop applying. `managers_to_reconnect` lists the old managers (`kind`, `old_address`) and their Aero replacements (`new_address`). Call `write_account_automations` in `save` mode with the new `position_id` and the intents the account had. Omit `protocol` so the backend resolves `metadexcl_v1` from the position: a stale `slipstream_*` value would compile Slipstream managers. The save disables the old managers in the same transaction. When `old_managers_still_needed` is true a Slipstream position stays on the account (it waits for its Aero pool), so keep the old managers: enable the Aero position with `write_account_automations_delta` instead. Settings are recompiled from intents, not copied: restate custom rebalancer settings from `read_asset_manager_current`. Each Aero manager holds one config per account, so when several old Slipstream managers of one kind had different settings, ask the user which to keep. When an item has `target.tokens_flipped: true` the pair sorts the other way on Aero: swap `token0` and `token1` in the intents' token fields (`tokens`, `convert_tokens`, `profit_token`) use 1e6 minus the token0 ratios and swap `trigger_lower_tick_ratio` with `trigger_upper_tick_ratio`, or leave that automation off and tell the user. The reconnect is a separate transaction: until it confirms, the Aero positions run without automations, so a Safe should queue it right after the upgrade. On Optimism and Robinhood there is no CoW Swapper, so compounding a staked Aero position's xAERO reward is rejected there; `claim_rewards` works.
416
+ The move mints a new position, so automations on the old Slipstream position stop applying. `managers_to_reconnect` lists the old managers (`kind`, `old_address`) and their Aero replacements (`new_address`). Call `write_account_automations` in `save` mode with the new `position_id` and the intents the account had. Omit `protocol` so the backend resolves `metadexcl_v1` from the position: a stale `slipstream_*` value would compile Slipstream managers. The save disables the old managers in the same transaction. When `old_managers_still_needed` is true a Slipstream position stays on the account (it waits for its Aero pool), so keep the old managers: enable the Aero position with `write_account_automations_delta` instead. Settings are recompiled from intents, not copied: restate custom rebalancer settings from `read_asset_manager_current`. Each Aero manager holds one config per account, so when several old Slipstream managers of one kind had different settings, ask the user which to keep. When an item has `target.tokens_flipped: true` the pair sorts the other way on Aero: swap `token0` and `token1` in the intents' token fields (`tokens`, `convert_tokens`, `profit_token`), use 1e6 minus the token0 ratios, and swap `trigger_lower_tick_ratio` with `trigger_upper_tick_ratio`. Or leave that automation off and tell the user. The reconnect is a separate transaction: until it confirms, the Aero positions run without automations, so a Safe should queue it right after the upgrade. On Optimism and Robinhood there is no CoW Swapper, so compounding a staked Aero position's xAERO reward is rejected there; `claim_rewards` works.
418
417
 
419
418
  ### Margin vs spot
420
419
 
@@ -1,104 +0,0 @@
1
- ---
2
- name: arcadia-finance
3
- version: 1.4.0
4
- description: "DeFi liquidity management on Uniswap and Aero, live on Base, Optimism, Unichain and Robinhood. Deploy concentrated liquidity positions with automated rebalancing, compounding, yield optimization, and leverage, or provide single-sided liquidity to lending pools."
5
- metadata:
6
- openclaw:
7
- homepage: https://arcadia.finance
8
- requires:
9
- bins: [curl, jq]
10
- ---
11
-
12
- # Arcadia Finance
13
-
14
- > **Agent note:** `{baseDir}` refers to the directory containing this SKILL.md file. Resolve all `{baseDir}` paths relative to it.
15
-
16
- Arcadia helps users deploy concentrated liquidity positions on Uniswap, Aero, Aerodrome and Velodrome with automated rebalancing, compounding, yield optimization, and optional leverage, or provide single-sided liquidity to lending pools to earn borrower interest. Supported chains: Base (8453), Unichain (130), Optimism (10), Robinhood (4663).
17
-
18
- ## CLI Usage
19
-
20
- ```bash
21
- # Discover all available tools (run this first)
22
- {baseDir}/arcadia.sh --list
23
-
24
- # Call a specific tool
25
- {baseDir}/arcadia.sh <tool_name> '<json_args>'
26
- ```
27
-
28
- Requires: `curl`, `jq`. No other dependencies.
29
-
30
- ## Read Operations
31
-
32
- ```bash
33
- # List all accounts for a wallet
34
- {baseDir}/arcadia.sh read_wallet_accounts '{"wallet_address":"0x..."}'
35
-
36
- # Account details (health factor, collateral, debt, positions)
37
- {baseDir}/arcadia.sh read_account_info '{"account_address":"0x..."}'
38
-
39
- # Featured LP strategies with APY
40
- {baseDir}/arcadia.sh read_strategy_list '{"featured_only":true}'
41
-
42
- # Lending pools (TVL, APY, utilization)
43
- {baseDir}/arcadia.sh read_pool_list '{}'
44
-
45
- # Workflow guides (automation setup, strategy selection)
46
- {baseDir}/arcadia.sh read_guides '{"topic":"overview"}'
47
-
48
- # Available automations (rebalancer, compounder, yield claimer)
49
- {baseDir}/arcadia.sh read_asset_manager_intents '{}'
50
- ```
51
-
52
- ## Single-Sided Liquidity (Lending)
53
-
54
- Provide single-sided liquidity by depositing the pool's underlying asset into an Arcadia lending tranche (ERC-4626), earning interest from borrowers. Use `read_pool_list` to find `tranches[0].address` for each pool. Approve the tranche first (`write_wallet_approve`).
55
-
56
- ```bash
57
- # Lender deposit: lend 10 USDC into the USDC tranche, receive shares to your wallet
58
- {baseDir}/arcadia.sh write_pool_deposit '{"tranche_address":"0x...","assets":"10000000","receiver":"0x...","chain_id":8453}'
59
-
60
- # Lender exit: redeem shares back to the underlying asset
61
- {baseDir}/arcadia.sh write_pool_redeem '{"tranche_address":"0x...","shares":"10000000","receiver":"0x...","owner":"0x...","chain_id":8453}'
62
- ```
63
-
64
- `write_pool_deposit` is for lenders earning yield. For depositing collateral into an Arcadia account, use `write_account_deposit` instead.
65
-
66
- ## Write Operations
67
-
68
- All write tools return unsigned transactions `{ to, data, value, chainId }`. Sign with your wallet before broadcasting. See `{baseDir}/wallet-signing.md` for wallet options.
69
-
70
- ```bash
71
- # Open LP position (deposits + swaps + mints LP atomically)
72
- {baseDir}/arcadia.sh write_account_add_liquidity '{"account_address":"0x...","wallet_address":"0x...","positions":[{"strategy_id":123}],"deposits":[{"asset":"0x...","amount":"1000000","decimals":6}]}'
73
-
74
- # Close position (burn LP + swap + repay in one tx)
75
- {baseDir}/arcadia.sh write_account_close '{"account_address":"0x...","assets":[...],"receive_assets":[...]}'
76
-
77
- # Create a new account (salt must be unique per wallet)
78
- {baseDir}/arcadia.sh write_account_create '{"wallet_address":"0x...","salt":1,"chain_id":8453}'
79
-
80
- # Enable automation
81
- {baseDir}/arcadia.sh read_asset_manager_intents '{"account_address":"0x...","chain_id":8453}'
82
- {baseDir}/arcadia.sh write_account_automations '{"account_address":"0x...","position_id":12345,"intents":[{"kind":"compound_fees"},{"kind":"rebalance"}],"chain_id":8453}'
83
- ```
84
-
85
- ## Configuration
86
-
87
- The CLI connects to `https://mcp.arcadia.finance/mcp` by default. Set `ARCADIA_MCP_URL` to override (e.g. for local development).
88
-
89
- ## Data and Safety
90
-
91
- This skill connects to Arcadia's public API at `https://mcp.arcadia.finance/mcp` (override via `ARCADIA_MCP_URL`). Tool calls send public wallet addresses, account addresses, and transaction parameters to this server. This is the same data that is publicly visible on-chain. No private keys or signing capabilities are transmitted.
92
-
93
- - Write tools return unsigned transactions only. Never auto-sign.
94
- - Always confirm transaction details with the user before signing.
95
- - Check account health factor with `read_account_info` before risky operations.
96
- - Do not pass private keys or secrets as tool arguments. Only public addresses and amounts are needed.
97
-
98
- ## References
99
-
100
- - Full tool documentation: https://mcp.arcadia.finance/llms-full.txt
101
- - Contract addresses: see `{baseDir}/contracts.md`
102
- - Signing guide: see `{baseDir}/wallet-signing.md`
103
- - Website: https://arcadia.finance
104
- - Docs: https://docs.arcadia.finance
@@ -1,80 +0,0 @@
1
- #!/bin/bash
2
- # CLI wrapper for Arcadia Finance MCP server.
3
- # Uses curl + jq to call tools over Streamable HTTP.
4
- #
5
- # Usage:
6
- # ./arcadia.sh <tool_name> '<json_args>'
7
- # ./arcadia.sh --list
8
- #
9
- # Requires: curl, jq
10
-
11
- set -euo pipefail
12
-
13
- MCP_URL="${ARCADIA_MCP_URL:-https://mcp.arcadia.finance/mcp}"
14
-
15
- for bin in curl jq; do
16
- if ! command -v "$bin" >/dev/null 2>&1; then
17
- echo "Required: $bin" >&2
18
- exit 1
19
- fi
20
- done
21
-
22
- TOOL_NAME="${1:-}"
23
- ARGS_JSON="${2:-"{}"}"
24
-
25
- if [[ -z "$TOOL_NAME" ]]; then
26
- echo "Usage: $0 <tool_name> '<json_args>'"
27
- echo " $0 --list"
28
- exit 1
29
- fi
30
-
31
- # Request metadata MCP 2026-07-28 requires on every call.
32
- META='{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"arcadia-openclaw","version":"1.4.0"}}'
33
-
34
- # POST one request; the body is plain JSON or a single SSE data: line.
35
- mcp_post() {
36
- local method="$1" name="$2" payload="$3" body json message
37
- body=$(curl -sf -X POST "$MCP_URL" \
38
- -H "Content-Type: application/json" \
39
- -H "Accept: application/json, text/event-stream" \
40
- -H "Mcp-Protocol-Version: 2026-07-28" \
41
- -H "Mcp-Method: $method" \
42
- ${name:+-H "Mcp-Name: $name"} \
43
- -d "$payload") || { echo "ERROR: request to $MCP_URL failed" >&2; return 1; }
44
- json=$(printf '%s\n' "$body" | sed -n 's/^data: //p; /^{/p' | head -1)
45
- message=$(jq -r '.error.message // empty' <<<"$json")
46
- if [[ -n "$message" ]]; then
47
- echo "ERROR: $message" >&2
48
- return 1
49
- fi
50
- printf '%s\n' "$json"
51
- }
52
-
53
- if [[ "$TOOL_NAME" == "--list" ]]; then
54
- PAYLOAD=$(jq -nc --argjson meta "$META" '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{"_meta":$meta}}')
55
-
56
- mcp_post "tools/list" "" "$PAYLOAD" | jq -r '.result.tools | sort_by(.name)[] | "\(.name): \(.description[0:120])"'
57
- else
58
- if ! echo "$ARGS_JSON" | jq . >/dev/null 2>&1; then
59
- echo "ERROR: Invalid JSON arguments: $ARGS_JSON" >&2
60
- exit 1
61
- fi
62
-
63
- PAYLOAD=$(jq -nc --arg name "$TOOL_NAME" --argjson args "$ARGS_JSON" --argjson meta "$META" \
64
- '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":$name,"arguments":$args,"_meta":$meta}}')
65
-
66
- RESULT=$(mcp_post "tools/call" "$TOOL_NAME" "$PAYLOAD")
67
- IS_ERROR=$(echo "$RESULT" | jq -r '.result.isError // false')
68
- TEXT=$(echo "$RESULT" | jq -r '.result.content[0].text // empty')
69
-
70
- if [[ "$IS_ERROR" == "true" ]]; then
71
- if echo "$TEXT" | grep -qi "internal exception\|500\|internal server error"; then
72
- echo "ERROR: Request failed. Check that IDs and addresses are valid. Details: $TEXT" >&2
73
- else
74
- echo "ERROR: $TEXT" >&2
75
- fi
76
- exit 1
77
- else
78
- echo "$TEXT"
79
- fi
80
- fi
@@ -1,66 +0,0 @@
1
- # Arcadia Contract Addresses
2
-
3
- Supported chains: Base (8453), Unichain (130), Optimism (10), Robinhood (4663).
4
-
5
- ## Shared Addresses
6
-
7
- | Contract | Address |
8
- | ---------- | ------------------------------------------ |
9
- | Factory | 0xDa14Fdd72345c4d2511357214c5B89A919768e59 |
10
- | Registry | 0xd0690557600eb8Be8391D1d97346e2aab5300d5f |
11
- | Liquidator | 0xA4B0b9fD1d91fA2De44F6ABFd59cC14bA1E1a7Af |
12
-
13
- Lending pools (same CREATE2 addresses across chains; Unichain has none):
14
-
15
- | Pool | Address | Chains |
16
- | -------- | ------------------------------------------ | ------------------------- |
17
- | LP_WETH | 0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2 | Base, Optimism, Robinhood |
18
- | LP_USDC | 0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1 | Base, Optimism |
19
- | LP_CBBTC | 0xa37E9b4369dc20940009030BfbC2088F09645e3B | Base only |
20
- | LP_USDG | 0xf37c0C5996503Fdd2b5CCCE36E659cD30393AE59 | Robinhood only |
21
-
22
- ## Asset Managers
23
-
24
- Rebalancers, compounders, and yield claimers are deployed per DEX protocol. Most share the same address on every chain.
25
-
26
- Protocol availability per chain:
27
-
28
- - **Base**: Slipstream V1, V2, V3, Uniswap V3, V4, Aero CL (MetadexCL V1), CoW Swap.
29
- - **Optimism**: Slipstream V1, V3, Uniswap V3, V4, Aero CL (MetadexCL V1) (no V2, no CoW Swap). V3 uses different AM addresses than Base (exception to the deterministic deployment pattern).
30
- - **Unichain**: Slipstream V1, Uniswap V3, V4 (no V2/V3, no CoW Swap)
31
- - **Robinhood**: Uniswap V3, V4 and Aero CL (no Slipstream V1-V3, no Aerodrome V1, no CoW Swap). Lending pools are WETH and USDG, there is no USDC on this chain.
32
-
33
- Use `read_asset_manager_intents` to discover available automations and their addresses per chain.
34
-
35
- ## Chain-Specific Tokens
36
-
37
- ### Base (8453)
38
-
39
- | Token | Address | Decimals |
40
- | ------------- | ------------------------------------------ | -------- |
41
- | WETH | 0x4200000000000000000000000000000000000006 | 18 |
42
- | USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 | 6 |
43
- | cbBTC | 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf | 8 |
44
- | AERO | 0x3f5bF3EdAc59d650D8fDf9657a71F2f904A3a4Ee | 18 |
45
- | AERO (legacy) | 0x940181a94A35A4569E4529A3CDfB74e38FD98631 | 18 |
46
-
47
- ### Optimism (10)
48
-
49
- | Token | Address | Decimals |
50
- | ------ | ------------------------------------------ | -------- |
51
- | WETH | 0x4200000000000000000000000000000000000006 | 18 |
52
- | USDC | 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85 | 6 |
53
- | OP | 0x4200000000000000000000000000000000000042 | 18 |
54
- | VELO | 0x9560e827aF36c94D2Ac33a39bCE1Fe78631088Db | 18 |
55
- | WBTC | 0x68f180fcCe6836688e9084f035309E29Bf0A2095 | 8 |
56
- | wstETH | 0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb | 18 |
57
-
58
- ### Unichain (130)
59
-
60
- | Token | Address | Decimals |
61
- | ----- | ------------------------------------------ | -------- |
62
- | WETH | 0x4200000000000000000000000000000000000006 | 18 |
63
- | USDC | 0x078D782b760474a361dDA0AF3839290b0EF57AD6 | 6 |
64
- | WBTC | 0x0555E30da8f98308EdB960aa94C0Db47230d2B9c | 8 |
65
- | UNI | 0x8f187aA05619a017077f5308904739877ce9eA21 | 18 |
66
- | VELO | 0x7f9AdFbd38b669F03d1d11000Bc76b9AaEA28A81 | 18 |
@@ -1,11 +0,0 @@
1
- # Signing Unsigned Transactions
2
-
3
- All Arcadia write tools return unsigned transactions as `{ to, data, value, chainId }`. You need a separate wallet to sign and broadcast. Never expose private keys to the agent.
4
-
5
- ## Wallet MCP Servers (recommended)
6
-
7
- - MCP Wallet Signer (github.com/nikicat/mcp-wallet-signer): routes to browser wallet (MetaMask, Rabby), non-custodial
8
- - Phantom MCP (@phantom/mcp-server): for Phantom wallet users
9
- - Privy MCP (github.com/incentivai-io/privy-mcp-server): wallet infrastructure
10
- - Coinbase AgentKit (github.com/coinbase/agentkit): wallet-agnostic signing
11
- - Safe MCP (github.com/safer-sh/safer): multi-sig via Safe