@arcadia-finance/mcp-server 0.5.0 → 0.5.2
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 +36 -35
- package/dist/clients/api.js +0 -6
- package/dist/clients/chain.js +25 -0
- package/dist/config/addresses.js +8 -1
- package/dist/config/chains.js +12 -4
- package/dist/tools/read/account.js +44 -2
- package/dist/tools/read/assets.js +2 -2
- package/dist/tools/read/pools.js +2 -1
- package/dist/tools/read/shapes.js +48 -0
- package/dist/tools/read/strategy.js +2 -1
- package/llms-full.txt +32 -32
- package/llms.txt +1 -1
- package/package.json +3 -3
- package/server.json +8 -2
- package/skills/clamm-liquidity/SKILL.md +23 -23
- package/skills/clamm-liquidity/automation.md +43 -43
- package/skills/clamm-liquidity/selection.md +8 -8
- package/skills/openclaw/SKILL.md +1 -1
- package/skills/openclaw/contracts.md +9 -7
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
[](LICENSE.md)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
7
|
[](https://modelcontextprotocol.io/)
|
|
8
|
-
[](https://smithery.ai/servers/arcadia-finance/mcp-server)
|
|
9
9
|
[](https://lobehub.com/mcp/arcadia-finance-mcp-server)
|
|
10
|
-
[](https://glama.ai/mcp/servers/arcadia-finance/mcp-server)
|
|
11
11
|
|
|
12
12
|
MCP server for [Arcadia Finance](https://arcadia.finance), a platform for concentrated liquidity on Uniswap and Aerodrome with automated rebalancing, compounding, yield optimization, and leverage, or single-sided liquidity into lending pools. Read protocol data and build unsigned transactions for LP management, borrowing, deposits, and more.
|
|
13
13
|
|
|
@@ -40,31 +40,31 @@ Designed for AI agents (Claude, Cursor, etc.) to interact with Arcadia onchain.
|
|
|
40
40
|
| `read.strategy.info` | Full detail for a specific LP strategy: APY per range width, pool config. |
|
|
41
41
|
| `read.strategy.recommendation` | Rebalancing recommendation for an account. |
|
|
42
42
|
| `read.guides` | Reference guides: automation setup, strategy selection, strategy templates. |
|
|
43
|
-
| `read.asset_manager.intents` | Automation intents and their params; add `account_address` for live per-account availability.
|
|
43
|
+
| `read.asset_manager.intents` | Automation intents and their params; add `account_address` for live per-account availability. |
|
|
44
44
|
| `read.asset_manager.current` | Automations enabled on an account: decoded config, mapped intents, Merkl state, superseded managers. |
|
|
45
45
|
|
|
46
46
|
### Write Tools
|
|
47
47
|
|
|
48
48
|
All write tools return unsigned transactions as `{ to, data, value, chainId }`.
|
|
49
49
|
|
|
50
|
-
| Tool
|
|
51
|
-
|
|
|
52
|
-
| `write.wallet.approve`
|
|
53
|
-
| `write.pool.deposit`
|
|
54
|
-
| `write.pool.redeem`
|
|
55
|
-
| `write.account.create`
|
|
56
|
-
| `write.account.deposit`
|
|
57
|
-
| `write.account.withdraw`
|
|
58
|
-
| `write.account.borrow`
|
|
59
|
-
| `write.account.repay`
|
|
60
|
-
| `write.account.add_liquidity`
|
|
61
|
-
| `write.account.remove_liquidity`
|
|
62
|
-
| `write.account.swap`
|
|
63
|
-
| `write.account.deleverage`
|
|
64
|
-
| `write.account.close`
|
|
65
|
-
| `write.account.stake`
|
|
66
|
-
| `write.account.automations`
|
|
67
|
-
| `write.account.automations_delta`
|
|
50
|
+
| Tool | Description |
|
|
51
|
+
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
52
|
+
| `write.wallet.approve` | Approve an ERC20 token for spending. Required before depositing into an account. Call `read.wallet.allowances` first to check if already approved. |
|
|
53
|
+
| `write.pool.deposit` | Lend the pool's underlying asset into an ERC-4626 tranche to earn interest. Mints tranche shares to the receiver. |
|
|
54
|
+
| `write.pool.redeem` | Redeem tranche shares back into the underlying asset (lender exit). |
|
|
55
|
+
| `write.account.create` | Create a new Arcadia account via Factory. |
|
|
56
|
+
| `write.account.deposit` | Deposit ERC20 tokens into an account. |
|
|
57
|
+
| `write.account.withdraw` | Withdraw assets from an account. |
|
|
58
|
+
| `write.account.borrow` | Borrow from a lending pool. |
|
|
59
|
+
| `write.account.repay` | Repay debt to a lending pool from wallet. |
|
|
60
|
+
| `write.account.add_liquidity` | Flash-action: deposit + swap + mint LP + optional leverage, atomically. |
|
|
61
|
+
| `write.account.remove_liquidity` | Remove/decrease LP position liquidity. |
|
|
62
|
+
| `write.account.swap` | Swap assets within an account (backend-routed). |
|
|
63
|
+
| `write.account.deleverage` | Repay debt by selling collateral (swap + repay in one tx). |
|
|
64
|
+
| `write.account.close` | Atomic close: burn LP + swap + repay debt in one tx. |
|
|
65
|
+
| `write.account.stake` | Stake, unstake, or claim rewards for LP positions. |
|
|
66
|
+
| `write.account.automations` | Configure automations from an intents array (full desired state). Returns the unsigned setAssetManagers tx. |
|
|
67
|
+
| `write.account.automations_delta` | Enable/disable individual automations, leaving the rest untouched. |
|
|
68
68
|
|
|
69
69
|
### Dev Tools
|
|
70
70
|
|
|
@@ -131,18 +131,19 @@ yarn build
|
|
|
131
131
|
|
|
132
132
|
**Environment variables:**
|
|
133
133
|
|
|
134
|
-
| Variable
|
|
135
|
-
|
|
|
136
|
-
| `RPC_URL_BASE`
|
|
137
|
-
| `RPC_URL_UNICHAIN`
|
|
138
|
-
| `RPC_URL_OPTIMISM`
|
|
139
|
-
| `
|
|
140
|
-
| `
|
|
141
|
-
| `
|
|
142
|
-
| `
|
|
143
|
-
| `
|
|
134
|
+
| Variable | Required | Default | Transport | Description |
|
|
135
|
+
| ------------------- | -------- | ----------------------------- | --------- | -------------------------------------------------------------- |
|
|
136
|
+
| `RPC_URL_BASE` | No | Public RPC | Both | RPC URL for Base (8453). |
|
|
137
|
+
| `RPC_URL_UNICHAIN` | No | Public RPC | Both | RPC URL for Unichain (130). |
|
|
138
|
+
| `RPC_URL_OPTIMISM` | No | Public RPC | Both | RPC URL for Optimism (10). |
|
|
139
|
+
| `RPC_URL_ROBINHOOD` | No | Public RPC | Both | RPC URL for Robinhood (4663). |
|
|
140
|
+
| `PK` | No | — | Both | Private key (hex) for dev-only `dev.send` tool. |
|
|
141
|
+
| `TRANSPORT` | No | `stdio` | — | Transport mode: `stdio` or `http`. |
|
|
142
|
+
| `PORT` | No | `3000` | HTTP | Listen port for HTTP transport. |
|
|
143
|
+
| `ALLOWED_ORIGINS` | No | `https://mcp.arcadia.finance` | HTTP | Comma-separated allowed Origin headers (CORS / DNS rebinding). |
|
|
144
|
+
| `RATE_LIMIT_RPM` | No | `60` | HTTP | Max requests per minute per session. |
|
|
144
145
|
|
|
145
|
-
**Supported chains:** Base (8453), Unichain (130), Optimism (10)
|
|
146
|
+
**Supported chains:** Base (8453), Unichain (130), Optimism (10), Robinhood (4663)
|
|
146
147
|
|
|
147
148
|
## MCP Client Configuration
|
|
148
149
|
|
|
@@ -210,8 +211,8 @@ ln -s /path/to/mcp-server/skills/clamm-liquidity ~/.claude/skills/clamm-liquidit
|
|
|
210
211
|
|
|
211
212
|
Available skills:
|
|
212
213
|
|
|
213
|
-
| Skill | Description
|
|
214
|
-
| ----------------- |
|
|
214
|
+
| Skill | Description |
|
|
215
|
+
| ----------------- | ------------------------------------------------------------------------------------------------- |
|
|
215
216
|
| `clamm-liquidity` | Concentrated liquidity management: concepts, intent-based automation, and step-by-step workflows. |
|
|
216
217
|
|
|
217
218
|
## Reporting Issues
|
|
@@ -236,7 +237,7 @@ Pull requests for documentation fixes are welcome from agents and humans alike.
|
|
|
236
237
|
- **LobeHub:** [lobehub.com](https://lobehub.com/mcp/arcadia-finance-mcp-server)
|
|
237
238
|
- **PulseMCP:** [pulsemcp.com](https://www.pulsemcp.com/servers/arcadia-finance)
|
|
238
239
|
- **MCP Market:** [mcpmarket.com](https://mcpmarket.com/server/arcadia-finance)
|
|
239
|
-
- **Glama:** [glama.ai](https://glama.ai/mcp/servers/arcadia-finance/
|
|
240
|
+
- **Glama:** [glama.ai](https://glama.ai/mcp/servers/arcadia-finance/mcp-server)
|
|
240
241
|
- **awesome-mcp-servers:** [github.com/TensorBlock/awesome-mcp-servers](https://github.com/TensorBlock/awesome-mcp-servers)
|
|
241
242
|
|
|
242
243
|
## Development
|
package/dist/clients/api.js
CHANGED
|
@@ -120,12 +120,6 @@ export class ArcadiaApiClient {
|
|
|
120
120
|
async getPools(chainId) {
|
|
121
121
|
return this.get("/pools", { chain_id: chainId });
|
|
122
122
|
}
|
|
123
|
-
async getPoolsData(chainId, poolAddress) {
|
|
124
|
-
const params = { chain_id: chainId };
|
|
125
|
-
if (poolAddress)
|
|
126
|
-
params.pool_address = poolAddress;
|
|
127
|
-
return this.get("/pools_data", params);
|
|
128
|
-
}
|
|
129
123
|
async getPoolApyHistory(chainId, poolAddress, days = 14) {
|
|
130
124
|
return this.get("/pools/historic_apy", {
|
|
131
125
|
chain_id: chainId,
|
package/dist/clients/chain.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { createPublicClient, http, defineChain } from "viem";
|
|
2
2
|
import { base, optimism } from "viem/chains";
|
|
3
|
+
// multicall3 must be declared or getChainContractAddress throws ChainDoesNotSupportContract,
|
|
4
|
+
// which takes out every client.multicall() call — read.wallet.balances, read.wallet.allowances and
|
|
5
|
+
// the account metadata read. It is deployed at the canonical address here (3808 bytes on chain).
|
|
3
6
|
const unichain = defineChain({
|
|
4
7
|
id: 130,
|
|
5
8
|
name: "Unichain",
|
|
@@ -7,11 +10,28 @@ const unichain = defineChain({
|
|
|
7
10
|
rpcUrls: {
|
|
8
11
|
default: { http: ["https://mainnet.unichain.org"] },
|
|
9
12
|
},
|
|
13
|
+
contracts: {
|
|
14
|
+
multicall3: { address: "0xcA11bde05977b3631167028862bE2a173976CA11" },
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
// Robinhood is not in viem/chains either. multicall3 sits at the canonical address (3808 bytes on
|
|
18
|
+
// chain) and is declared with no blockCreated, so no historical gating applies.
|
|
19
|
+
const robinhood = defineChain({
|
|
20
|
+
id: 4663,
|
|
21
|
+
name: "Robinhood",
|
|
22
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
23
|
+
rpcUrls: {
|
|
24
|
+
default: { http: ["https://rpc.mainnet.chain.robinhood.com"] },
|
|
25
|
+
},
|
|
26
|
+
contracts: {
|
|
27
|
+
multicall3: { address: "0xcA11bde05977b3631167028862bE2a173976CA11" },
|
|
28
|
+
},
|
|
10
29
|
});
|
|
11
30
|
const viemChains = {
|
|
12
31
|
8453: base,
|
|
13
32
|
10: optimism,
|
|
14
33
|
130: unichain,
|
|
34
|
+
4663: robinhood,
|
|
15
35
|
};
|
|
16
36
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
37
|
const clients = new Map();
|
|
@@ -19,6 +39,11 @@ export function getPublicClient(chainId, chainConfigs) {
|
|
|
19
39
|
let client = clients.get(chainId);
|
|
20
40
|
if (!client) {
|
|
21
41
|
const config = chainConfigs[chainId];
|
|
42
|
+
if (!config?.rpcUrl) {
|
|
43
|
+
// Named rather than handing viem an empty transport, which fails later as an opaque
|
|
44
|
+
// network error against a chain the caller never suspects is unconfigured.
|
|
45
|
+
throw new Error(`No RPC URL configured for chain ${chainId}. Set RPC_URL_${config?.name?.toUpperCase() ?? chainId}.`);
|
|
46
|
+
}
|
|
22
47
|
client = createPublicClient({
|
|
23
48
|
chain: viemChains[chainId],
|
|
24
49
|
transport: http(config.rpcUrl),
|
package/dist/config/addresses.js
CHANGED
|
@@ -100,7 +100,8 @@ export function backendProtocolToDexProtocol(protocol) {
|
|
|
100
100
|
export const STATE_VIEWERS = {
|
|
101
101
|
8453: "0xA3c0c9b65baD0b08107Aa264b0f3dB444b867A71",
|
|
102
102
|
130: "0x86e8631A016F9068C3f085fAF484Ee3F5fDee8f2",
|
|
103
|
-
10: "
|
|
103
|
+
10: "0xc18a3169788F4F75A170290584ECA6395C75Ecdb",
|
|
104
|
+
4663: "0xF3334192D15450CdD385c8B70e03f9A6bD9E673b",
|
|
104
105
|
};
|
|
105
106
|
// LP position manager address (lowercase) → dex_protocol value
|
|
106
107
|
// Chain-specific: non-staked LP position manager addresses differ per chain
|
|
@@ -123,6 +124,12 @@ export const CHAIN_POSITION_MANAGERS = {
|
|
|
123
124
|
"0xc36442b4a4522e871399cd717abdd847ab11fe88": "uniV3",
|
|
124
125
|
"0x3c3ea4b57a46241e54610e5f022e5c45859a1017": "uniV4",
|
|
125
126
|
},
|
|
127
|
+
// Uniswap only. Aerodrome, Velodrome and Slipstream have no deployment on Robinhood, so there is
|
|
128
|
+
// no position manager for them to name.
|
|
129
|
+
4663: {
|
|
130
|
+
"0x73991a25c818bf1f1128deaab1492d45638de0d3": "uniV3",
|
|
131
|
+
"0x58daec3116aae6d93017baaea7749052e8a04fa7": "uniV4",
|
|
132
|
+
},
|
|
126
133
|
};
|
|
127
134
|
// Staked / wrapped-staked position managers. V1 and V2 are deployed at the same
|
|
128
135
|
// address on every chain; the V3 pair was deployed at different addresses on
|
package/dist/config/chains.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const
|
|
1
|
+
// Ethereum (1) is absent deliberately: Arcadia is not deployed on mainnet, so every address a tool
|
|
2
|
+
// would read there has no code. It joins when the contracts land.
|
|
3
|
+
export const SUPPORTED_CHAIN_IDS = [8453, 130, 10, 4663];
|
|
4
|
+
export const CHAIN_ID_DESCRIPTION = "Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)";
|
|
5
|
+
export const SUPPORTED_CHAINS_ERROR = "Supported chains: Base (8453), Unichain (130), Optimism (10), and Robinhood (4663)";
|
|
4
6
|
export function getChainConfigs() {
|
|
5
7
|
return {
|
|
6
8
|
8453: {
|
|
@@ -19,7 +21,13 @@ export function getChainConfigs() {
|
|
|
19
21
|
name: "optimism",
|
|
20
22
|
chainId: 10,
|
|
21
23
|
rpcUrl: process.env.RPC_URL_OPTIMISM ?? "https://mainnet.optimism.io",
|
|
22
|
-
stateViewer: "
|
|
24
|
+
stateViewer: "0xc18a3169788F4F75A170290584ECA6395C75Ecdb",
|
|
25
|
+
},
|
|
26
|
+
4663: {
|
|
27
|
+
name: "robinhood",
|
|
28
|
+
chainId: 4663,
|
|
29
|
+
rpcUrl: process.env.RPC_URL_ROBINHOOD ?? "https://rpc.mainnet.chain.robinhood.com",
|
|
30
|
+
stateViewer: "0xF3334192D15450CdD385c8B70e03f9A6bD9E673b",
|
|
23
31
|
},
|
|
24
32
|
};
|
|
25
33
|
}
|
|
@@ -5,6 +5,48 @@ import { getPublicClient } from "../../clients/chain.js";
|
|
|
5
5
|
import { AUTOMATION_GROUPS, backendProtocolToDexProtocol, GAS_RELAYER, positionManagerToDexProtocol, } from "../../config/addresses.js";
|
|
6
6
|
import { validateAddress, validateChainId } from "../../utils/validation.js";
|
|
7
7
|
import { AccountInfoOutput, AccountHistoryOutput, AccountPnlOutput } from "../output-schemas.js";
|
|
8
|
+
/**
|
|
9
|
+
* Normalise `/accounts/historic_account_values` into a time series.
|
|
10
|
+
*
|
|
11
|
+
* The endpoint answers `{ values: { "<unix seconds>": <net value>, ... } }` — an
|
|
12
|
+
* object keyed by timestamp, not an array. Coercing a non-array response to `[]`
|
|
13
|
+
* therefore discarded every snapshot and reported it as "no history", which is
|
|
14
|
+
* indistinguishable from an account that genuinely has none.
|
|
15
|
+
*
|
|
16
|
+
* Both shapes are accepted so this survives the endpoint changing, and anything
|
|
17
|
+
* that is neither throws rather than reporting an empty series: a read that did
|
|
18
|
+
* not work has to look different from a read that found nothing.
|
|
19
|
+
*/
|
|
20
|
+
export function normalizeAccountHistory(raw) {
|
|
21
|
+
if (Array.isArray(raw))
|
|
22
|
+
return raw;
|
|
23
|
+
if (raw === null || raw === undefined)
|
|
24
|
+
return [];
|
|
25
|
+
const hasValues = typeof raw === "object" && raw !== null && "values" in raw;
|
|
26
|
+
const values = raw.values;
|
|
27
|
+
// A `values` key that is present but carries nothing is the empty window this
|
|
28
|
+
// function claims to handle — an array or null there is an answer, not an
|
|
29
|
+
// unrecognised shape.
|
|
30
|
+
if (hasValues && (values === null || values === undefined))
|
|
31
|
+
return [];
|
|
32
|
+
if (Array.isArray(values))
|
|
33
|
+
return values;
|
|
34
|
+
if (values && typeof values === "object") {
|
|
35
|
+
return Object.entries(values)
|
|
36
|
+
.map(([timestamp, netValue]) => {
|
|
37
|
+
// A non-numeric key would become NaN, which sorts unpredictably and
|
|
38
|
+
// serialises to null. For a function whose point is refusing to mangle
|
|
39
|
+
// unexpected shapes, that gets the same throw as an unknown shape.
|
|
40
|
+
const parsed = Number(timestamp);
|
|
41
|
+
if (!Number.isFinite(parsed)) {
|
|
42
|
+
throw new Error(`Unexpected account-history timestamp key: ${JSON.stringify(timestamp)}`);
|
|
43
|
+
}
|
|
44
|
+
return { timestamp: parsed, net_value: netValue };
|
|
45
|
+
})
|
|
46
|
+
.sort((a, b) => a.timestamp - b.timestamp);
|
|
47
|
+
}
|
|
48
|
+
throw new Error(`Unexpected account-history response shape: ${JSON.stringify(raw).slice(0, 200)}`);
|
|
49
|
+
}
|
|
8
50
|
function trimOverview(overview, chainId) {
|
|
9
51
|
const trimmed = { ...overview };
|
|
10
52
|
if (Array.isArray(trimmed.historic_actions)) {
|
|
@@ -234,7 +276,7 @@ export function registerAccountTools(server, api, chains) {
|
|
|
234
276
|
idempotentHint: true,
|
|
235
277
|
openWorldHint: true,
|
|
236
278
|
},
|
|
237
|
-
description: "Get
|
|
279
|
+
description: "Get an Arcadia account's historical net value over time. Returns a time series of snapshots, oldest first, each `{ timestamp, net_value }` — `timestamp` is unix seconds and `net_value` is USD (human-readable, not raw units). Useful for charting account performance over a period. An empty `history` means the account has no snapshots in the window, not that the read failed.",
|
|
238
280
|
inputSchema: {
|
|
239
281
|
account_address: z.string().describe("Arcadia account address"),
|
|
240
282
|
days: z.number().default(14).describe("Number of days of history (default 14)"),
|
|
@@ -251,7 +293,7 @@ export function registerAccountTools(server, api, chains) {
|
|
|
251
293
|
};
|
|
252
294
|
}
|
|
253
295
|
const raw = await api.getAccountHistory(validChainId, account_address, days);
|
|
254
|
-
const result = { history:
|
|
296
|
+
const result = { history: normalizeAccountHistory(raw) };
|
|
255
297
|
return {
|
|
256
298
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
257
299
|
structuredContent: result,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { expectArrayOrWrapped } from "./shapes.js";
|
|
2
3
|
import { CHAIN_ID_DESCRIPTION } from "../../config/chains.js";
|
|
3
4
|
import { AssetListOutput, AssetPricesOutput } from "../output-schemas.js";
|
|
4
5
|
export function registerAssetTools(server, api) {
|
|
@@ -22,8 +23,7 @@ export function registerAssetTools(server, api) {
|
|
|
22
23
|
}, async ({ search, chain_id }) => {
|
|
23
24
|
try {
|
|
24
25
|
const raw = await api.getAssets(chain_id);
|
|
25
|
-
const
|
|
26
|
-
const allAssets = (Array.isArray(raw) ? raw : (obj.assets ?? obj.data ?? []));
|
|
26
|
+
const allAssets = expectArrayOrWrapped(raw, "assets", "assets", "data");
|
|
27
27
|
let assets = allAssets.map((a) => ({
|
|
28
28
|
address: a.address ?? a.asset_address,
|
|
29
29
|
symbol: a.name ?? a.symbol ?? a.asset_symbol,
|
package/dist/tools/read/pools.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { expectArray } from "./shapes.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { CHAIN_ID_DESCRIPTION } from "../../config/chains.js";
|
|
3
4
|
import { PoolListOutput, PoolDetailOutput } from "../output-schemas.js";
|
|
@@ -28,7 +29,7 @@ export function registerPoolTools(server, api) {
|
|
|
28
29
|
structuredContent: empty,
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
|
-
const wrapped = { pools:
|
|
32
|
+
const wrapped = { pools: expectArray(result, "pools") };
|
|
32
33
|
return {
|
|
33
34
|
content: [{ type: "text", text: JSON.stringify(wrapped, null, 2) }],
|
|
34
35
|
structuredContent: wrapped,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response-shape guards shared by the read tools.
|
|
3
|
+
*
|
|
4
|
+
* `Array.isArray(raw) ? raw : []` is the pattern that made a populated
|
|
5
|
+
* account-history response report `{"history":[]}`: the endpoint answered with
|
|
6
|
+
* an object, the guard did not recognise it, and the tool said "nothing here".
|
|
7
|
+
* A read that did not work has to look different from a read that found
|
|
8
|
+
* nothing, so an unrecognised shape throws and the handler surfaces it as
|
|
9
|
+
* `isError` rather than as an empty list.
|
|
10
|
+
*/
|
|
11
|
+
/** An array response, or `[]` for an absent one. Throws on anything else. */
|
|
12
|
+
export function expectArray(raw, what) {
|
|
13
|
+
if (Array.isArray(raw))
|
|
14
|
+
return raw;
|
|
15
|
+
// An absent body is a legitimately empty answer; a present body of the wrong
|
|
16
|
+
// shape is not.
|
|
17
|
+
if (raw === null || raw === undefined)
|
|
18
|
+
return [];
|
|
19
|
+
throw new Error(`Unexpected ${what} response shape: ${JSON.stringify(raw).slice(0, 200)}`);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* An array response, or one wrapped in the first matching `keys` field.
|
|
23
|
+
*
|
|
24
|
+
* `/assets` answers `{ assets: [...] }`, so a bare `expectArray` would reject a
|
|
25
|
+
* valid body. The part worth keeping is the refusal: `?? []` at the end of a
|
|
26
|
+
* wrapper chain turns an unrecognised body into "no assets", which is the same
|
|
27
|
+
* silent-empty failure as the account-history bug.
|
|
28
|
+
*/
|
|
29
|
+
export function expectArrayOrWrapped(raw, what, ...keys) {
|
|
30
|
+
if (Array.isArray(raw))
|
|
31
|
+
return raw;
|
|
32
|
+
if (raw === null || raw === undefined)
|
|
33
|
+
return [];
|
|
34
|
+
if (typeof raw === "object") {
|
|
35
|
+
const obj = raw;
|
|
36
|
+
for (const key of keys) {
|
|
37
|
+
if (!(key in obj))
|
|
38
|
+
continue;
|
|
39
|
+
const value = obj[key];
|
|
40
|
+
if (Array.isArray(value))
|
|
41
|
+
return value;
|
|
42
|
+
// The wrapper is there and carries nothing: an answer, not a bad shape.
|
|
43
|
+
if (value === null || value === undefined)
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
throw new Error(`Unexpected ${what} response shape: ${JSON.stringify(raw).slice(0, 200)}`);
|
|
48
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { expectArray } from "./shapes.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { CHAIN_ID_DESCRIPTION } from "../../config/chains.js";
|
|
3
4
|
import { StrategyListOutput, StrategyDetailOutput, StrategyRecommendationOutput, } from "../output-schemas.js";
|
|
@@ -27,7 +28,7 @@ export function registerStrategyTools(server, api) {
|
|
|
27
28
|
let total;
|
|
28
29
|
if (featured_only) {
|
|
29
30
|
const raw = await api.getFeatured(chain_id);
|
|
30
|
-
const all =
|
|
31
|
+
const all = expectArray(raw, "featured strategies");
|
|
31
32
|
// The /featured endpoint currently returns curated Base strategies regardless of
|
|
32
33
|
// chain_id. Filter by the chain baked into each strategy's url (`/farm/<chainId>/…`)
|
|
33
34
|
// so we never hand back strategies that belong to a different chain.
|
package/llms-full.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Arcadia Finance MCP Server
|
|
2
2
|
|
|
3
|
-
> MCP server for Arcadia Finance, a DeFi protocol for concentrated liquidity (Uniswap v3/v4, Aerodrome/Slipstream, Velodrome) with automated rebalancing, compounding, yield optimization, and leverage, or single-sided liquidity into lending pools. Supported chains: Base (8453), Unichain (130), Optimism (10).
|
|
3
|
+
> MCP server for Arcadia Finance, a DeFi protocol for concentrated liquidity (Uniswap v3/v4, Aerodrome/Slipstream, Velodrome) with automated rebalancing, compounding, yield optimization, and leverage, or single-sided liquidity into lending pools. Supported chains: Base (8453), Unichain (130), Optimism (10), Robinhood (4663).
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ Get full overview of an Arcadia account: health factor, collateral value, debt,
|
|
|
32
32
|
|
|
33
33
|
Parameters:
|
|
34
34
|
- `account_address` (string, required): Arcadia account address
|
|
35
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
35
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
36
36
|
|
|
37
37
|
### read.account.history
|
|
38
38
|
|
|
@@ -41,7 +41,7 @@ Get historical collateral and debt values for an Arcadia account over time.
|
|
|
41
41
|
Parameters:
|
|
42
42
|
- `account_address` (string, required): Arcadia account address
|
|
43
43
|
- `days` (number, default: 14): Number of days of history
|
|
44
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
44
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
45
45
|
|
|
46
46
|
### read.account.pnl
|
|
47
47
|
|
|
@@ -49,7 +49,7 @@ Get PnL (cost basis) and yield earned for an Arcadia account.
|
|
|
49
49
|
|
|
50
50
|
Parameters:
|
|
51
51
|
- `account_address` (string, required): Arcadia account address
|
|
52
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
52
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
53
53
|
|
|
54
54
|
### read.wallet.balances
|
|
55
55
|
|
|
@@ -58,7 +58,7 @@ Get native ETH and ERC20 token balances for a wallet address.
|
|
|
58
58
|
Parameters:
|
|
59
59
|
- `wallet_address` (string, required): Wallet address to check balances for
|
|
60
60
|
- `token_addresses` (string[], required): ERC20 token contract addresses to check
|
|
61
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
61
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
62
62
|
|
|
63
63
|
### read.wallet.allowances
|
|
64
64
|
|
|
@@ -68,7 +68,7 @@ Parameters:
|
|
|
68
68
|
- `owner_address` (string, required): Token owner address (the wallet granting approval)
|
|
69
69
|
- `spender_address` (string, required): Spender address to check allowance for
|
|
70
70
|
- `token_addresses` (string[], required): ERC20 token contract addresses to check
|
|
71
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
71
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
72
72
|
|
|
73
73
|
### read.wallet.accounts
|
|
74
74
|
|
|
@@ -76,7 +76,7 @@ List all Arcadia accounts owned by a wallet address.
|
|
|
76
76
|
|
|
77
77
|
Parameters:
|
|
78
78
|
- `wallet_address` (string, required): Wallet address to list accounts for
|
|
79
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
79
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
80
80
|
|
|
81
81
|
### read.wallet.points
|
|
82
82
|
|
|
@@ -91,7 +91,7 @@ List supported collateral assets on Arcadia.
|
|
|
91
91
|
|
|
92
92
|
Parameters:
|
|
93
93
|
- `search` (string, optional): Filter assets by symbol (case-insensitive substring match)
|
|
94
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
94
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
95
95
|
|
|
96
96
|
### read.asset.prices
|
|
97
97
|
|
|
@@ -99,14 +99,14 @@ Get USD prices for one or more asset addresses.
|
|
|
99
99
|
|
|
100
100
|
Parameters:
|
|
101
101
|
- `asset_addresses` (string, required): Single address or comma-separated addresses
|
|
102
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
102
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
103
103
|
|
|
104
104
|
### read.pool.list
|
|
105
105
|
|
|
106
106
|
List all Arcadia lending pools: TVL, utilization, available liquidity.
|
|
107
107
|
|
|
108
108
|
Parameters:
|
|
109
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
109
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
110
110
|
|
|
111
111
|
### read.pool.info
|
|
112
112
|
|
|
@@ -115,7 +115,7 @@ Get detailed info for a single lending pool including APY history over time.
|
|
|
115
115
|
Parameters:
|
|
116
116
|
- `pool_address` (string, required): Pool address
|
|
117
117
|
- `days` (number, default: 14): Number of days of APY history
|
|
118
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
118
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
119
119
|
|
|
120
120
|
### read.point_leaderboard
|
|
121
121
|
|
|
@@ -133,7 +133,7 @@ Parameters:
|
|
|
133
133
|
- `featured_only` (boolean, default: false): Return only featured/curated strategies
|
|
134
134
|
- `limit` (number, default: 25): Max strategies to return
|
|
135
135
|
- `offset` (number, default: 0): Skip first N strategies for pagination
|
|
136
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
136
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
137
137
|
|
|
138
138
|
### read.strategy.info
|
|
139
139
|
|
|
@@ -141,7 +141,7 @@ Get full detail for a specific LP strategy by ID.
|
|
|
141
141
|
|
|
142
142
|
Parameters:
|
|
143
143
|
- `strategy_id` (number, required): Strategy ID
|
|
144
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
144
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
145
145
|
|
|
146
146
|
### read.strategy.recommendation
|
|
147
147
|
|
|
@@ -149,7 +149,7 @@ Get a rebalancing recommendation for an Arcadia account.
|
|
|
149
149
|
|
|
150
150
|
Parameters:
|
|
151
151
|
- `account_address` (string, required): Arcadia account address
|
|
152
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
152
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
153
153
|
|
|
154
154
|
### read.asset_manager.intents
|
|
155
155
|
|
|
@@ -158,7 +158,7 @@ List the automation intents Arcadia supports with the parameters each accepts. P
|
|
|
158
158
|
Parameters:
|
|
159
159
|
- `account_address` (string, optional): Include it to get live per-account availability
|
|
160
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),
|
|
161
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
162
162
|
|
|
163
163
|
### read.asset_manager.current
|
|
164
164
|
|
|
@@ -166,7 +166,7 @@ Read which asset managers are enabled on an account, with their decoded on-chain
|
|
|
166
166
|
|
|
167
167
|
Parameters:
|
|
168
168
|
- `account_address` (string, required): Arcadia account address
|
|
169
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
169
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
170
170
|
|
|
171
171
|
### read.guides
|
|
172
172
|
|
|
@@ -188,7 +188,7 @@ Parameters:
|
|
|
188
188
|
- `spender_address` (string, required): Address being approved
|
|
189
189
|
- `asset_type` (enum, default: "erc20"): erc20 | erc721 | erc1155
|
|
190
190
|
- `amount` (string, default: "max_uint256"): ERC20 only: amount in raw units
|
|
191
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
191
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
192
192
|
|
|
193
193
|
### write.pool.deposit
|
|
194
194
|
|
|
@@ -198,7 +198,7 @@ Parameters:
|
|
|
198
198
|
- `tranche_address` (string, required): Tranche contract address (get from `read.pool.list`, each pool's `tranches[0].address`)
|
|
199
199
|
- `assets` (string, required): Amount of underlying asset to deposit in raw units
|
|
200
200
|
- `receiver` (string, required): Address that receives the minted tranche shares
|
|
201
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
201
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
202
202
|
|
|
203
203
|
### write.pool.redeem
|
|
204
204
|
|
|
@@ -209,7 +209,7 @@ Parameters:
|
|
|
209
209
|
- `shares` (string, required): Amount of tranche shares to burn in raw units
|
|
210
210
|
- `receiver` (string, required): Address that receives the underlying asset
|
|
211
211
|
- `owner` (string, required): Address that owns the tranche shares being burned
|
|
212
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
212
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
213
213
|
|
|
214
214
|
### write.account.create
|
|
215
215
|
|
|
@@ -220,7 +220,7 @@ Parameters:
|
|
|
220
220
|
- `wallet_address` (string, required): Wallet address that will send the transaction
|
|
221
221
|
- `account_version` (number, default: 0): 0 = latest (V4 spot), 3 = margin (can borrow)
|
|
222
222
|
- `creditor` (string, optional): Lending pool address for V3 margin account
|
|
223
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
223
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
224
224
|
|
|
225
225
|
### write.account.deposit
|
|
226
226
|
|
|
@@ -233,7 +233,7 @@ Parameters:
|
|
|
233
233
|
- `asset_ids` (number[], optional): Token IDs: 0 for ERC20, NFT token ID for ERC721
|
|
234
234
|
- `asset_types` (number[], optional): V4 only. 1=ERC20, 2=ERC721, 3=ERC1155
|
|
235
235
|
- `account_version` (number, optional): Override account version (auto-detected if omitted)
|
|
236
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
236
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
237
237
|
|
|
238
238
|
### write.account.withdraw
|
|
239
239
|
|
|
@@ -246,7 +246,7 @@ Parameters:
|
|
|
246
246
|
- `asset_ids` (number[], optional): Token IDs: 0 for ERC20, NFT token ID for ERC721
|
|
247
247
|
- `asset_types` (number[], optional): V4 only. 1=ERC20, 2=ERC721, 3=ERC1155
|
|
248
248
|
- `account_version` (number, optional): Override account version (auto-detected if omitted)
|
|
249
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
249
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
250
250
|
|
|
251
251
|
### write.account.borrow
|
|
252
252
|
|
|
@@ -257,7 +257,7 @@ Parameters:
|
|
|
257
257
|
- `account_address` (string, required): Arcadia account address used as collateral
|
|
258
258
|
- `amount` (string, required): Amount in raw units
|
|
259
259
|
- `to` (string, required): Address to receive borrowed tokens
|
|
260
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
260
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
261
261
|
|
|
262
262
|
### write.account.repay
|
|
263
263
|
|
|
@@ -267,7 +267,7 @@ Parameters:
|
|
|
267
267
|
- `pool_address` (string, required): Lending pool address
|
|
268
268
|
- `account_address` (string, required): Arcadia account address with debt
|
|
269
269
|
- `amount` (string, required): Amount in raw units, or "max_uint256" to repay all
|
|
270
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
270
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
271
271
|
|
|
272
272
|
### write.account.add_liquidity
|
|
273
273
|
|
|
@@ -287,7 +287,7 @@ Parameters:
|
|
|
287
287
|
- `use_account_assets` (boolean, default: false): Use all existing account collateral
|
|
288
288
|
- `leverage` (number, default: 0): 0 = no borrow, 2 = 2x leverage
|
|
289
289
|
- `slippage` (number, default: 100): Basis points, 100 = 1%
|
|
290
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
290
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
291
291
|
|
|
292
292
|
### write.account.remove_liquidity
|
|
293
293
|
|
|
@@ -298,7 +298,7 @@ Parameters:
|
|
|
298
298
|
- `asset_address` (string, required): Position manager contract
|
|
299
299
|
- `asset_id` (number, required): NFT token ID
|
|
300
300
|
- `adjustment` (string, required): Liquidity amount to remove (raw uint128)
|
|
301
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
301
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
302
302
|
|
|
303
303
|
### write.account.swap
|
|
304
304
|
|
|
@@ -310,7 +310,7 @@ Parameters:
|
|
|
310
310
|
- `asset_to` (string, required): Token address to swap to
|
|
311
311
|
- `amount_in` (string, required): Raw units
|
|
312
312
|
- `slippage` (number, default: 100): Basis points, 100 = 1%
|
|
313
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
313
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
314
314
|
|
|
315
315
|
### write.account.deleverage
|
|
316
316
|
|
|
@@ -323,7 +323,7 @@ Parameters:
|
|
|
323
323
|
- `numeraire` (string, required): Debt token address
|
|
324
324
|
- `creditor` (string, required): Lending pool address
|
|
325
325
|
- `slippage` (number, default: 100): Basis points, 100 = 1%
|
|
326
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
326
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
327
327
|
|
|
328
328
|
### write.account.stake
|
|
329
329
|
|
|
@@ -334,7 +334,7 @@ Parameters:
|
|
|
334
334
|
- `action` (enum, required): stake | unstake | claim
|
|
335
335
|
- `asset_address` (string, required): Position manager contract address
|
|
336
336
|
- `asset_id` (number, required): NFT token ID
|
|
337
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
337
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
338
338
|
|
|
339
339
|
### write.account.close
|
|
340
340
|
|
|
@@ -353,7 +353,7 @@ Parameters:
|
|
|
353
353
|
- `distribution` (number, optional): Fraction of proceeds (0-1)
|
|
354
354
|
- `close_lp_only` (boolean, default: false): true = only burn LP, false = full close
|
|
355
355
|
- `slippage` (number, default: 100): Basis points, 100 = 1%
|
|
356
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
356
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
357
357
|
|
|
358
358
|
### write.account.automations
|
|
359
359
|
|
|
@@ -378,7 +378,7 @@ Parameters:
|
|
|
378
378
|
- `token0` / `token1` (string, optional): Pool token addresses
|
|
379
379
|
- `reward_tokens` (string[], optional): Staking reward token addresses
|
|
380
380
|
- `owner` (string, optional): Account owner EOA, used to resolve wallet payout targets
|
|
381
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
381
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
382
382
|
|
|
383
383
|
### write.account.automations_delta
|
|
384
384
|
|
|
@@ -400,7 +400,7 @@ Parameters:
|
|
|
400
400
|
- `to` (string, required): Target contract address
|
|
401
401
|
- `data` (string, required): Encoded calldata (hex)
|
|
402
402
|
- `value` (string, default: "0"): Value in wei
|
|
403
|
-
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain),
|
|
403
|
+
- `chain_id` (number, default: 8453): Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
|
|
404
404
|
|
|
405
405
|
## Links
|
|
406
406
|
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Arcadia Finance MCP Server
|
|
2
2
|
|
|
3
|
-
> MCP server for Arcadia Finance, a DeFi protocol for concentrated liquidity (Uniswap v3/v4, Aerodrome/Slipstream, Velodrome) with automated rebalancing, compounding, yield optimization, and leverage, or single-sided liquidity into lending pools. Supported chains: Base (8453), Unichain (130), Optimism (10).
|
|
3
|
+
> MCP server for Arcadia Finance, a DeFi protocol for concentrated liquidity (Uniswap v3/v4, Aerodrome/Slipstream, Velodrome) with automated rebalancing, compounding, yield optimization, and leverage, or single-sided liquidity into lending pools. Supported chains: Base (8453), Unichain (130), Optimism (10), Robinhood (4663).
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
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.5.
|
|
4
|
+
"version": "0.5.2",
|
|
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.5.
|
|
6
|
+
"version": "0.5.2",
|
|
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.5.
|
|
16
|
+
"version": "0.5.2",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|
|
@@ -36,6 +36,12 @@
|
|
|
36
36
|
"isRequired": false,
|
|
37
37
|
"isSecret": true
|
|
38
38
|
},
|
|
39
|
+
{
|
|
40
|
+
"name": "RPC_URL_ROBINHOOD",
|
|
41
|
+
"description": "RPC URL for Robinhood (4663). Falls back to public RPC if not set.",
|
|
42
|
+
"isRequired": false,
|
|
43
|
+
"isSecret": true
|
|
44
|
+
},
|
|
39
45
|
{
|
|
40
46
|
"name": "PK",
|
|
41
47
|
"description": "Private key for dev-only signing (not for production).",
|
|
@@ -22,7 +22,7 @@ Arcadia is a platform for managing concentrated liquidity positions with automat
|
|
|
22
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
|
-
2. **Broadcast** it to the appropriate chain (Base 8453, Unichain 130, or
|
|
25
|
+
2. **Broadcast** it to the appropriate chain (Base 8453, Unichain 130, Optimism 10, or Robinhood 4663)
|
|
26
26
|
3. **Wait** for the transaction receipt to confirm success
|
|
27
27
|
|
|
28
28
|
How you sign depends on your setup:
|
|
@@ -68,37 +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 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.
|
|
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
73
|
| `read.guides` | Reference guides: `automation` (AM setup), `selection` (pool evaluation), `strategies` (step-by-step templates). |
|
|
74
74
|
|
|
75
75
|
### Preferred Write Tools (atomic/multi-step — use these first)
|
|
76
76
|
|
|
77
77
|
These tools batch multiple operations into ONE atomic transaction. Always prefer these over individual tools.
|
|
78
78
|
|
|
79
|
-
| Tool
|
|
80
|
-
|
|
|
81
|
-
| `write.account.add_liquidity`
|
|
82
|
-
| `write.account.close`
|
|
83
|
-
| `write.account.deleverage`
|
|
84
|
-
| `write.account.automations`
|
|
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. |
|
|
85
85
|
|
|
86
86
|
### Individual Write Tools (use when batched tools fail or for standalone operations)
|
|
87
87
|
|
|
88
|
-
| Tool
|
|
89
|
-
|
|
|
90
|
-
| `write.wallet.approve`
|
|
91
|
-
| `write.account.create`
|
|
92
|
-
| `write.account.deposit`
|
|
93
|
-
| `write.account.withdraw`
|
|
94
|
-
| `write.account.borrow`
|
|
95
|
-
| `write.account.repay`
|
|
96
|
-
| `write.account.swap`
|
|
97
|
-
| `write.account.remove_liquidity`
|
|
98
|
-
| `write.account.stake`
|
|
99
|
-
| `write.pool.deposit`
|
|
100
|
-
| `write.pool.redeem`
|
|
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.
|
|
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. |
|
|
102
102
|
|
|
103
103
|
### Dev Tools (only available when `PK` env var is set)
|
|
104
104
|
|
|
@@ -17,13 +17,13 @@ Pass the LP position's `position_id` and the backend fetches the protocol, stake
|
|
|
17
17
|
|
|
18
18
|
## The five intents
|
|
19
19
|
|
|
20
|
-
| Intent | What it does
|
|
21
|
-
| --------------- |
|
|
22
|
-
| `compound_fees` | Reinvest earned fees and rewards back into the LP
|
|
23
|
-
| `claim_rewards` | Claim yield out, as-earned or converted to one token via CowSwap
|
|
24
|
-
| `add_to_lp` | Fold idle pool-token balances (deposits, rebalance leftovers) back into the LP
|
|
25
|
-
| `rebalance` | Reposition the LP: out-of-range, take-profit, or POL strategy
|
|
26
|
-
| `claim_merkl` | Auto-claim Merkl incentive rewards
|
|
20
|
+
| Intent | What it does | Needs position context |
|
|
21
|
+
| --------------- | ------------------------------------------------------------------------------ | ---------------------- |
|
|
22
|
+
| `compound_fees` | Reinvest earned fees and rewards back into the LP | yes |
|
|
23
|
+
| `claim_rewards` | Claim yield out, as-earned or converted to one token via CowSwap | yes |
|
|
24
|
+
| `add_to_lp` | Fold idle pool-token balances (deposits, rebalance leftovers) back into the LP | yes |
|
|
25
|
+
| `rebalance` | Reposition the LP: out-of-range, take-profit, or POL strategy | yes |
|
|
26
|
+
| `claim_merkl` | Auto-claim Merkl incentive rewards | no |
|
|
27
27
|
|
|
28
28
|
Every intent takes `enabled` (default true) and an optional `position_id`.
|
|
29
29
|
|
|
@@ -61,7 +61,7 @@ write.account.automations(
|
|
|
61
61
|
|
|
62
62
|
`compound_fees`, `claim_rewards` and `add_to_lp` accept a `tokens` array (`token0`, `token1`, and `reward` for the yielding intents) so different tokens can be routed differently. Omitting `tokens` means all yielding tokens for the compound/claim intents.
|
|
63
63
|
|
|
64
|
-
`reward` only exists on a staked position whose reward token is not one of the pool tokens. When the reward token
|
|
64
|
+
`reward` only exists on a staked position whose reward token is not one of the pool tokens. When the reward token _is_ a pool token it collapses into that token.
|
|
65
65
|
|
|
66
66
|
**Every yielding token must be assigned to exactly one of `compound_fees` or `claim_rewards`.** Scoping one intent to a subset without covering the rest is rejected, and no token may appear in both. So `compound_fees` with `tokens: ["token0"]` on its own is invalid: token1's yield would be unassigned.
|
|
67
67
|
|
|
@@ -86,22 +86,22 @@ Note also that `add_to_lp` is opt-in per token: folding an idle balance happens
|
|
|
86
86
|
|
|
87
87
|
The backend enforces compatibility rules rather than letting an invalid combination reach the chain. When one fires the tool returns an error with the rule name and reason, and no transaction. The full set:
|
|
88
88
|
|
|
89
|
-
| Rule
|
|
90
|
-
|
|
|
91
|
-
| `duplicate_intent_kind`
|
|
92
|
-
| `token_double_assigned`
|
|
93
|
-
| `incomplete_partition`
|
|
94
|
-
| `empty_token_scope`
|
|
95
|
-
| `tokens_out_of_scope`
|
|
96
|
-
| `claim_to_wallet_requires_pure_claim`
|
|
97
|
-
| `convert_tokens_out_of_scope`
|
|
98
|
-
| `convert_settles_in_account`
|
|
99
|
-
| `claim_convert_missing_buy_token`
|
|
100
|
-
| `convert_target_is_compounded`
|
|
101
|
-
| `convert_target_in_convert_set`
|
|
102
|
-
| `convert_target_is_folded`
|
|
103
|
-
| `compound_reward_buy_token_not_pool_token` | The compound CowSwap leg must buy one of the position's underlyings.
|
|
104
|
-
| `multiple_convert_targets`
|
|
89
|
+
| Rule | Meaning |
|
|
90
|
+
| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
91
|
+
| `duplicate_intent_kind` | Each intent kind may appear only once. Two rebalance strategies is ambiguous. |
|
|
92
|
+
| `token_double_assigned` | A token cannot be both compounded and claimed. |
|
|
93
|
+
| `incomplete_partition` | Every yielding token must be assigned to compound or claim. |
|
|
94
|
+
| `empty_token_scope` | A `tokens` list must not be explicitly empty. Omit it to mean "all". |
|
|
95
|
+
| `tokens_out_of_scope` | Named a token this position does not yield (e.g. `reward` on an unstaked position, or a reward that is itself a pool token). |
|
|
96
|
+
| `claim_to_wallet_requires_pure_claim` | A wallet/custom-recipient payout requires claiming every yielding token as-earned, nothing converted. |
|
|
97
|
+
| `convert_tokens_out_of_scope` | `convert_tokens` must be a subset of the claimed tokens. |
|
|
98
|
+
| `convert_settles_in_account` | Converted rewards must settle in the account. |
|
|
99
|
+
| `claim_convert_missing_buy_token` | Converting requires a `buy_token`. |
|
|
100
|
+
| `convert_target_is_compounded` | `buy_token` cannot be a token you also compound. |
|
|
101
|
+
| `convert_target_in_convert_set` | `buy_token` cannot be one of the tokens being converted. |
|
|
102
|
+
| `convert_target_is_folded` | `buy_token` cannot also be folded by `add_to_lp`, or the converted rewards get re-added immediately. |
|
|
103
|
+
| `compound_reward_buy_token_not_pool_token` | The compound CowSwap leg must buy one of the position's underlyings. |
|
|
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
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
|
|
|
@@ -119,11 +119,11 @@ Read `errors[].reason`, adjust the intents, retry. `read.asset_manager.intents`
|
|
|
119
119
|
|
|
120
120
|
Three success-path cases return no `transaction`, and an agent must not treat any of them as "nothing to do but broadcast anyway":
|
|
121
121
|
|
|
122
|
-
| Field
|
|
123
|
-
|
|
|
124
|
-
| `preview_only: true`
|
|
125
|
-
| `no_changes_needed: true`
|
|
126
|
-
| (error) `tenderly_sim_status: "failure"` | The call would revert. Fix the cause, do not broadcast.
|
|
122
|
+
| Field | Meaning |
|
|
123
|
+
| ---------------------------------------- | --------------------------------------------------------- |
|
|
124
|
+
| `preview_only: true` | Preview mode. Re-run with `save`. |
|
|
125
|
+
| `no_changes_needed: true` | The account already matches the request. Nothing to send. |
|
|
126
|
+
| (error) `tenderly_sim_status: "failure"` | The call would revert. Fix the cause, do not broadcast. |
|
|
127
127
|
|
|
128
128
|
## Superseded managers
|
|
129
129
|
|
|
@@ -143,13 +143,13 @@ Asset managers are redeployed over time. An account registered on an older deplo
|
|
|
143
143
|
|
|
144
144
|
**Key `out_of_range` params:**
|
|
145
145
|
|
|
146
|
-
| Param | Default | Description
|
|
147
|
-
| -------------------------- | -------- |
|
|
148
|
-
| `optimal_token0_ratio` | `500000` | Target token0 composition (1e6-scaled: 500000 = 50%)
|
|
146
|
+
| Param | Default | Description |
|
|
147
|
+
| -------------------------- | -------- | -------------------------------------------------------------------------------- |
|
|
148
|
+
| `optimal_token0_ratio` | `500000` | Target token0 composition (1e6-scaled: 500000 = 50%) |
|
|
149
149
|
| `trigger_lower_tick_ratio` | `0` | Offset from tick_lower as a fraction of tick range (1e6-scaled, 0 = at boundary) |
|
|
150
|
-
| `trigger_upper_tick_ratio` | `0` | Offset from tick_upper, same scaling. Asymmetric values are valid
|
|
151
|
-
| `min_rebalance_time` | `3600` | Cooldown in seconds
|
|
152
|
-
| `max_rebalance_time` | `1e12` | Max time before a forced rebalance (effectively disabled)
|
|
150
|
+
| `trigger_upper_tick_ratio` | `0` | Offset from tick_upper, same scaling. Asymmetric values are valid |
|
|
151
|
+
| `min_rebalance_time` | `3600` | Cooldown in seconds |
|
|
152
|
+
| `max_rebalance_time` | `1e12` | Max time before a forced rebalance (effectively disabled) |
|
|
153
153
|
|
|
154
154
|
Trigger ratios are **tick distance, not price**: a ratio of 50000 shifts the trigger by 5% of `(tick_upper - tick_lower)` ticks. Positive values delay the rebalance until price travels further beyond the range; negative values fire preemptively while price is still in range.
|
|
155
155
|
|
|
@@ -179,7 +179,7 @@ Quota is bypassed when: gas cost < pending fees / 2, or position value >= $50k.
|
|
|
179
179
|
|
|
180
180
|
**When to add on top of a rebalance:** The rebalance compounds at rebalance time. Adding `compound_fees` also compounds between rebalances, which means more frequent compounding and higher effective APY.
|
|
181
181
|
|
|
182
|
-
**Staked positions:** a staked position earns staking emissions (for example AERO), not LP fees. When the reward token is not one of the pool tokens, the backend routes it through the CowSwapper automatically: the reward is swapped to a pool token via a CoW Protocol batch auction (MEV-protected) and folded into the LP. You do not enable a CowSwapper yourself and you do not pick the sell/buy tokens. When the reward token
|
|
182
|
+
**Staked positions:** a staked position earns staking emissions (for example AERO), not LP fees. When the reward token is not one of the pool tokens, the backend routes it through the CowSwapper automatically: the reward is swapped to a pool token via a CoW Protocol batch auction (MEV-protected) and folded into the LP. You do not enable a CowSwapper yourself and you do not pick the sell/buy tokens. When the reward token _is_ a pool token no swap is needed and none is configured.
|
|
183
183
|
|
|
184
184
|
---
|
|
185
185
|
|
|
@@ -189,13 +189,13 @@ Quota is bypassed when: gas cost < pending fees / 2, or position value >= $50k.
|
|
|
189
189
|
|
|
190
190
|
**Config:**
|
|
191
191
|
|
|
192
|
-
| Field | Default
|
|
193
|
-
| ---------------- |
|
|
194
|
-
| `mode` | `as_earned`
|
|
195
|
-
| `destination` | `account`
|
|
196
|
-
| `buy_token` | none
|
|
197
|
-
| `recipient` | none
|
|
198
|
-
| `tokens` | all yielding
|
|
192
|
+
| Field | Default | Description |
|
|
193
|
+
| ---------------- | -------------- | ---------------------------------------------------------------------- |
|
|
194
|
+
| `mode` | `as_earned` | `as_earned` pays the tokens as-is, `convert_to` swaps them via CowSwap |
|
|
195
|
+
| `destination` | `account` | `account` or `wallet` (the owner EOA) |
|
|
196
|
+
| `buy_token` | none | ERC20 to swap into. Required whenever anything is being converted |
|
|
197
|
+
| `recipient` | none | Explicit payout address, overrides `destination` |
|
|
198
|
+
| `tokens` | all yielding | Which tokens' yield to claim out |
|
|
199
199
|
| `convert_tokens` | defers to mode | Subset of `tokens` to swap; the rest are claimed as-earned |
|
|
200
200
|
|
|
201
201
|
CowSwap settles inside the account, so a converted claim cannot pay out to a wallet. `convert_tokens` is what enables a partial convert: swap the reward to USDC while claiming token0 and token1 as-earned.
|
|
@@ -143,14 +143,14 @@ Target collateral ratio ≥ 1.5 at entry (≈ health factor ~0.5+). Never open b
|
|
|
143
143
|
|
|
144
144
|
## 4. Combining Automation
|
|
145
145
|
|
|
146
|
-
| Combination
|
|
147
|
-
|
|
|
148
|
-
| `rebalance` + `compound_fees`
|
|
149
|
-
| `rebalance` + `claim_rewards`
|
|
150
|
-
| `rebalance` + `claim_merkl`
|
|
151
|
-
| `compound_fees` + `claim_merkl`
|
|
152
|
-
| `compound_fees` + `claim_rewards`
|
|
153
|
-
| `add_to_lp` + anything
|
|
146
|
+
| Combination | Compatible | Notes |
|
|
147
|
+
| --------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------- |
|
|
148
|
+
| `rebalance` + `compound_fees` | ✅ Yes | Rebalance compounds at rebalance time; compound_fees adds compounding between rebalances. |
|
|
149
|
+
| `rebalance` + `claim_rewards` | ✅ Yes | Claims yield between rebalances. Order is handled by the keeper's claim-before guard. |
|
|
150
|
+
| `rebalance` + `claim_merkl` | ✅ Yes | Always combine when the pool has Merkl incentives. Zero conflict. |
|
|
151
|
+
| `compound_fees` + `claim_merkl` | ✅ Yes | Merkl rewards are claimed separately from trading fees. |
|
|
152
|
+
| `compound_fees` + `claim_rewards` | ⚠️ Per token | Valid only as a partition: each yielding token must go to exactly one of the two, and every yielding token must be covered. |
|
|
153
|
+
| `add_to_lp` + anything | ✅ Yes | Independent fold. Only constraint: a folded token cannot be a convert `buy_token`. |
|
|
154
154
|
|
|
155
155
|
---
|
|
156
156
|
|
package/skills/openclaw/SKILL.md
CHANGED
|
@@ -13,7 +13,7 @@ metadata:
|
|
|
13
13
|
|
|
14
14
|
> **Agent note:** `{baseDir}` refers to the directory containing this SKILL.md file. Resolve all `{baseDir}` paths relative to it.
|
|
15
15
|
|
|
16
|
-
Arcadia helps users deploy concentrated liquidity positions on Uniswap, Aerodrome, and Velodrome with automated rebalancing, compounding, yield optimization, and optional leverage, or provide single-sided liquidity to lending pools to earn borrower interest. Supported chains: Base (8453), Unichain (130), Optimism (10).
|
|
16
|
+
Arcadia helps users deploy concentrated liquidity positions on Uniswap, Aerodrome, and Velodrome with automated rebalancing, compounding, yield optimization, and optional leverage, or provide single-sided liquidity to lending pools to earn borrower interest. Supported chains: Base (8453), Unichain (130), Optimism (10), Robinhood (4663).
|
|
17
17
|
|
|
18
18
|
## CLI Usage
|
|
19
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Arcadia Contract Addresses
|
|
2
2
|
|
|
3
|
-
Supported chains: Base (8453), Unichain (130), Optimism (10).
|
|
3
|
+
Supported chains: Base (8453), Unichain (130), Optimism (10), Robinhood (4663).
|
|
4
4
|
|
|
5
5
|
## Shared Addresses
|
|
6
6
|
|
|
@@ -10,13 +10,14 @@ Supported chains: Base (8453), Unichain (130), Optimism (10).
|
|
|
10
10
|
| Registry | 0xd0690557600eb8Be8391D1d97346e2aab5300d5f |
|
|
11
11
|
| Liquidator | 0xA4B0b9fD1d91fA2De44F6ABFd59cC14bA1E1a7Af |
|
|
12
12
|
|
|
13
|
-
Lending pools (same CREATE2 addresses
|
|
13
|
+
Lending pools (same CREATE2 addresses across chains; Unichain has none):
|
|
14
14
|
|
|
15
|
-
| Pool | Address | Chains
|
|
16
|
-
| -------- | ------------------------------------------ |
|
|
17
|
-
| LP_WETH | 0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2 | Base, Optimism |
|
|
18
|
-
| LP_USDC | 0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1 | Base, Optimism
|
|
19
|
-
| LP_CBBTC | 0xa37E9b4369dc20940009030BfbC2088F09645e3B | Base only
|
|
15
|
+
| Pool | Address | Chains |
|
|
16
|
+
| -------- | ------------------------------------------ | ------------------------- |
|
|
17
|
+
| LP_WETH | 0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2 | Base, Optimism, Robinhood |
|
|
18
|
+
| LP_USDC | 0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1 | Base, Optimism |
|
|
19
|
+
| LP_CBBTC | 0xa37E9b4369dc20940009030BfbC2088F09645e3B | Base only |
|
|
20
|
+
| LP_USDG | 0xf37c0C5996503Fdd2b5CCCE36E659cD30393AE59 | Robinhood only |
|
|
20
21
|
|
|
21
22
|
## Asset Managers
|
|
22
23
|
|
|
@@ -27,6 +28,7 @@ Protocol availability per chain:
|
|
|
27
28
|
- **Base**: Slipstream V1, V2, V3, Uniswap V3, V4, CoW Swap
|
|
28
29
|
- **Optimism**: Slipstream V1, V3, Uniswap V3, V4 (no V2, no CoW Swap). V3 uses different AM addresses than Base (exception to the deterministic deployment pattern).
|
|
29
30
|
- **Unichain**: Slipstream V1, Uniswap V3, V4 (no V2/V3, no CoW Swap)
|
|
31
|
+
- **Robinhood**: Uniswap V3, V4 only (no Slipstream or Aerodrome deployment, no CoW Swap). Lending pools are WETH and USDG — there is no USDC on this chain.
|
|
30
32
|
|
|
31
33
|
Use `read.asset_manager.intents` to discover available automations and their addresses per chain.
|
|
32
34
|
|