@arcadia-finance/mcp-server 0.7.2 → 0.7.4
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 +5 -22
- package/dist/clients/chain.js +1 -1
- package/dist/tools/index.js +0 -3
- package/dist/tools/output-schemas.js +0 -8
- package/dist/tools/read/account.js +2 -2
- package/dist/tools/read/asset-managers.js +1 -0
- package/dist/tools/write/asset-managers/automations.js +1 -1
- package/llms-full.txt +1 -13
- package/llms.txt +2 -6
- package/package.json +1 -1
- package/server.json +2 -8
- package/skills/clamm-liquidity/SKILL.md +4 -10
- package/skills/clamm-liquidity/automation.md +3 -1
- package/dist/tools/dev/send.js +0 -92
package/README.md
CHANGED
|
@@ -155,14 +155,6 @@ Write tools return unsigned transactions. Your wallet signs them, see [Transacti
|
|
|
155
155
|
| `write_account_automations` | Configure automations from an intents array (full desired state). Returns the unsigned setAssetManagers tx. |
|
|
156
156
|
| `write_account_automations_delta` | Enable/disable individual automations, leaving the rest untouched. |
|
|
157
157
|
|
|
158
|
-
### Dev Tools
|
|
159
|
-
|
|
160
|
-
Registered only when the `PK` env var is set.
|
|
161
|
-
|
|
162
|
-
| Tool | Description |
|
|
163
|
-
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
164
|
-
| `dev_send` | Sign and broadcast an unsigned transaction using a local private key (`PK` env var). Not for production: use a dedicated wallet MCP server instead. |
|
|
165
|
-
|
|
166
158
|
## Transaction Signing
|
|
167
159
|
|
|
168
160
|
All write tools return **unsigned transactions** as `{ to, data, value, chainId }`. This server does not sign or broadcast them; your agent or application does.
|
|
@@ -195,20 +187,9 @@ const client = createWalletClient({ account, chain: base, transport: http() });
|
|
|
195
187
|
const hash = await client.sendTransaction(tx);
|
|
196
188
|
```
|
|
197
189
|
|
|
198
|
-
**Built-in `dev_send` tool (development only):**
|
|
199
|
-
The server includes a dev-only signing tool that reads a private key from the `PK` environment variable. Set `PK` via a `.env` file or your MCP client config:
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
# .env in the server directory (gitignored, never commit it)
|
|
203
|
-
PK=0xYourPrivateKeyHex
|
|
204
|
-
RPC_URL_BASE=https://base-mainnet.g.alchemy.com/v2/your-key
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
The server loads `.env` on startup. Values in the MCP client `env` block take precedence.
|
|
208
|
-
|
|
209
190
|
## Configuration
|
|
210
191
|
|
|
211
|
-
All environment variables are optional.
|
|
192
|
+
All environment variables are optional. Set them in a `.env` file in the server directory (gitignored, never commit it) or in your MCP client `env` block, which takes precedence.
|
|
212
193
|
|
|
213
194
|
| Variable | Required | Default | Transport | Description |
|
|
214
195
|
| ------------------- | -------- | ----------------------------- | --------- | -------------------------------------------------------------- |
|
|
@@ -216,7 +197,6 @@ All environment variables are optional.
|
|
|
216
197
|
| `RPC_URL_UNICHAIN` | No | Public RPC | Both | RPC URL for Unichain (130). |
|
|
217
198
|
| `RPC_URL_OPTIMISM` | No | Public RPC | Both | RPC URL for Optimism (10). |
|
|
218
199
|
| `RPC_URL_ROBINHOOD` | No | Public RPC | Both | RPC URL for Robinhood (4663). |
|
|
219
|
-
| `PK` | No | none | Both | Private key (hex) for dev-only `dev_send` tool. |
|
|
220
200
|
| `TRANSPORT` | No | `stdio` | n/a | Transport mode: `stdio` or `http`. |
|
|
221
201
|
| `PORT` | No | `3000` | HTTP | Listen port for HTTP transport. |
|
|
222
202
|
| `ALLOWED_ORIGINS` | No | `https://mcp.arcadia.finance` | HTTP | Comma-separated allowed Origin headers (CORS / DNS rebinding). |
|
|
@@ -261,6 +241,9 @@ Pull requests for documentation fixes are welcome. Every PR needs a human review
|
|
|
261
241
|
- **Glama:** [glama.ai](https://glama.ai/mcp/servers/arcadia-finance/mcp-server)
|
|
262
242
|
- **mcp.so:** [mcp.so](https://mcp.so/server/arcadia-finance/mcp-server)
|
|
263
243
|
- **awesome-mcp-servers:** [github.com/punkpeye/awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers)
|
|
244
|
+
- **mcptry:** [mcptry.com](https://mcptry.com/servers/io.github.arcadia-finance/mcp-server)
|
|
245
|
+
- **mcprush:** [mcprush.com](https://mcprush.com/arcadia-finance/arcadia-finance-mcp)
|
|
246
|
+
- **ClawHub (OpenClaw skill):** [clawhub.ai](https://clawhub.ai/skills/arcadia-finance)
|
|
264
247
|
|
|
265
248
|
## Development
|
|
266
249
|
|
|
@@ -277,7 +260,7 @@ To point a client at your build, use `"command": "node"` with `"args": ["/absolu
|
|
|
277
260
|
|
|
278
261
|
## Privacy
|
|
279
262
|
|
|
280
|
-
When `POSTHOG_KEY` is set on an HTTP deployment, the server records one analytics event per tool call in PostHog (EU ingestion host by default): the tool name, its arguments (which can include public wallet and account addresses), whether the call failed, the duration, and the client name and version. Events carry no person profile. Running the server locally over stdio sends no analytics, and neither does an HTTP deployment without `POSTHOG_KEY`.
|
|
263
|
+
When `POSTHOG_KEY` is set on an HTTP deployment, the server records one analytics event per tool call in PostHog (EU ingestion host by default): the tool name, its arguments (which can include public wallet and account addresses), whether the call failed, the duration, and the client name and version. Events carry no person profile. Running the server locally over stdio sends no analytics, and neither does an HTTP deployment without `POSTHOG_KEY`. The server never handles private keys. Questions: legal@arcadia.finance.
|
|
281
264
|
|
|
282
265
|
## License
|
|
283
266
|
|
package/dist/clients/chain.js
CHANGED
package/dist/tools/index.js
CHANGED
|
@@ -16,7 +16,6 @@ import { registerApproveTool } from "./write/wallet/approve.js";
|
|
|
16
16
|
import { registerPoolDepositTool } from "./write/pool/deposit.js";
|
|
17
17
|
import { registerPoolRedeemTool } from "./write/pool/redeem.js";
|
|
18
18
|
import { registerAutomationsTools } from "./write/asset-managers/automations.js";
|
|
19
|
-
import { registerSendTool } from "./dev/send.js";
|
|
20
19
|
import { registerAddLiquidityTool } from "./write/account/add-liquidity.js";
|
|
21
20
|
import { registerRemoveLiquidityTool } from "./write/account/remove-liquidity.js";
|
|
22
21
|
import { registerSwapTool } from "./write/account/swap.js";
|
|
@@ -57,6 +56,4 @@ export function registerAllTools(server, api, chains) {
|
|
|
57
56
|
registerPoolRedeemTool(server, chains);
|
|
58
57
|
// Write tools: asset managers (intent-based, compiled by the backend)
|
|
59
58
|
registerAutomationsTools(server, api);
|
|
60
|
-
// Dev tools
|
|
61
|
-
registerSendTool(server, chains);
|
|
62
59
|
}
|
|
@@ -87,14 +87,6 @@ export const WalletAllowanceOutput = z.object({
|
|
|
87
87
|
is_max_approval: z.boolean(),
|
|
88
88
|
})),
|
|
89
89
|
});
|
|
90
|
-
export const DevSendOutput = z.object({
|
|
91
|
-
signer: z.string(),
|
|
92
|
-
txHash: z.string(),
|
|
93
|
-
status: z.string(),
|
|
94
|
-
blockNumber: z.number(),
|
|
95
|
-
gasLimit: z.number(),
|
|
96
|
-
gasUsed: z.number(),
|
|
97
|
-
});
|
|
98
90
|
export const AccountInfoOutput = z
|
|
99
91
|
.object({
|
|
100
92
|
account_version: z.number().nullable(),
|
|
@@ -104,7 +104,7 @@ export function registerAccountTools(server, api, chains) {
|
|
|
104
104
|
openWorldHint: true,
|
|
105
105
|
},
|
|
106
106
|
description: "Get full overview of an Arcadia account: health factor, collateral value, debt, deposited assets, liquidation price, and automation status. Health factor = 1 - (used_margin / liquidation_value): 1 = no debt (safest), >0 = healthy, 0 = liquidation threshold, <0 = past liquidation. Higher is safer. " +
|
|
107
|
-
"The `automation` object reports which asset managers are enabled (rebalancer, compounder, yield_claimer, cow_swapper, merkl_operator, gas_relayer), each as the position's dex_protocol when protocol-specific or true when account-level, plus `inferred_intents` (the automations those managers add up to), `merkl` claim state, and `deprecated_managers` for any superseded deployment still set on the account. Superseded managers should be cleared: write_account_automations disables them as part of a save. For the full decoded per-manager config use read_asset_manager_current. " +
|
|
107
|
+
"The `automation` object reports which asset managers are enabled (rebalancer, compounder, yield_claimer, cow_swapper, merkl_operator, gas_relayer), each as the position's dex_protocol when protocol-specific or true when account-level and active, plus `inferred_intents` (the automations those managers add up to), `merkl` claim state, and `deprecated_managers` for any superseded deployment still set on the account. Superseded managers should be cleared: write_account_automations disables them as part of a save. For the full decoded per-manager config use read_asset_manager_current. " +
|
|
108
108
|
"LP positions in assets[] include a dex_protocol field (slipstream, slipstream_v2, slipstream_v3, metadexcl_v1, staked_slipstream, staked_slipstream_v2, staked_slipstream_v3, staked_metadexcl_v1, uniV3, uniV4). metadexcl_v1 is Aero CL, live on Base, Optimism and Robinhood for spot and margin accounts. Slipstream V2 is Base-only. V3 is available on Base and Optimism. Unichain supports Slipstream V1, uniV3 and uniV4. To configure automations, prefer passing the position's id as position_id to write_account_automations, which resolves the protocol and tokens for you; the dex_protocol value is also accepted directly as its `protocol` param. " +
|
|
109
109
|
"Numeric fields without a _usd suffix are in the account's numeraire token raw units (divide by 10^decimals: 6 for USDC, 18 for WETH, 8 for cbBTC). Fields ending in _usd are in USD with 18 decimals (divide by 1e18). health_factor is unitless. Asset amounts are raw token units. To list all accounts for a wallet, use read_wallet_accounts.",
|
|
110
110
|
inputSchema: z.object({
|
|
@@ -184,7 +184,7 @@ export function registerAccountTools(server, api, chains) {
|
|
|
184
184
|
if (m.deprecated)
|
|
185
185
|
continue;
|
|
186
186
|
if (!m.protocol) {
|
|
187
|
-
out[m.manager] =
|
|
187
|
+
out[m.manager] = m.active !== false;
|
|
188
188
|
continue;
|
|
189
189
|
}
|
|
190
190
|
const dexProtocol = backendProtocolToDexProtocol(m.protocol);
|
|
@@ -143,6 +143,7 @@ export function registerAssetManagerTools(server, api) {
|
|
|
143
143
|
description: "Read which asset managers are currently enabled on an account, with their decoded on-chain configuration. " +
|
|
144
144
|
"Returns the active managers (address, protocol, initiator, decoded strategy metadata, slippage and value-loss caps, fee recipient), the intents they map to, and Merkl claim state including whether reward tokens still need registering. " +
|
|
145
145
|
"Managers from superseded deployments are listed separately under `deprecated`: pass their addresses to write_account_automations_delta to clear them, or run write_account_automations which disables them as part of the save. " +
|
|
146
|
+
"A deprecated cow_swapper no longer swaps: a delta apply moves the account to the current CowSwapper and keeps its auto-swap target (buy token, sell tokens); a save keeps it only when its intents restate that target from the deprecated entry's metadata. " +
|
|
146
147
|
"read_ok is false when chain state could not be read, in which case the result is unreliable rather than empty.",
|
|
147
148
|
outputSchema: AutomationsStateOutput,
|
|
148
149
|
inputSchema: z.object({
|
|
@@ -185,7 +185,7 @@ export function registerAutomationsTools(server, api) {
|
|
|
185
185
|
},
|
|
186
186
|
description: "Apply an explicit change to an account's automations and return the unsigned setAssetManagers transaction. " +
|
|
187
187
|
"Unlike write_account_automations this is a delta, not a full desired state: automations you do not mention are left untouched. Use it to switch one automation on or off without restating the others.\n\n" +
|
|
188
|
-
"The enable array takes intents to switch on (same shapes as write_account_automations). To turn an automation OFF, call read_asset_manager_current, take the address of the manager serving it, and pass that address in the disable array: an intent with enabled: false in `enable` is rejected because the backend would ignore it. Superseded or unreadable managers still set on the account are force-disabled in the same transaction regardless.\n\n" +
|
|
188
|
+
"The enable array takes intents to switch on (same shapes as write_account_automations). To turn an automation OFF, call read_asset_manager_current, take the address of the manager serving it, and pass that address in the disable array: an intent with enabled: false in `enable` is rejected because the backend would ignore it. Superseded or unreadable managers still set on the account are force-disabled in the same transaction regardless, except a superseded cow_swapper: it is moved to the current CowSwapper with its auto-swap target (buy token, sell tokens) kept.\n\n" +
|
|
189
189
|
INTENT_REFERENCE +
|
|
190
190
|
"\n\n" +
|
|
191
191
|
CONTEXT_NOTE +
|
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 37 tools
|
|
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 37 tools:
|
|
8
8
|
|
|
9
9
|
- **Account management**: health factor, collateral, debt, positions, PnL, history
|
|
10
10
|
- **Wallet**: ERC20 balances, allowances, owned accounts, points
|
|
@@ -427,18 +427,6 @@ Parameters:
|
|
|
427
427
|
- `disable` (string[], default: []): Asset-manager addresses to switch off, as returned by read_asset_manager_current
|
|
428
428
|
- position context params and `chain_id`: same as write_account_automations
|
|
429
429
|
|
|
430
|
-
## Dev Tools (only when PK is set)
|
|
431
|
-
|
|
432
|
-
### dev_send
|
|
433
|
-
|
|
434
|
-
Sign and broadcast an unsigned transaction using a local private key (PK env var). Dev only.
|
|
435
|
-
|
|
436
|
-
Parameters:
|
|
437
|
-
- `to` (string, required): Target contract address
|
|
438
|
-
- `data` (string, required): Encoded calldata (hex)
|
|
439
|
-
- `value` (string, default: "0"): Value in wei
|
|
440
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
441
|
-
|
|
442
430
|
## Links
|
|
443
431
|
|
|
444
432
|
- Website: https://arcadia.finance
|
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 37 tools
|
|
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 37 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
|
-
## Tools (37
|
|
27
|
+
## Tools (37 total)
|
|
28
28
|
|
|
29
29
|
### Read (19)
|
|
30
30
|
|
|
@@ -69,10 +69,6 @@ Or connect to the remote server: `https://mcp.arcadia.finance/mcp`
|
|
|
69
69
|
- write_account_automations: configure automations from an intents array (complete desired state), returns the unsigned setAssetManagers tx
|
|
70
70
|
- write_account_automations_delta: switch individual automations on or off, leaving the rest untouched
|
|
71
71
|
|
|
72
|
-
### Dev (only when PK is set)
|
|
73
|
-
|
|
74
|
-
- dev_send: sign and broadcast using local private key (dev only)
|
|
75
|
-
|
|
76
72
|
## Links
|
|
77
73
|
|
|
78
74
|
- Website: https://arcadia.finance
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcadia-finance/mcp-server",
|
|
3
3
|
"mcpName": "io.github.arcadia-finance/mcp-server",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.4",
|
|
5
5
|
"description": "MCP server for Arcadia Finance. Deploy concentrated liquidity on Uniswap/Aero, Aerodrome and Velodrome with automated rebalancing, compounding, yield optimization, and leverage, or single-sided liquidity into lending pools. Live on Base, Optimism, Unichain and Robinhood.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "AGPL-3.0",
|
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/Aero (rebalance, compound, leverage) or single-sided lending.",
|
|
6
|
-
"version": "0.7.
|
|
6
|
+
"version": "0.7.4",
|
|
7
7
|
"websiteUrl": "https://arcadia.finance",
|
|
8
8
|
"icons": [
|
|
9
9
|
{
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
{
|
|
21
21
|
"registryType": "npm",
|
|
22
22
|
"identifier": "@arcadia-finance/mcp-server",
|
|
23
|
-
"version": "0.7.
|
|
23
|
+
"version": "0.7.4",
|
|
24
24
|
"transport": {
|
|
25
25
|
"type": "stdio"
|
|
26
26
|
},
|
|
@@ -49,12 +49,6 @@
|
|
|
49
49
|
"isRequired": false,
|
|
50
50
|
"isSecret": true
|
|
51
51
|
},
|
|
52
|
-
{
|
|
53
|
-
"name": "PK",
|
|
54
|
-
"description": "Private key for dev-only signing (not for production).",
|
|
55
|
-
"isRequired": false,
|
|
56
|
-
"isSecret": true
|
|
57
|
-
},
|
|
58
52
|
{
|
|
59
53
|
"name": "TRANSPORT",
|
|
60
54
|
"description": "Transport mode: stdio (default) or http.",
|
|
@@ -31,7 +31,7 @@ How you sign depends on your setup:
|
|
|
31
31
|
- **MPC wallet** (Fireblocks, Dfns, Turnkey): pass the unsigned tx to your provider's signing API
|
|
32
32
|
- **Smart account** (Safe, Biconomy): wrap the tx as a UserOperation or Safe transaction
|
|
33
33
|
- **Embedded wallet** (Privy, Dynamic): use the provider's `sendTransaction` method
|
|
34
|
-
- **Direct private key** (development only):
|
|
34
|
+
- **Direct private key** (development only): viem/ethers `sendTransaction` with a local signer
|
|
35
35
|
|
|
36
36
|
Example with viem:
|
|
37
37
|
|
|
@@ -104,12 +104,6 @@ These tools batch multiple operations into ONE atomic transaction. Always prefer
|
|
|
104
104
|
| `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". |
|
|
105
105
|
| `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. |
|
|
106
106
|
|
|
107
|
-
### Dev Tools (only available when `PK` env var is set)
|
|
108
|
-
|
|
109
|
-
| Tool | When to use |
|
|
110
|
-
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
111
|
-
| `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. |
|
|
112
|
-
|
|
113
107
|
## Shared Addresses
|
|
114
108
|
|
|
115
109
|
| Contract | Address |
|
|
@@ -129,17 +123,17 @@ Use as `pool_address` in `write_account_borrow` / `write_account_repay`, as `cre
|
|
|
129
123
|
|
|
130
124
|
### Asset Manager Addresses
|
|
131
125
|
|
|
132
|
-
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.
|
|
126
|
+
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. Old CowSwappers no longer swap: a delta apply moves the Account to the current CowSwapper and keeps its auto-swap target, and a save does the same when its intents restate that target.
|
|
133
127
|
|
|
134
128
|
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.
|
|
135
129
|
|
|
136
|
-
Standalone AMs (not tied to a DEX protocol, same address on all supported chains):
|
|
130
|
+
Standalone AMs (not tied to a DEX protocol, same address on all supported chains). The CoW Swapper is used on Base only:
|
|
137
131
|
|
|
138
132
|
| Type | Address | Chains |
|
|
139
133
|
| -------------- | -------------------------------------------- | ------------------------ |
|
|
140
134
|
| Merkl Operator | `0x969F0251360b9Cf11c68f6Ce9587924c1B8b42C6` | Base, Optimism, Unichain |
|
|
141
135
|
| Gas Relayer | `0xD938C8d04cF91094fecAF0A2018EAac483a40137` | Base, Optimism, Unichain |
|
|
142
|
-
| CoW Swapper | `
|
|
136
|
+
| CoW Swapper | `0x3BfDff5365F325032aaDB685a580e06D61e68a42` | Base only |
|
|
143
137
|
|
|
144
138
|
Protocol-specific AMs (rebalancer, compounder, yield claimer). Slipstream V2 is Base-only. All other addresses apply to every chain where the protocol exists:
|
|
145
139
|
|
|
@@ -127,7 +127,9 @@ 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.
|
|
130
|
+
Asset managers are redeployed over time. `read_asset_manager_current` lists superseded deployments 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
|
+
|
|
132
|
+
Old CowSwappers no longer swap. Any `write_account_automations_delta` call moves the Account to the current CowSwapper in the same transaction and keeps its auto-swap target (buy token and sell tokens). A save with `write_account_automations` turns the old one off in the same transaction, so restate its target in the intents: `claim_rewards` with `mode: convert_to`, or `compound_fees`, taking `buy_token` and, as `convert_tokens`, the `sell_tokens` from the deprecated cow_swapper's `metadata` in `read_asset_manager_current`. There is no need to disable an old CowSwapper by address.
|
|
131
133
|
|
|
132
134
|
---
|
|
133
135
|
|
package/dist/tools/dev/send.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { createWalletClient, createPublicClient, http } from "viem";
|
|
3
|
-
import { privateKeyToAccount } from "viem/accounts";
|
|
4
|
-
import { viemChains } from "../../clients/chain.js";
|
|
5
|
-
import { CHAIN_ID_DESCRIPTION } from "../../config/chains.js";
|
|
6
|
-
import { DevSendOutput } from "../output-schemas.js";
|
|
7
|
-
import { validateAddress, validateHexCalldata, parseWeiDecimalString, } from "../../utils/validation.js";
|
|
8
|
-
export function registerSendTool(server, chains) {
|
|
9
|
-
const pk = process.env.PK;
|
|
10
|
-
if (!pk)
|
|
11
|
-
return;
|
|
12
|
-
server.registerTool("dev_send", {
|
|
13
|
-
annotations: {
|
|
14
|
-
title: "Sign and Send Transaction",
|
|
15
|
-
readOnlyHint: false,
|
|
16
|
-
destructiveHint: true,
|
|
17
|
-
idempotentHint: false,
|
|
18
|
-
openWorldHint: true,
|
|
19
|
-
},
|
|
20
|
-
description: "DEV ONLY: Sign and broadcast an unsigned transaction using a local private key (PK env var). For production, use a dedicated wallet MCP server (Fireblocks, Safe, Turnkey, etc.) instead of this tool. Takes the transaction object returned by any write_* tool and submits it onchain.",
|
|
21
|
-
outputSchema: DevSendOutput,
|
|
22
|
-
inputSchema: z.object({
|
|
23
|
-
to: z.string().describe("Target contract address"),
|
|
24
|
-
data: z.string().describe("Encoded calldata (hex)"),
|
|
25
|
-
value: z.string().default("0").describe("Value in wei (default '0')"),
|
|
26
|
-
chain_id: z.number().default(8453).describe(CHAIN_ID_DESCRIPTION),
|
|
27
|
-
}),
|
|
28
|
-
}, async (params) => {
|
|
29
|
-
try {
|
|
30
|
-
const validTo = validateAddress(params.to, "to");
|
|
31
|
-
const calldata = validateHexCalldata(params.data, "data");
|
|
32
|
-
const valueWei = parseWeiDecimalString(params.value, "value");
|
|
33
|
-
const chain = viemChains[params.chain_id];
|
|
34
|
-
const chainConfig = chains[params.chain_id];
|
|
35
|
-
if (!chainConfig) {
|
|
36
|
-
return {
|
|
37
|
-
content: [
|
|
38
|
-
{ type: "text", text: `Error: Unsupported chain ID ${params.chain_id}` },
|
|
39
|
-
],
|
|
40
|
-
isError: true,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const transport = http(chainConfig.rpcUrl);
|
|
44
|
-
const account = privateKeyToAccount(pk);
|
|
45
|
-
const wallet = createWalletClient({ account, chain, transport });
|
|
46
|
-
const client = createPublicClient({ chain, transport });
|
|
47
|
-
const gasEstimate = await client.estimateGas({
|
|
48
|
-
account: account.address,
|
|
49
|
-
to: validTo,
|
|
50
|
-
data: calldata,
|
|
51
|
-
value: valueWei,
|
|
52
|
-
});
|
|
53
|
-
const gasLimit = (gasEstimate * 120n) / 100n;
|
|
54
|
-
const hash = await wallet.sendTransaction({
|
|
55
|
-
to: validTo,
|
|
56
|
-
data: calldata,
|
|
57
|
-
value: valueWei,
|
|
58
|
-
gas: gasLimit,
|
|
59
|
-
chain,
|
|
60
|
-
});
|
|
61
|
-
const receipt = await client.waitForTransactionReceipt({ hash, timeout: 60_000 });
|
|
62
|
-
const result = {
|
|
63
|
-
signer: account.address,
|
|
64
|
-
txHash: receipt.transactionHash,
|
|
65
|
-
status: receipt.status,
|
|
66
|
-
blockNumber: Number(receipt.blockNumber),
|
|
67
|
-
gasLimit: Number(gasLimit),
|
|
68
|
-
gasUsed: Number(receipt.gasUsed),
|
|
69
|
-
};
|
|
70
|
-
return {
|
|
71
|
-
content: [
|
|
72
|
-
{
|
|
73
|
-
type: "text",
|
|
74
|
-
text: JSON.stringify(result, null, 2),
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
structuredContent: result,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
catch (err) {
|
|
81
|
-
return {
|
|
82
|
-
content: [
|
|
83
|
-
{
|
|
84
|
-
type: "text",
|
|
85
|
-
text: `Error: ${err instanceof Error ? err.message : String(err)}`,
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
isError: true,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|