@arcadia-finance/mcp-server 0.5.2 → 0.6.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 +47 -42
- package/dist/clients/api.js +52 -5
- package/dist/clients/chain.js +1 -1
- package/dist/config/addresses.js +16 -3
- package/dist/index.js +36 -134
- package/dist/prompts/workflows.js +56 -18
- package/dist/resources/guides.js +1 -1
- package/dist/tools/aero.js +157 -0
- package/dist/tools/dev/send.js +4 -4
- package/dist/tools/index.js +6 -0
- package/dist/tools/output-schemas.js +105 -29
- package/dist/tools/read/account.js +13 -13
- package/dist/tools/read/aero-upgrade.js +53 -0
- package/dist/tools/read/asset-managers.js +9 -9
- package/dist/tools/read/assets.js +7 -7
- package/dist/tools/read/guides.js +4 -4
- package/dist/tools/read/points.js +4 -4
- package/dist/tools/read/pools.js +8 -8
- package/dist/tools/read/strategy.js +18 -14
- package/dist/tools/read/wallet.js +15 -15
- package/dist/tools/write/account/add-liquidity.js +131 -12
- package/dist/tools/write/account/aero-upgrade.js +124 -0
- package/dist/tools/write/account/borrow.js +5 -5
- package/dist/tools/write/account/close.js +8 -8
- package/dist/tools/write/account/create.js +3 -3
- package/dist/tools/write/account/deleverage.js +4 -4
- package/dist/tools/write/account/deposit.js +4 -4
- package/dist/tools/write/account/format-response.js +1 -1
- package/dist/tools/write/account/remove-liquidity.js +6 -6
- package/dist/tools/write/account/repay.js +4 -4
- package/dist/tools/write/account/stake.js +5 -5
- package/dist/tools/write/account/swap.js +4 -4
- package/dist/tools/write/account/withdraw.js +5 -5
- package/dist/tools/write/asset-managers/automations.js +14 -14
- package/dist/tools/write/asset-managers/intents.js +10 -7
- package/dist/tools/write/pool/deposit.js +5 -5
- package/dist/tools/write/pool/redeem.js +4 -4
- package/dist/tools/write/wallet/approve.js +4 -4
- package/dist/tools/write/wallet/upgrade-velo.js +76 -0
- package/dist/utils/analytics.js +68 -0
- package/dist/utils/http-config.js +4 -4
- package/llms-full.txt +83 -46
- package/llms.txt +47 -44
- package/package.json +8 -4
- package/server.json +4 -4
- package/skills/clamm-liquidity/SKILL.md +100 -82
- package/skills/clamm-liquidity/automation.md +14 -14
- package/skills/clamm-liquidity/selection.md +13 -13
- package/skills/clamm-liquidity/strategies.md +135 -53
- package/skills/openclaw/SKILL.md +3 -3
- package/skills/openclaw/arcadia.sh +24 -45
- package/skills/openclaw/contracts.md +11 -10
- package/dist/utils/tool-naming.js +0 -91
|
@@ -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 37 MCP tools (+1 dev), intent-based automation setup (compound fees, claim rewards, add to LP, rebalance, claim Merkl), the Slipstream to Aero migration, 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
|
|
|
@@ -10,16 +10,16 @@ Arcadia is a platform for managing concentrated liquidity positions with automat
|
|
|
10
10
|
|
|
11
11
|
## Key Constraints
|
|
12
12
|
|
|
13
|
-
- **All `
|
|
13
|
+
- **All `write_*` tools return unsigned transactions** (`{ to, data, value, chainId }`): you must sign and broadcast them. See "Transaction Signing" below.
|
|
14
14
|
- **Automation strategy config** (tick range, rebalance thresholds) is not currently settable via MCP — this requires Arcadia platform access.
|
|
15
15
|
- **Health factor** = `1 - (used_margin / liquidation_value)`. Higher is safer. `1` = no debt, `>0` = healthy, `0` = liquidation threshold, `<0` = past liquidation. Keep above 0.5 for leveraged positions; act immediately below 0.2.
|
|
16
|
-
- **Minimum margin
|
|
16
|
+
- **Minimum margin**: each lending pool enforces a fixed minimum margin denominated in the pool's numeraire (e.g. WETH for the WETH pool, USDC for the USDC pool), typically a few dollars in value. This gets **added to the debt** when computing `used_margin` (i.e. `used_margin = open_debt + minimum_margin`). It ensures liquidations remain profitable (covering gas costs) and prevents dust attacks. For small positions the fixed minimum margin dominates the used margin, pushing health factor lower than the leverage ratio alone would suggest (e.g. HF ~0.3 at 2× leverage). Increase position size for a healthier starting HF. `write_account_add_liquidity` also validates deposits against per-asset minimum amounts from strategy risk factors.
|
|
17
17
|
- **`asset_id`** is always an integer (NFT token ID for LP positions, 0 for ERC20 tokens).
|
|
18
18
|
- **Wrapping ETH** — ETH must be wrapped to WETH before depositing. Call WETH's `deposit()` function (payable) with the ETH amount. No MCP tool for this, use your wallet.
|
|
19
19
|
|
|
20
20
|
## Transaction Signing
|
|
21
21
|
|
|
22
|
-
Write tools (`
|
|
22
|
+
Write tools (`write_*`) return unsigned transaction calldata. This server does NOT sign or broadcast. After receiving a transaction object, you must:
|
|
23
23
|
|
|
24
24
|
1. **Sign** the transaction with the account owner's private key or wallet
|
|
25
25
|
2. **Broadcast** it to the appropriate chain (Base 8453, Unichain 130, Optimism 10, or Robinhood 4663)
|
|
@@ -30,7 +30,7 @@ How you sign depends on your setup:
|
|
|
30
30
|
- **MPC wallet** (Fireblocks, Dfns, Turnkey) — pass the unsigned tx to your provider's signing API
|
|
31
31
|
- **Smart account** (Safe, Biconomy) — wrap the tx as a UserOperation or Safe transaction
|
|
32
32
|
- **Embedded wallet** (Privy, Dynamic) — use the provider's `sendTransaction` method
|
|
33
|
-
- **Direct private key** (development only)
|
|
33
|
+
- **Direct private key** (development only): use the built-in `dev_send` tool (set `PK` in a `.env` file or MCP client config), or viem/ethers `sendTransaction` with a local signer
|
|
34
34
|
|
|
35
35
|
Example with viem:
|
|
36
36
|
|
|
@@ -45,66 +45,69 @@ Arcadia's flash-action tools can batch multiple DeFi operations into a single at
|
|
|
45
45
|
|
|
46
46
|
**When to split:** In high-volatility markets or for low-liquidity pools, batched transactions may revert because on-chain state changes between when the backend computes calldata and when the transaction executes. If a batched tool fails, fall back to individual tools with tighter slippage. Always try batched first, split only on failure.
|
|
47
47
|
|
|
48
|
-
**Batched write tools (`
|
|
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 to 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 (37 + 1 dev)
|
|
51
51
|
|
|
52
52
|
### Read Tools
|
|
53
53
|
|
|
54
|
-
| Tool | When to use
|
|
55
|
-
| ------------------------------ |
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
54
|
+
| Tool | When to use |
|
|
55
|
+
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
56
|
+
| `read_account_info` | Account overview + liquidation price. Pass `account_address` for detail (returns positions with `asset_address`/`asset_id`/`dex_protocol`, collateral, debt). |
|
|
57
|
+
| `read_account_history` | Historical account value over time. Optional `days` param (default 14). |
|
|
58
|
+
| `read_account_pnl` | PnL and yield earned: use to check if a strategy is still profitable. |
|
|
59
|
+
| `read_asset_list` | List supported collateral assets (symbol, address, decimals). Use `search` to filter by symbol substring. |
|
|
60
|
+
| `read_asset_prices` | USD prices for one or more assets by address. Pass `asset_addresses` (single or comma-separated). |
|
|
61
|
+
| `read_wallet_balances` | On-chain ERC20 balances and native ETH for a wallet. Use to pre-check if the wallet has enough tokens before depositing or adding liquidity. |
|
|
62
|
+
| `read_wallet_allowances` | Check ERC20 token allowances for a spender. Use before `write_wallet_approve` to avoid redundant approvals: skip if the current allowance is already sufficient. |
|
|
63
|
+
| `read_wallet_accounts` | List all Arcadia accounts owned by a wallet address. |
|
|
64
|
+
| `read_wallet_points` | Points earned by a wallet address. |
|
|
65
|
+
| `read_pool_list` | Lending pool TVL, APY, utilization, liquidity. Pass `pool_address` for detail + APY history (optional `days`, default 14). |
|
|
66
|
+
| `read_pool_info` | Detail + APY history for a specific lending pool. Pass `pool_address`. |
|
|
67
|
+
| `read_strategy_list` | LP strategies with fee APY, underlyings, pool protocol. List view shows 7d avg APY for the strategy's default range (e.g. ±7.5% for volatile pairs). **Pass `strategy_id` to see APY per range width** (very_narrow → full_range): narrower range = higher APY but more rebalancing cost/risk. Use `featured_only: true` for curated top strategies. |
|
|
68
|
+
| `read_strategy_info` | Detail for a specific strategy by `strategy_id`, including range-width APY breakdown. |
|
|
69
|
+
| `read_point_leaderboard` | Points leaderboard. No `chain_id` needed: points are cross-chain. |
|
|
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 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. |
|
|
73
|
+
| `read_account_aero_upgrade` | Aero upgrade check: what a wallet's accounts (or one account) still have to move to Aero, with status and counts and no calldata. Empty accounts and failed_accounts lists mean nothing to do. |
|
|
74
|
+
| `read_guides` | Reference guides: `automation` (AM setup), `selection` (pool evaluation), `strategies` (step-by-step templates). |
|
|
74
75
|
|
|
75
76
|
### Preferred Write Tools (atomic/multi-step — use these first)
|
|
76
77
|
|
|
77
78
|
These tools batch multiple operations into ONE atomic transaction. Always prefer these over individual tools.
|
|
78
79
|
|
|
79
|
-
| Tool | Batches | When to use
|
|
80
|
-
| ----------------------------- | ------------------------------------------------------ |
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
80
|
+
| Tool | Batches | When to use |
|
|
81
|
+
| ----------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| `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. |
|
|
83
|
+
| `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`. |
|
|
84
|
+
| `write_account_deleverage` | swap collateral + repay debt | Repay debt using account collateral (no wallet tokens needed). Preferred for health factor fixes. |
|
|
85
|
+
| `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. |
|
|
85
86
|
|
|
86
87
|
### Individual Write Tools (use when batched tools fail or for standalone operations)
|
|
87
88
|
|
|
88
|
-
| Tool | When to use
|
|
89
|
-
| --------------------------------- |
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
96
|
-
| `
|
|
97
|
-
| `
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
89
|
+
| Tool | When to use |
|
|
90
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
91
|
+
| `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. |
|
|
92
|
+
| `write_wallet_upgrade_velo` | Upgrade wallet VELO on Optimism to the new AERO on Base: approve when needed, then the payable deposit. Optional, VELO stays usable. |
|
|
93
|
+
| `write_account_create` | Create a new Arcadia account (one-time setup). Use `account_version: 0` for the latest version (recommended). |
|
|
94
|
+
| `write_account_deposit` | Deposit ERC20 tokens as collateral. NOT needed before `write_account_add_liquidity`: that tool handles deposits atomically. |
|
|
95
|
+
| `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). |
|
|
96
|
+
| `write_account_borrow` | Borrow from a lending pool. NOT needed for leveraged LP: `write_account_add_liquidity` handles borrowing internally. |
|
|
97
|
+
| `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`. |
|
|
98
|
+
| `write_account_swap` | Swap assets within account (backend handles routing). For closing positions, prefer `write_account_close`. |
|
|
99
|
+
| `write_account_remove_liquidity` | PARTIAL liquidity decrease only (position stays open). For full LP removal/exit, use `write_account_close`. |
|
|
100
|
+
| `write_account_stake` | Stake, unstake, or claim rewards for an LP position. Direction auto-detected from `asset_address`. |
|
|
101
|
+
| `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. |
|
|
102
|
+
| `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`. |
|
|
103
|
+
| `write_account_aero_upgrade` | Upgrade an account to Aero (MetadexCL V1): its Slipstream positions move to Aero CL and its old AERO becomes the new AERO, in one flashAction. Returns the plan (items, reasons, pool options) and the transaction. Check first with `read_account_aero_upgrade`; wallet VELO on Optimism goes through `write_wallet_upgrade_velo`. See strategies.md, "Upgrade to Aero". |
|
|
104
|
+
| `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. |
|
|
102
105
|
|
|
103
106
|
### Dev Tools (only available when `PK` env var is set)
|
|
104
107
|
|
|
105
|
-
| Tool | When to use
|
|
106
|
-
| ---------- |
|
|
107
|
-
| `
|
|
108
|
+
| Tool | When to use |
|
|
109
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
110
|
+
| `dev_send` | Sign and broadcast an unsigned transaction using a local private key. Pass the `{ to, data, value, chainId }` from any `write_*` tool. **Not for production**: use a dedicated wallet MCP server (Fireblocks, Safe, Turnkey, etc.) instead. |
|
|
108
111
|
|
|
109
112
|
## Shared Addresses
|
|
110
113
|
|
|
@@ -114,7 +117,7 @@ These tools batch multiple operations into ONE atomic transaction. Always prefer
|
|
|
114
117
|
|
|
115
118
|
### Lending Pools
|
|
116
119
|
|
|
117
|
-
Use as `pool_address` in `
|
|
120
|
+
Use as `pool_address` in `write_account_borrow` / `write_account_repay`, as `creditor` in `write_account_create` / `write_account_deleverage`. Same CREATE2 addresses on Base and Optimism. Unichain has no lending pools.
|
|
118
121
|
|
|
119
122
|
| Asset | Pool Address | Chains |
|
|
120
123
|
| ----- | -------------------------------------------- | -------------- |
|
|
@@ -124,7 +127,7 @@ Use as `pool_address` in `write.account.borrow` / `write.account.repay`, as `cre
|
|
|
124
127
|
|
|
125
128
|
### Asset Manager Addresses
|
|
126
129
|
|
|
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: `
|
|
130
|
+
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
131
|
|
|
129
132
|
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.
|
|
130
133
|
|
|
@@ -138,23 +141,28 @@ Standalone AMs (not tied to a DEX protocol, same address on all supported chains
|
|
|
138
141
|
|
|
139
142
|
Protocol-specific AMs (rebalancer, compounder, yield claimer). Slipstream V2 is Base-only. All other addresses apply to every chain where the protocol exists:
|
|
140
143
|
|
|
141
|
-
| Type | Protocol
|
|
142
|
-
| ------------- |
|
|
143
|
-
| Rebalancer | Slipstream V1
|
|
144
|
-
| Rebalancer | Slipstream V2
|
|
145
|
-
| Rebalancer | Slipstream V3
|
|
146
|
-
| Rebalancer | Uniswap V3
|
|
147
|
-
| Rebalancer | Uniswap V4
|
|
148
|
-
| Compounder | Slipstream V1
|
|
149
|
-
| Compounder | Slipstream V2
|
|
150
|
-
| Compounder | Slipstream V3
|
|
151
|
-
| Compounder | Uniswap V3
|
|
152
|
-
| Compounder | Uniswap V4
|
|
153
|
-
| Yield Claimer | Slipstream V1
|
|
154
|
-
| Yield Claimer | Slipstream V2
|
|
155
|
-
| Yield Claimer | Slipstream V3
|
|
156
|
-
| Yield Claimer | Uniswap V3
|
|
157
|
-
| Yield Claimer | Uniswap V4
|
|
144
|
+
| Type | Protocol | Address |
|
|
145
|
+
| ------------- | ---------------------- | -------------------------------------------- |
|
|
146
|
+
| Rebalancer | Slipstream V1 | `0x5802454749cc0c4A6F28D5001B4cD84432e2b79F` |
|
|
147
|
+
| Rebalancer | Slipstream V2 | `0x953Ff365d0b562ceC658dc46B394E9282338d9Ea` |
|
|
148
|
+
| Rebalancer | Slipstream V3 | `0x37c6258aEe125d520B6f03fc2cb490955050D557` |
|
|
149
|
+
| Rebalancer | Uniswap V3 | `0xbA1D0c99c261F94b9C8b52465890Cca27dd993Bd` |
|
|
150
|
+
| Rebalancer | Uniswap V4 | `0x01EDaF0067a10D18c88D2876c0A85Ee0096a5Ac0` |
|
|
151
|
+
| Compounder | Slipstream V1 | `0x467837f44A71e3eAB90AEcfC995c84DC6B3cfCF7` |
|
|
152
|
+
| Compounder | Slipstream V2 | `0x35e59448C7145482E56212510cC689612AB4F61f` |
|
|
153
|
+
| Compounder | Slipstream V3 | `0xd42A3Ac56456bD5422835B36C35Cacb6448ddCd9` |
|
|
154
|
+
| Compounder | Uniswap V3 | `0x02e1fa043214E51eDf1F0478c6D0d3D5658a2DC3` |
|
|
155
|
+
| Compounder | Uniswap V4 | `0xAA95c9c402b195D8690eCaea2341a76e3266B189` |
|
|
156
|
+
| Yield Claimer | Slipstream V1 | `0x5a8278D37b7a787574b6Aa7E18d8C02D994f18Ba` |
|
|
157
|
+
| Yield Claimer | Slipstream V2 | `0xc8bF4B2c740FF665864E9494832520f18822871C` |
|
|
158
|
+
| Yield Claimer | Slipstream V3 | `0x8c1Fbf38118fD5A704b6E7babcB7AF1a9A291980` |
|
|
159
|
+
| Yield Claimer | Uniswap V3 | `0x75Ed28EA8601Ce9F5FbcAB1c2428f04A57aFaA16` |
|
|
160
|
+
| Yield Claimer | Uniswap V4 | `0xD8aa21AB7f9B8601CB7d7A776D3AFA1602d5D8D4` |
|
|
161
|
+
| Rebalancer | Aero CL (MetadexCL V1) | `0x9EA47b9db58970Ab5Ea686a5CaC3e80ec652d755` |
|
|
162
|
+
| Compounder | Aero CL | `0xd772812Ba8AeFBd4F2126E82e2D08a66856D0261` |
|
|
163
|
+
| Yield Claimer | Aero CL | `0x0367C284b58d3531947c182C1aF203177Cc4D6ed` |
|
|
164
|
+
|
|
165
|
+
Aero CL managers have the same address on Base, Optimism and Robinhood.
|
|
158
166
|
|
|
159
167
|
Slipstream V3 on Optimism uses different addresses (exception to the deterministic deployment pattern):
|
|
160
168
|
|
|
@@ -164,7 +172,7 @@ Slipstream V3 on Optimism uses different addresses (exception to the determinist
|
|
|
164
172
|
| Compounder | `0x3e7b6997399eC402491c4A049e4CD727d3aA1738` |
|
|
165
173
|
| Yield Claimer | `0x3630bDb1Ac7cF8A435411391db75450350814F42` |
|
|
166
174
|
|
|
167
|
-
**Slipstream V1 vs V2 vs V3:** The pool determines the version, each pool is bound to a specific Slipstream version. `
|
|
175
|
+
**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. MetadexCL V1 is Aero CL (`metadexcl_v1` / `staked_metadexcl_v1`); `staked_metadexcl_v1` covers both the staked module and the wrapper.
|
|
168
176
|
|
|
169
177
|
## Account Versions
|
|
170
178
|
|
|
@@ -174,26 +182,27 @@ Spot vs margin is determined by whether a **creditor** (lending pool) is set at
|
|
|
174
182
|
- `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).
|
|
175
183
|
- `account_version: 1` or `2` — legacy. Not supported by current MCP tools (the automation tools require V3/V4).
|
|
176
184
|
- For **leveraged LP strategies**, use `account_version: 3` with a creditor.
|
|
177
|
-
- To check an existing account's version: call `
|
|
185
|
+
- To check an existing account's version: call `read_account_info`: the response includes the account version.
|
|
178
186
|
|
|
179
187
|
## Chain-Specific Addresses
|
|
180
188
|
|
|
181
189
|
### Base (8453)
|
|
182
190
|
|
|
183
|
-
Protocols: Slipstream V1, Slipstream V2, Slipstream V3, Uniswap V3, Uniswap V4.
|
|
191
|
+
Protocols: Slipstream V1, Slipstream V2, Slipstream V3, Uniswap V3, Uniswap V4, Aero CL (MetadexCL V1), for spot and margin accounts.
|
|
184
192
|
|
|
185
|
-
| Token
|
|
186
|
-
|
|
|
187
|
-
| WETH
|
|
188
|
-
| USDC
|
|
189
|
-
| cbBTC
|
|
190
|
-
| AERO
|
|
191
|
-
|
|
|
192
|
-
|
|
|
193
|
+
| Token | Address | Decimals |
|
|
194
|
+
| ------------- | -------------------------------------------- | -------- |
|
|
195
|
+
| WETH | `0x4200000000000000000000000000000000000006` | 18 |
|
|
196
|
+
| USDC | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` | 6 |
|
|
197
|
+
| cbBTC | `0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf` | 8 |
|
|
198
|
+
| AERO | `0x3f5bF3EdAc59d650D8fDf9657a71F2f904A3a4Ee` | 18 |
|
|
199
|
+
| AERO (legacy) | `0x940181a94A35A4569E4529A3CDfB74e38FD98631` | 18 |
|
|
200
|
+
| AAA | `0xaaa843fb2916c0B57454270418E121C626402AAa` | 18 |
|
|
201
|
+
| stAAA | `0xDeA1531d8a1505785eb517C7A28526443df223F3` | 18 |
|
|
193
202
|
|
|
194
203
|
### Optimism (10)
|
|
195
204
|
|
|
196
|
-
Protocols: Slipstream V1 (Velodrome), Slipstream V3, Uniswap V3, Uniswap V4. No Slipstream V2, no cbBTC pool.
|
|
205
|
+
Protocols: Slipstream V1 (Velodrome), Slipstream V3, Uniswap V3, Uniswap V4, Aero CL (MetadexCL V1). No Slipstream V2, no cbBTC pool.
|
|
197
206
|
|
|
198
207
|
| Token | Address | Decimals |
|
|
199
208
|
| ------ | -------------------------------------------- | -------- |
|
|
@@ -203,6 +212,7 @@ Protocols: Slipstream V1 (Velodrome), Slipstream V3, Uniswap V3, Uniswap V4. No
|
|
|
203
212
|
| VELO | `0x9560e827aF36c94D2Ac33a39bCE1Fe78631088Db` | 18 |
|
|
204
213
|
| WBTC | `0x68f180fcCe6836688e9084f035309E29Bf0A2095` | 8 |
|
|
205
214
|
| wstETH | `0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb` | 18 |
|
|
215
|
+
| xAERO | `0xbdEaeA5205d16f34Cb40038052d91235D87B4C54` | 18 |
|
|
206
216
|
|
|
207
217
|
### Unichain (130)
|
|
208
218
|
|
|
@@ -216,8 +226,16 @@ Protocols: Slipstream V1, Uniswap V3, Uniswap V4. No Slipstream V2/V3. No lendin
|
|
|
216
226
|
| UNI | `0x8f187aA05619a017077f5308904739877ce9eA21` | 18 |
|
|
217
227
|
| VELO | `0x7f9AdFbd38b669F03d1d11000Bc76b9AaEA28A81` | 18 |
|
|
218
228
|
|
|
229
|
+
### Robinhood (4663)
|
|
230
|
+
|
|
231
|
+
Protocols: Uniswap V3, Uniswap V4, Aero CL (MetadexCL V1). No Slipstream V1-V3. Lending pools: WETH and USDG.
|
|
232
|
+
|
|
233
|
+
| Token | Address | Decimals |
|
|
234
|
+
| ----- | -------------------------------------------- | -------- |
|
|
235
|
+
| xAERO | `0x9e148C5716b5aAdCFD3B71cEAE9EE7a9e22C29E2` | 18 |
|
|
236
|
+
|
|
219
237
|
## Reference Files
|
|
220
238
|
|
|
221
239
|
- [automation.md](automation.md) — How to enable each automation type
|
|
222
240
|
- [selection.md](selection.md) — How to evaluate pools, choose range width, size leverage, combine automation
|
|
223
|
-
- [strategies.md](strategies.md)
|
|
241
|
+
- [strategies.md](strategies.md): Step-by-step strategy templates: delta neutral LP, protocol-owned liquidity, and the upgrade to Aero
|
|
@@ -7,10 +7,10 @@ Automations are configured as **intents**: you describe the outcome you want and
|
|
|
7
7
|
## Agent Workflow
|
|
8
8
|
|
|
9
9
|
```
|
|
10
|
-
1.
|
|
11
|
-
2.
|
|
12
|
-
3.
|
|
13
|
-
4.
|
|
10
|
+
1. read_account_info → find the LP position id and what is already automated
|
|
11
|
+
2. read_asset_manager_current → decoded per-manager config, plus superseded managers to clear
|
|
12
|
+
3. read_asset_manager_intents → which intents this account can enable, and why any are blocked
|
|
13
|
+
4. write_account_automations → pass the full intents array, get back the unsigned tx
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Pass the LP position's `position_id` and the backend fetches the protocol, staked flag, pool tokens and reward tokens for you. Only supply `protocol` / `token0` / `token1` by hand when you have no position id. `claim_merkl` needs no position context at all.
|
|
@@ -29,18 +29,18 @@ Every intent takes `enabled` (default true) and an optional `position_id`.
|
|
|
29
29
|
|
|
30
30
|
## Full desired state vs delta
|
|
31
31
|
|
|
32
|
-
`
|
|
32
|
+
`write_account_automations` takes the **complete desired state**. Any automation not in the `intents` array gets disabled, so include everything the user wants kept, not just what is new. To turn everything off, pass a single intent with `enabled: false`.
|
|
33
33
|
|
|
34
34
|
`mode: "save"` (the default) diffs the desired state against what is on-chain and returns a signable transaction that both enables what you asked for and disables what you left out.
|
|
35
35
|
|
|
36
36
|
`mode: "preview"` resolves and validates the intents **without** reading chain state, and deliberately returns **no transaction** (`preview_only: true`). Because it does not diff, its calldata contains no disable entries: broadcasting it would enable the new managers while leaving omitted automations running. Use preview to check that a combination is legal or to show a plan, then re-run with `save` to get something signable.
|
|
37
37
|
|
|
38
|
-
`
|
|
38
|
+
`write_account_automations_delta` is the **change-only** variant: `enable` switches intents on, `disable` takes asset-manager addresses (from `read_asset_manager_current`) to switch off, and anything unmentioned is left alone. Use it to flip one automation without restating the rest.
|
|
39
39
|
|
|
40
40
|
Example: add rebalancing to an account that is already compounding, without disturbing the compounder:
|
|
41
41
|
|
|
42
42
|
```
|
|
43
|
-
|
|
43
|
+
write_account_automations_delta(
|
|
44
44
|
account_address: "0x...",
|
|
45
45
|
position_id: 12345,
|
|
46
46
|
enable: [{ kind: "rebalance" }]
|
|
@@ -50,7 +50,7 @@ write.account.automations_delta(
|
|
|
50
50
|
Same thing expressed as full desired state:
|
|
51
51
|
|
|
52
52
|
```
|
|
53
|
-
|
|
53
|
+
write_account_automations(
|
|
54
54
|
account_address: "0x...",
|
|
55
55
|
position_id: 12345,
|
|
56
56
|
intents: [{ kind: "compound_fees" }, { kind: "rebalance" }]
|
|
@@ -68,7 +68,7 @@ write.account.automations(
|
|
|
68
68
|
A mixed partition is valid and common: compound token0's fees while claiming token1's out.
|
|
69
69
|
|
|
70
70
|
```
|
|
71
|
-
|
|
71
|
+
write_account_automations(
|
|
72
72
|
account_address: "0x...",
|
|
73
73
|
position_id: 12345,
|
|
74
74
|
intents: [
|
|
@@ -103,7 +103,7 @@ The backend enforces compatibility rules rather than letting an invalid combinat
|
|
|
103
103
|
| `compound_reward_buy_token_not_pool_token` | The compound CowSwap leg must buy one of the position's underlyings. |
|
|
104
104
|
| `multiple_convert_targets` | One account has a single CowSwapper metadata slot, so a compound-reward swap leg and a claim-and-convert leg cannot coexist. |
|
|
105
105
|
|
|
106
|
-
Read `errors[].reason`, adjust the intents, retry. `
|
|
106
|
+
Read `errors[].reason`, adjust the intents, retry. `read_asset_manager_intents` with an account address tells you up front which intents are currently blocked.
|
|
107
107
|
|
|
108
108
|
## Simulation
|
|
109
109
|
|
|
@@ -127,7 +127,7 @@ Three success-path cases return no `transaction`, and an agent must not treat an
|
|
|
127
127
|
|
|
128
128
|
## Superseded managers
|
|
129
129
|
|
|
130
|
-
Asset managers are redeployed over time. An account registered on an older deployment keeps working, but `
|
|
130
|
+
Asset managers are redeployed over time. An account registered on an older deployment keeps working, but `read_asset_manager_current` lists those under `deprecated` (and `read_account_info` under `automation.deprecated_managers`). They should be cleared: `write_account_automations` disables them as part of a save, or pass their addresses to `write_account_automations_delta`.
|
|
131
131
|
|
|
132
132
|
---
|
|
133
133
|
|
|
@@ -167,7 +167,7 @@ Trigger ratios are **tick distance, not price**: a ratio of 50000 shifts the tri
|
|
|
167
167
|
|
|
168
168
|
Quota is bypassed when: gas cost < pending fees / 2, or position value >= $50k.
|
|
169
169
|
|
|
170
|
-
**Pay for extra rebalances with AAA:** Deposit AAA tokens into the account, then approve them to the gas relayer `0xD938C8d04cF91094fecAF0A2018EAac483a40137`. The relayer is an asset manager but no intent configures it, so it sits outside the intent model: `
|
|
170
|
+
**Pay for extra rebalances with AAA:** Deposit AAA tokens into the account, then approve them to the gas relayer `0xD938C8d04cF91094fecAF0A2018EAac483a40137`. The relayer is an asset manager but no intent configures it, so it sits outside the intent model: `read_account_info` reports it as `automation.gas_relayer`.
|
|
171
171
|
|
|
172
172
|
**Fees:** 7.5% of yield earned, max 1% liquidity decrease per rebalance (MDL).
|
|
173
173
|
|
|
@@ -216,8 +216,8 @@ Both a rebalance and a compound may carry the same fold instruction. The amount
|
|
|
216
216
|
|
|
217
217
|
**What it does:** Claims external Merkl protocol incentive rewards into the account, which are additional rewards paid by token teams on top of regular LP fees.
|
|
218
218
|
|
|
219
|
-
**When to enable:** When the pool has active Merkl campaigns (check the APY breakdown in `
|
|
219
|
+
**When to enable:** When the pool has active Merkl campaigns (check the APY breakdown in `read_strategy_list`).
|
|
220
220
|
|
|
221
221
|
**Always combine with a rebalance** when both are relevant: no conflict, extra free yield.
|
|
222
222
|
|
|
223
|
-
Merkl authorization is the Merkl distributor whitelist, not `isAssetManager`, so it is reported separately. `
|
|
223
|
+
Merkl authorization is the Merkl distributor whitelist, not `isAssetManager`, so it is reported separately. `read_asset_manager_current` returns a `merkl` block with `connected`, `active` and `tokens_missing`. When `tokens_missing` is true the user still has to register reward tokens with Merkl before claims land.
|
|
@@ -7,8 +7,8 @@ Use this guide to evaluate whether a strategy makes sense and how to configure i
|
|
|
7
7
|
## 1. Pool / Strategy Selection
|
|
8
8
|
|
|
9
9
|
```
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
read_strategy_list(chain_id: 8453) // browse all LP strategies + fee APY
|
|
11
|
+
read_pool_list(chain_id: 8453) // check borrow cost for leveraged strategies
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
**Viability check (leveraged):**
|
|
@@ -32,12 +32,12 @@ Must be positive to justify the leverage cost. Higher leverage amplifies both si
|
|
|
32
32
|
|
|
33
33
|
- Fee tier: higher fee tier (0.3%, 1%) = more fee per trade, better for volatile pairs
|
|
34
34
|
- Volume + TVL: high volume/TVL ratio = fees are being earned actively
|
|
35
|
-
- Active Merkl rewards: extra yield on top, check `
|
|
35
|
+
- Active Merkl rewards: extra yield on top, check `read_strategy_list` APY breakdown
|
|
36
36
|
|
|
37
37
|
**`numeraire` — context-dependent meaning:**
|
|
38
38
|
|
|
39
|
-
- **`
|
|
40
|
-
- **`
|
|
39
|
+
- **`write_account_add_liquidity`**: `numeraire` = account base currency (typically the stable side, e.g. USDC for a WETH/USDC position). The backend uses it to denominate calculations and determine the optimal swap ratio. For WETH/USDC: `numeraire = 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` (USDC).
|
|
40
|
+
- **`write_account_deleverage`**: `numeraire` = the debt token you're repaying (e.g. WETH address when repaying WETH debt). This differs from the add liquidity usage.
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
@@ -45,7 +45,7 @@ Must be positive to justify the leverage cost. Higher leverage amplifies both si
|
|
|
45
45
|
|
|
46
46
|
Range width is the central tradeoff in any LP strategy. It is set in the Arcadia platform after enabling the rebalancer. Understanding the full tradeoff is essential for choosing parameters — a simple fee APY comparison is not enough.
|
|
47
47
|
|
|
48
|
-
**Core principle:** The `strategy_apy` from `
|
|
48
|
+
**Core principle:** The `strategy_apy` from `read_strategy_list` (list view) is the 7-day average APY computed for that strategy's **default range width** (configured per strategy: e.g. very narrow for stables, ±7.5% / balanced for most volatile pairs). It is sampled every ~3 hours and averaged over 7d. It already reflects a concentrated range: NOT a full-range / pool-level number. Choosing a different range width changes your actual yield: narrower = higher fee capture but more rebalancing cost/risk, wider = lower fees but fewer rebalances. Call `read_strategy_list(strategy_id: <id>)` to see APY broken down by range width (very_narrow, narrow, balanced, wide, very_wide, full_range). The net return after rebalancing costs, IL, and gas determines the optimal width: see the model below.
|
|
49
49
|
|
|
50
50
|
### The full tradeoff
|
|
51
51
|
|
|
@@ -76,7 +76,7 @@ expected_net_return =
|
|
|
76
76
|
|
|
77
77
|
Inputs to estimate from market data:
|
|
78
78
|
|
|
79
|
-
- **time_in_range_fraction**: given the pool's historical volatility, how often does price stay within ±X% of the current price? Use `
|
|
79
|
+
- **time_in_range_fraction**: given the pool's historical volatility, how often does price stay within ±X% of the current price? Use `read_strategy_list` APY + historical vol data.
|
|
80
80
|
- **rebalance_frequency**: how many rebalances per day does the chosen range width require? Wider range = fewer rebalances.
|
|
81
81
|
- **gas_cost_per_rebalance**: check current chain gas price × ~4M units per rebalance.
|
|
82
82
|
- **IL_rate**: IL as a function of how far price moved before the rebalance; wider ranges accumulate less IL per rebalance.
|
|
@@ -137,7 +137,7 @@ Target collateral ratio ≥ 1.5 at entry (≈ health factor ~0.5+). Never open b
|
|
|
137
137
|
- Borrow APY rising (utilization climbing in lending pool)
|
|
138
138
|
- Market showing high volatility (gap risk)
|
|
139
139
|
- Position already near support/resistance — a breakout would spike debt fast
|
|
140
|
-
- Health factor dropping toward 0.5 (check with `
|
|
140
|
+
- Health factor dropping toward 0.5 (check with `read_account_info`)
|
|
141
141
|
|
|
142
142
|
---
|
|
143
143
|
|
|
@@ -156,7 +156,7 @@ Target collateral ratio ≥ 1.5 at entry (≈ health factor ~0.5+). Never open b
|
|
|
156
156
|
|
|
157
157
|
## 5. Exit Signals
|
|
158
158
|
|
|
159
|
-
Monitor periodically with `
|
|
159
|
+
Monitor periodically with `read_account_info` and `read_account_pnl`. Exit or adjust when:
|
|
160
160
|
|
|
161
161
|
| Signal | Threshold | Action |
|
|
162
162
|
| -------------------------------- | ------------------------ | ------------------------------------- |
|
|
@@ -164,17 +164,17 @@ Monitor periodically with `read.account.info` and `read.account.pnl`. Exit or ad
|
|
|
164
164
|
| Health factor falling | < 0.5 | Add collateral or reduce debt |
|
|
165
165
|
| Health factor critical | < 0.2 | Immediate action required |
|
|
166
166
|
| Position out-of-range repeatedly | Bot can't keep up | Widen range or reduce leverage |
|
|
167
|
-
| Net PnL negative over time | Check `
|
|
167
|
+
| Net PnL negative over time | Check `read_account_pnl` | Evaluate whether IL is outpacing fees |
|
|
168
168
|
|
|
169
|
-
**Closing in volatile conditions:** Atomic close (`
|
|
169
|
+
**Closing in volatile conditions:** Atomic close (`write_account_close`) may revert during high volatility or for low-liquidity pools because on-chain state diverges from when the backend computed the calldata. If atomic close fails, fall back to individual tools with tighter slippage: see strategies.md closing section for the full fallback sequence.
|
|
170
170
|
|
|
171
171
|
---
|
|
172
172
|
|
|
173
173
|
## 6. Quick Checklist Before Opening a Position
|
|
174
174
|
|
|
175
175
|
```
|
|
176
|
-
[ ]
|
|
177
|
-
[ ]
|
|
176
|
+
[ ] read_strategy_list → fee_APY noted (7d avg for default range; call with strategy_id for per-range APY)
|
|
177
|
+
[ ] read_pool_list → borrow_APY noted (if leveraged)
|
|
178
178
|
[ ] net_APY = fee_APY - (leverage-1) × borrow_APY > 0
|
|
179
179
|
[ ] Pair type matches strategy (volatile/stable for delta neutral)
|
|
180
180
|
[ ] Range width: modeled or estimated for pair volatility + stAAA quota
|