@arcadia-finance/mcp-server 0.4.6 → 0.5.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.
- package/README.md +26 -31
- package/dist/clients/api.js +23 -0
- package/dist/config/addresses.js +49 -201
- package/dist/prompts/workflows.js +15 -13
- package/dist/resources/guides.js +1 -1
- package/dist/tools/index.js +4 -14
- package/dist/tools/output-schemas.js +42 -6
- package/dist/tools/read/account.js +80 -42
- package/dist/tools/read/asset-managers.js +138 -113
- package/dist/tools/read/guides.js +3 -3
- package/dist/tools/write/asset-managers/automations.js +241 -0
- package/dist/tools/write/asset-managers/intents.js +247 -0
- package/dist/tools/write/asset-managers/shared.js +0 -26
- package/llms-full.txt +39 -80
- package/llms.txt +9 -14
- package/package.json +3 -3
- package/server.json +2 -2
- package/skills/clamm-liquidity/SKILL.md +30 -27
- package/skills/clamm-liquidity/automation.md +153 -76
- package/skills/clamm-liquidity/selection.md +8 -7
- package/skills/clamm-liquidity/strategies.md +40 -34
- package/skills/openclaw/SKILL.md +3 -3
- package/dist/tools/write/asset-managers/compounder.js +0 -113
- package/dist/tools/write/asset-managers/cow-swapper.js +0 -50
- package/dist/tools/write/asset-managers/encoding.js +0 -162
- package/dist/tools/write/asset-managers/merkl-operator.js +0 -52
- package/dist/tools/write/asset-managers/rebalancer.js +0 -109
- package/dist/tools/write/asset-managers/set-asset-managers.js +0 -76
- package/dist/tools/write/asset-managers/yield-claimer.js +0 -117
package/llms-full.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
Arcadia lets users deploy concentrated liquidity positions with automated rebalancing, compounding, yield optimization, and leverage, or provide single-sided liquidity to lending pools to earn borrower interest. This MCP server exposes the full protocol as
|
|
7
|
+
Arcadia lets users deploy concentrated liquidity positions with automated rebalancing, compounding, yield optimization, and leverage, or provide single-sided liquidity to lending pools to earn borrower interest. This MCP server exposes the full protocol as 35 tools:
|
|
8
8
|
|
|
9
9
|
- **Account management**: health factor, collateral, debt, positions, PnL, history
|
|
10
10
|
- **Wallet**: ERC20 balances, allowances, owned accounts, points
|
|
@@ -24,7 +24,7 @@ npx -y @arcadia-finance/mcp-server
|
|
|
24
24
|
|
|
25
25
|
Or connect to the remote server: `https://mcp.arcadia.finance/mcp`
|
|
26
26
|
|
|
27
|
-
## Read Tools (
|
|
27
|
+
## Read Tools (18)
|
|
28
28
|
|
|
29
29
|
### read.account.info
|
|
30
30
|
|
|
@@ -153,10 +153,20 @@ Parameters:
|
|
|
153
153
|
|
|
154
154
|
### read.asset_manager.intents
|
|
155
155
|
|
|
156
|
-
List
|
|
156
|
+
List the automation intents Arcadia supports with the parameters each accepts. Pass `account_address` to also get live per-account availability, including the compatibility rule blocking anything unavailable.
|
|
157
157
|
|
|
158
158
|
Parameters:
|
|
159
|
-
- `
|
|
159
|
+
- `account_address` (string, optional): Include it to get live per-account availability
|
|
160
|
+
- `position_id` (number, optional): Scope availability to one LP position. Requires account_address
|
|
161
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)
|
|
162
|
+
|
|
163
|
+
### read.asset_manager.current
|
|
164
|
+
|
|
165
|
+
Read which asset managers are enabled on an account, with their decoded on-chain configuration, the intents they map to, Merkl claim state, and any superseded managers that should be cleared.
|
|
166
|
+
|
|
167
|
+
Parameters:
|
|
168
|
+
- `account_address` (string, required): Arcadia account address
|
|
169
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)
|
|
160
170
|
|
|
161
171
|
### read.guides
|
|
162
172
|
|
|
@@ -165,7 +175,7 @@ Get Arcadia workflow guides and reference documentation.
|
|
|
165
175
|
Parameters:
|
|
166
176
|
- `topic` (enum, optional): overview | automation | strategies | selection
|
|
167
177
|
|
|
168
|
-
## Write Tools (
|
|
178
|
+
## Write Tools (16)
|
|
169
179
|
|
|
170
180
|
All write tools return unsigned transactions as `{ to, data, value, chainId }`.
|
|
171
181
|
|
|
@@ -345,91 +355,40 @@ Parameters:
|
|
|
345
355
|
- `slippage` (number, default: 100): Basis points, 100 = 1%
|
|
346
356
|
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)
|
|
347
357
|
|
|
348
|
-
### write.account.
|
|
349
|
-
|
|
350
|
-
Build an unsigned setAssetManagers transaction from encoded intent args.
|
|
351
|
-
|
|
352
|
-
Parameters:
|
|
353
|
-
- `account_address` (string, required): Arcadia account address
|
|
354
|
-
- `asset_managers` (string[], required): Asset manager addresses from intent tools
|
|
355
|
-
- `statuses` (boolean[], required): Enable/disable flags from intent tools
|
|
356
|
-
- `datas` (string[], required): Encoded callback data from intent tools (hex)
|
|
357
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)
|
|
358
|
-
|
|
359
|
-
### write.asset_manager.rebalancer
|
|
360
|
-
|
|
361
|
-
Encode args for the rebalancer automation.
|
|
362
|
-
|
|
363
|
-
Parameters:
|
|
364
|
-
- `dex_protocol` (enum, required): slipstream | slipstream_v2 | staked_slipstream | staked_slipstream_v2 | uniV3 | uniV4
|
|
365
|
-
- `enabled` (boolean, default: true): Enable or disable
|
|
366
|
-
- `compound_leftovers` (enum, default: "all"): all | none | token0 | token1
|
|
367
|
-
- `optimal_token0_ratio` (number, default: 500000): Target token0 ratio scaled by 1e6 (500000 = 50%)
|
|
368
|
-
- `trigger_lower_ratio` (number, default: 0): Offset from tick_lower, fraction of tick range, scaled by 1e6
|
|
369
|
-
- `trigger_upper_ratio` (number, default: 0): Offset from tick_upper, fraction of tick range, scaled by 1e6
|
|
370
|
-
- `min_rebalance_time` (number, default: 3600): Min seconds between rebalances
|
|
371
|
-
- `max_rebalance_time` (number, default: 1e12): Max seconds before forced rebalance
|
|
372
|
-
- `strategy_hook` (string, optional): Custom strategy hook address
|
|
373
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)
|
|
374
|
-
|
|
375
|
-
### write.asset_manager.compounder
|
|
376
|
-
|
|
377
|
-
Encode args for the standalone compounder automation.
|
|
378
|
-
|
|
379
|
-
Parameters:
|
|
380
|
-
- `dex_protocol` (enum, required): slipstream | slipstream_v2 | staked_slipstream | staked_slipstream_v2 | uniV3 | uniV4
|
|
381
|
-
- `enabled` (boolean, default: true): Enable or disable
|
|
382
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)
|
|
383
|
-
|
|
384
|
-
### write.asset_manager.compounder_staked
|
|
385
|
-
|
|
386
|
-
Encode args for compounder + CowSwap for staked LP positions.
|
|
358
|
+
### write.account.automations
|
|
387
359
|
|
|
388
|
-
|
|
389
|
-
- `dex_protocol` (enum, required): slipstream | slipstream_v2 | staked_slipstream | staked_slipstream_v2 | uniV3 | uniV4
|
|
390
|
-
- `sell_tokens` (string[], required): Token addresses to sell via CowSwap
|
|
391
|
-
- `buy_token` (string, required): Token address to buy (USDC, WETH, cbBTC)
|
|
392
|
-
- `enabled` (boolean, default: true): Enable or disable
|
|
393
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)
|
|
360
|
+
Configure an account's automations from a list of intents and return the unsigned setAssetManagers transaction. The backend resolves which asset managers each intent needs, validates the combination, encodes the metadata and builds the calldata, so you describe the desired outcome rather than the contracts.
|
|
394
361
|
|
|
395
|
-
|
|
362
|
+
In save mode the `intents` array is the complete desired state: any automation left out is disabled by the returned transaction, and a single intent with `enabled: false` disables everything. When a compatibility rule fires the tool returns an error with the rule name and reason, and no transaction. There is also deliberately no transaction when the account already matches the request (`no_changes_needed`), when the Tenderly simulation predicts a revert (an error), or in preview mode (`preview_only`).
|
|
396
363
|
|
|
397
|
-
|
|
364
|
+
Intent kinds:
|
|
365
|
+
- `compound_fees`: reinvest earned fees/rewards into the LP. Optional `tokens` (token0|token1|reward) scopes it per token
|
|
366
|
+
- `claim_rewards`: claim yield out. `config.mode` as_earned or convert_to, `config.destination` account or wallet, `config.buy_token`, `config.recipient`, `config.tokens`, `config.convert_tokens`
|
|
367
|
+
- `add_to_lp`: fold idle pool-token balances into the LP. Optional `tokens` (token0|token1), opt-in per token
|
|
368
|
+
- `claim_merkl`: auto-claim Merkl incentive rewards. `config.destination`, `config.reward_recipient`. Needs no position context
|
|
369
|
+
- `rebalance`: reposition the LP. `strategy.kind` out_of_range (default), take_profit, or protocol_owned_liquidity, plus optional `max_tolerance` / `min_liquidity_ratio` (1e18-scaled)
|
|
398
370
|
|
|
399
371
|
Parameters:
|
|
400
|
-
- `
|
|
401
|
-
- `
|
|
402
|
-
- `
|
|
403
|
-
- `
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
Parameters:
|
|
410
|
-
- `dex_protocol` (enum, required): slipstream | slipstream_v2 | staked_slipstream | staked_slipstream_v2 | uniV3 | uniV4
|
|
411
|
-
- `sell_tokens` (string[], required): Token addresses to sell
|
|
412
|
-
- `buy_token` (string, required): Token address to receive after swap
|
|
413
|
-
- `fee_recipient` (string, required): Address to receive claimed fees
|
|
414
|
-
- `enabled` (boolean, default: true): Enable or disable
|
|
372
|
+
- `account_address` (string, required): Arcadia account address
|
|
373
|
+
- `intents` (object[], required): Complete desired automation state, at least one intent
|
|
374
|
+
- `mode` (enum, default: "save"): save diffs against on-chain state and returns a signable transaction that also disables anything omitted; preview resolves and validates only, returning a plan and no transaction
|
|
375
|
+
- `position_id` (number, optional): LP position id. Supply it and the backend fetches protocol, staked flag, tokens and reward tokens
|
|
376
|
+
- `protocol` (enum, optional): Only needed without position_id. Accepts slipstream_v1 | slipstream_v2 | slipstream_v3 | uniswap_v3 | uniswap_v4, or the dex_protocol spellings (slipstream, staked_slipstream_v3, uniV3, ...) which imply is_staked
|
|
377
|
+
- `is_staked` (boolean, optional): Whether the LP position is staked
|
|
378
|
+
- `token0` / `token1` (string, optional): Pool token addresses
|
|
379
|
+
- `reward_tokens` (string[], optional): Staking reward token addresses
|
|
380
|
+
- `owner` (string, optional): Account owner EOA, used to resolve wallet payout targets
|
|
415
381
|
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)
|
|
416
382
|
|
|
417
|
-
### write.
|
|
383
|
+
### write.account.automations_delta
|
|
418
384
|
|
|
419
|
-
|
|
385
|
+
Apply an explicit change to an account's automations and return the unsigned setAssetManagers transaction. A delta, not a full desired state: automations not mentioned are left untouched. Superseded managers still set on the account are force-disabled regardless.
|
|
420
386
|
|
|
421
387
|
Parameters:
|
|
422
|
-
- `
|
|
423
|
-
- `
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
Encode args for the Merkl operator automation.
|
|
428
|
-
|
|
429
|
-
Parameters:
|
|
430
|
-
- `reward_recipient` (string, required): Address to receive Merkl rewards
|
|
431
|
-
- `enabled` (boolean, default: true): Enable or disable
|
|
432
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)
|
|
388
|
+
- `account_address` (string, required): Arcadia account address
|
|
389
|
+
- `enable` (object[], default: []): Intents to switch on, same shapes as write.account.automations
|
|
390
|
+
- `disable` (string[], default: []): Asset-manager addresses to switch off, as returned by read.asset_manager.current
|
|
391
|
+
- position context params and `chain_id`: same as write.account.automations
|
|
433
392
|
|
|
434
393
|
## Dev Tools (1)
|
|
435
394
|
|
package/llms.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
Arcadia lets users deploy concentrated liquidity positions with automated rebalancing, compounding, yield optimization, and leverage, or provide single-sided liquidity to lending pools to earn borrower interest. This MCP server exposes the full protocol as
|
|
7
|
+
Arcadia lets users deploy concentrated liquidity positions with automated rebalancing, compounding, yield optimization, and leverage, or provide single-sided liquidity to lending pools to earn borrower interest. This MCP server exposes the full protocol as 35 tools:
|
|
8
8
|
|
|
9
9
|
- **Account management**: health factor, collateral, debt, positions, PnL, history
|
|
10
10
|
- **Wallet**: ERC20 balances, allowances, owned accounts, points
|
|
@@ -12,7 +12,7 @@ Arcadia lets users deploy concentrated liquidity positions with automated rebala
|
|
|
12
12
|
- **Single-sided liquidity**: deposit a single asset into a lending pool (ERC-4626 tranche) to earn borrower interest
|
|
13
13
|
- **LP strategies**: concentrated liquidity strategies with APY per range width, recommendations
|
|
14
14
|
- **Transaction building**: unsigned calldata for deposits, borrows, swaps, LP minting/closing, staking
|
|
15
|
-
- **Automation**: configure
|
|
15
|
+
- **Automation**: configure automations from intents (compound fees, claim rewards, add to LP, rebalance, claim Merkl); the backend resolves the asset managers and returns the calldata
|
|
16
16
|
|
|
17
17
|
All write tools return unsigned transactions (`{ to, data, value, chainId }`). Signing is the client's responsibility.
|
|
18
18
|
|
|
@@ -24,9 +24,9 @@ npx -y @arcadia-finance/mcp-server
|
|
|
24
24
|
|
|
25
25
|
Or connect to the remote server: `https://mcp.arcadia.finance/mcp`
|
|
26
26
|
|
|
27
|
-
## Tools (
|
|
27
|
+
## Tools (35 total)
|
|
28
28
|
|
|
29
|
-
### Read (
|
|
29
|
+
### Read (18)
|
|
30
30
|
|
|
31
31
|
- read.account.info: account overview with health factor, collateral, debt, positions, liquidation price, automation status
|
|
32
32
|
- read.account.history: historical account value over time
|
|
@@ -44,9 +44,10 @@ Or connect to the remote server: `https://mcp.arcadia.finance/mcp`
|
|
|
44
44
|
- read.strategy.info: full detail for a specific LP strategy
|
|
45
45
|
- read.strategy.recommendation: rebalancing recommendation for an account
|
|
46
46
|
- read.guides: reference guides for automation, strategies, addresses
|
|
47
|
-
- read.asset_manager.intents:
|
|
47
|
+
- read.asset_manager.intents: automation intents and their params; pass account_address for live per-account availability
|
|
48
|
+
- read.asset_manager.current: automations enabled on an account, with decoded per-manager config, mapped intents, Merkl state, and superseded managers
|
|
48
49
|
|
|
49
|
-
### Write (
|
|
50
|
+
### Write (16)
|
|
50
51
|
|
|
51
52
|
- write.wallet.approve: approve ERC20/ERC721 for spending
|
|
52
53
|
- write.pool.deposit: deposit the pool's underlying asset into an ERC-4626 tranche to earn lender yield
|
|
@@ -62,14 +63,8 @@ Or connect to the remote server: `https://mcp.arcadia.finance/mcp`
|
|
|
62
63
|
- write.account.deleverage: repay debt by selling collateral
|
|
63
64
|
- write.account.close: atomic close that burns LP, swaps, and repays in one tx
|
|
64
65
|
- write.account.stake: stake, unstake, or claim LP rewards
|
|
65
|
-
- write.account.
|
|
66
|
-
- write.
|
|
67
|
-
- write.asset_manager.compounder: encode standalone compounder args
|
|
68
|
-
- write.asset_manager.compounder_staked: encode compounder + CowSwap for staked positions
|
|
69
|
-
- write.asset_manager.yield_claimer: encode yield claimer args
|
|
70
|
-
- write.asset_manager.yield_claimer_cowswap: encode yield claimer + CowSwap args
|
|
71
|
-
- write.asset_manager.cow_swapper: encode direct CowSwap mode args
|
|
72
|
-
- write.asset_manager.merkl_operator: encode Merkl reward claimer args
|
|
66
|
+
- write.account.automations: configure automations from an intents array (complete desired state), returns the unsigned setAssetManagers tx
|
|
67
|
+
- write.account.automations_delta: switch individual automations on or off, leaving the rest untouched
|
|
73
68
|
|
|
74
69
|
### Dev (1)
|
|
75
70
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcadia-finance/mcp-server",
|
|
3
3
|
"mcpName": "io.github.arcadia-finance/mcp-server",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.1",
|
|
5
5
|
"description": "MCP server for Arcadia Finance. Deploy concentrated liquidity on Uniswap, Aerodrome, and Velodrome with automated rebalancing, compounding, yield optimization, and leverage, or single-sided liquidity into lending pools. Base, Unichain, and Optimism.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "AGPL-3.0",
|
|
8
8
|
"packageManager": "yarn@4.13.0",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/arcadia-finance/mcp-server.git"
|
|
11
|
+
"url": "git+https://github.com/arcadia-finance/mcp-server.git"
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://arcadia.finance",
|
|
14
14
|
"keywords": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"LICENSE.md"
|
|
46
46
|
],
|
|
47
47
|
"bin": {
|
|
48
|
-
"arcadia-mcp": "
|
|
48
|
+
"arcadia-mcp": "dist/index.js"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "rm -rf dist && tsc && cp src/abis/*.json dist/abis/",
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.arcadia-finance/mcp-server",
|
|
4
4
|
"title": "Arcadia Finance",
|
|
5
5
|
"description": "Concentrated liquidity on Uniswap/Aerodrome (rebalance, compound, leverage) or single-sided lending.",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.5.1",
|
|
7
7
|
"websiteUrl": "https://arcadia.finance",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/arcadia-finance/mcp-server",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "@arcadia-finance/mcp-server",
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.5.1",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: clamm-liquidity
|
|
3
|
-
description: Agent guide for clAMM management on Arcadia Finance. Covers
|
|
3
|
+
description: Agent guide for clAMM management on Arcadia Finance. Covers 34 MCP tools (+1 dev), intent-based automation setup (compound fees, claim rewards, add to LP, rebalance, claim Merkl), single-sided liquidity via ERC-4626 tranches, strategy selection framework, and strategy templates including delta neutral leveraged LP and protocol-owned liquidity.
|
|
4
4
|
user-invocable: true
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -47,7 +47,7 @@ Arcadia's flash-action tools can batch multiple DeFi operations into a single at
|
|
|
47
47
|
|
|
48
48
|
**Batched write tools (`write.account.add_liquidity`, `write.account.close`, `write.account.deleverage`, `write.account.swap`, `write.account.remove_liquidity`, `write.account.stake`) return time-sensitive calldata** — sign and broadcast promptly; calldata may expire after 30–60 seconds depending on market conditions. If a transaction reverts due to price movement, rebuild and retry at least once before falling back to individual tools.
|
|
49
49
|
|
|
50
|
-
## MCP Tools (
|
|
50
|
+
## MCP Tools (34 + 1 dev)
|
|
51
51
|
|
|
52
52
|
### Read Tools
|
|
53
53
|
|
|
@@ -68,36 +68,37 @@ Arcadia's flash-action tools can batch multiple DeFi operations into a single at
|
|
|
68
68
|
| `read.strategy.info` | Detail for a specific strategy by `strategy_id`, including range-width APY breakdown. |
|
|
69
69
|
| `read.point_leaderboard` | Points leaderboard. No `chain_id` needed — points are cross-chain. |
|
|
70
70
|
| `read.strategy.recommendation` | Rebalancing recommendation for an account. Uses 1d APY (not 7d like `read.strategy.list`), so numbers may differ. |
|
|
71
|
-
| `read.asset_manager.intents` | List
|
|
71
|
+
| `read.asset_manager.intents` | List the automation intents and their params. Pass `account_address` for live per-account availability plus the rule blocking anything unavailable. |
|
|
72
|
+
| `read.asset_manager.current` | What is enabled on an account now: decoded per-manager config, the intents it maps to, Merkl claim state, and superseded managers to clear. |
|
|
72
73
|
| `read.guides` | Reference guides: `automation` (AM setup), `selection` (pool evaluation), `strategies` (step-by-step templates). |
|
|
73
74
|
|
|
74
75
|
### Preferred Write Tools (atomic/multi-step — use these first)
|
|
75
76
|
|
|
76
77
|
These tools batch multiple operations into ONE atomic transaction. Always prefer these over individual tools.
|
|
77
78
|
|
|
78
|
-
| Tool
|
|
79
|
-
|
|
|
80
|
-
| `write.account.add_liquidity`
|
|
81
|
-
| `write.account.close`
|
|
82
|
-
| `write.account.deleverage`
|
|
83
|
-
| `write.account.
|
|
79
|
+
| Tool | Batches | When to use |
|
|
80
|
+
| ----------------------------- | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
|
|
81
|
+
| `write.account.add_liquidity` | deposit + swap + mint LP + optional borrow | Open LP position. Do NOT call `write.account.deposit` separately — this handles wallet transfer atomically. |
|
|
82
|
+
| `write.account.close` | burn LP + swap + repay debt (up to 3 steps) | Close/exit a position. ALWAYS try this first. Tokens stay in account — follow up with `write.account.withdraw`. |
|
|
83
|
+
| `write.account.deleverage` | swap collateral + repay debt | Repay debt using account collateral (no wallet tokens needed). Preferred for health factor fixes. |
|
|
84
|
+
| `write.account.automations` | resolve intents + validate + build setAssetManagers tx | Configure automations. Pass the full desired intents array; the backend picks the managers and encodes them. |
|
|
84
85
|
|
|
85
86
|
### Individual Write Tools (use when batched tools fail or for standalone operations)
|
|
86
87
|
|
|
87
|
-
| Tool
|
|
88
|
-
|
|
|
89
|
-
| `write.wallet.approve`
|
|
90
|
-
| `write.account.create`
|
|
91
|
-
| `write.account.deposit`
|
|
92
|
-
| `write.account.withdraw`
|
|
93
|
-
| `write.account.borrow`
|
|
94
|
-
| `write.account.repay`
|
|
95
|
-
| `write.account.swap`
|
|
96
|
-
| `write.account.remove_liquidity`
|
|
97
|
-
| `write.account.stake`
|
|
98
|
-
| `write.pool.deposit`
|
|
99
|
-
| `write.pool.redeem`
|
|
100
|
-
| `write.
|
|
88
|
+
| Tool | When to use |
|
|
89
|
+
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
90
|
+
| `write.wallet.approve` | Approve a token for spending. **Required before `write.account.deposit`** and before `write.account.add_liquidity` (when depositing from wallet). Call `read.wallet.allowances` first to check if already approved. |
|
|
91
|
+
| `write.account.create` | Create a new Arcadia account (one-time setup). Use `account_version: 0` for the latest version (recommended). |
|
|
92
|
+
| `write.account.deposit` | Deposit ERC20 tokens as collateral. NOT needed before `write.account.add_liquidity` — that tool handles deposits atomically. |
|
|
93
|
+
| `write.account.withdraw` | Withdraw assets to account owner. Account version auto-detected on-chain. Params: `asset_addresses[]`, `asset_amounts[]` (exact amounts, no max_uint256), optional `asset_ids[]` (0 for ERC20). |
|
|
94
|
+
| `write.account.borrow` | Borrow from a lending pool. NOT needed for leveraged LP — `write.account.add_liquidity` handles borrowing internally. |
|
|
95
|
+
| `write.account.repay` | Repay debt from wallet (approve pool first). Use `amount: "max_uint256"` to repay in full. For repaying with account collateral, prefer `write.account.deleverage`. |
|
|
96
|
+
| `write.account.swap` | Swap assets within account (backend handles routing). For closing positions, prefer `write.account.close`. |
|
|
97
|
+
| `write.account.remove_liquidity` | PARTIAL liquidity decrease only (position stays open). For full LP removal/exit, use `write.account.close`. |
|
|
98
|
+
| `write.account.stake` | Stake, unstake, or claim rewards for an LP position. Direction auto-detected from `asset_address`. |
|
|
99
|
+
| `write.pool.deposit` | **Lend to earn yield.** Deposit the pool's underlying asset (USDC / WETH / cbBTC) into the ERC-4626 tranche, receive tranche shares that accrue interest from borrowers. Requires prior `write.wallet.approve` to the tranche. **Different from `write.account.deposit`**: that deposits collateral into your Arcadia account; this deposits as a lender. |
|
|
100
|
+
| `write.pool.redeem` | **Lender exit.** Burn tranche shares and redeem the underlying asset, including accrued interest. Pass the owner's share balance (or a partial amount) in `shares`. |
|
|
101
|
+
| `write.account.automations_delta` | Change one automation without restating the rest: `enable` takes intents, `disable` takes asset-manager addresses from `read.asset_manager.current`. Prefer `write.account.automations` when setting the full desired state. See automation.md. |
|
|
101
102
|
|
|
102
103
|
### Dev Tools (only available when `PK` env var is set)
|
|
103
104
|
|
|
@@ -123,7 +124,9 @@ Use as `pool_address` in `write.account.borrow` / `write.account.repay`, as `cre
|
|
|
123
124
|
|
|
124
125
|
### Asset Manager Addresses
|
|
125
126
|
|
|
126
|
-
|
|
127
|
+
Asset-manager addresses are resolved by the backend, not by this server, and are not passed to or returned by the automation tools. All require V3/V4 accounts. Older asset-manager versions remain on-chain for users who registered before the latest version shipped: `read.asset_manager.current` reports those as `deprecated` so they can be disabled, and reports the dex_protocol with no version suffix.
|
|
128
|
+
|
|
129
|
+
The addresses below are for reference and orientation only. The one you may actually need is the gas relayer, for paying for extra rebalances with AAA.
|
|
127
130
|
|
|
128
131
|
Standalone AMs (not tied to a DEX protocol, same address on all supported chains):
|
|
129
132
|
|
|
@@ -131,7 +134,7 @@ Standalone AMs (not tied to a DEX protocol, same address on all supported chains
|
|
|
131
134
|
| -------------- | -------------------------------------------- | ------------------------ |
|
|
132
135
|
| Merkl Operator | `0x969F0251360b9Cf11c68f6Ce9587924c1B8b42C6` | Base, Optimism, Unichain |
|
|
133
136
|
| Gas Relayer | `0xD938C8d04cF91094fecAF0A2018EAac483a40137` | Base, Optimism, Unichain |
|
|
134
|
-
| CoW Swapper | `
|
|
137
|
+
| CoW Swapper | `0xb988a32DeF54821Dde0D7382e8a74f1BE4da1f23` | Base only |
|
|
135
138
|
|
|
136
139
|
Protocol-specific AMs (rebalancer, compounder, yield claimer). Slipstream V2 is Base-only. All other addresses apply to every chain where the protocol exists:
|
|
137
140
|
|
|
@@ -161,7 +164,7 @@ Slipstream V3 on Optimism uses different addresses (exception to the determinist
|
|
|
161
164
|
| Compounder | `0x3e7b6997399eC402491c4A049e4CD727d3aA1738` |
|
|
162
165
|
| Yield Claimer | `0x3630bDb1Ac7cF8A435411391db75450350814F42` |
|
|
163
166
|
|
|
164
|
-
**Slipstream V1 vs V2 vs V3:** The pool determines the version, each pool is bound to a specific Slipstream version. `read.account.info` returns a `dex_protocol` field on LP positions (derived from the position manager address), so you can read the protocol directly from the account overview.
|
|
167
|
+
**Slipstream V1 vs V2 vs V3:** The pool determines the version, each pool is bound to a specific Slipstream version. `read.account.info` returns a `dex_protocol` field on LP positions (derived from the position manager address), so you can read the protocol directly from the account overview. For automations, prefer passing the position's id as `position_id` to `write.account.automations`, which resolves the protocol and tokens for you. If you have no position id, that value (`slipstream`, `slipstream_v2`, `slipstream_v3`, or their `staked_*` variants) is also accepted directly as the `protocol` param.
|
|
165
168
|
|
|
166
169
|
## Account Versions
|
|
167
170
|
|
|
@@ -169,7 +172,7 @@ Spot vs margin is determined by whether a **creditor** (lending pool) is set at
|
|
|
169
172
|
|
|
170
173
|
- `account_version: 3` — **margin account** (created with a `creditor`). Can borrow, leverage, and mint LP. Uses an onchain whitelist of allowed collateral tokens.
|
|
171
174
|
- `account_version: 4` or `0` (latest) — **spot account** (no creditor, no borrowing). Can hold assets and mint LP with `leverage: 0`. Accepts any ERC20 (no onchain whitelist).
|
|
172
|
-
- `account_version: 1` or `2` — legacy. Not supported by current MCP tools (
|
|
175
|
+
- `account_version: 1` or `2` — legacy. Not supported by current MCP tools (the automation tools require V3/V4).
|
|
173
176
|
- For **leveraged LP strategies**, use `account_version: 3` with a creditor.
|
|
174
177
|
- To check an existing account's version: call `read.account.info` — the response includes the account version.
|
|
175
178
|
|