@arcadia-finance/mcp-server 0.4.1 → 0.4.3
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/dist/tools/output-schemas.js +6 -4
- package/dist/tools/read/pools.js +1 -1
- package/dist/tools/read/strategy.js +6 -3
- package/dist/tools/write/account/add-liquidity.js +2 -2
- package/dist/tools/write/account/close.js +2 -2
- package/dist/tools/write/account/deleverage.js +2 -2
- package/dist/tools/write/account/format-response.js +14 -6
- package/dist/tools/write/account/remove-liquidity.js +2 -2
- package/dist/tools/write/account/stake.js +3 -3
- package/dist/tools/write/account/swap.js +2 -2
- package/package.json +1 -1
- package/server.json +2 -2
- package/skills/openclaw/SKILL.md +1 -1
|
@@ -14,7 +14,7 @@ export const BatchedTransactionOutput = z.object({
|
|
|
14
14
|
description: z.string().optional(),
|
|
15
15
|
transaction: Transaction,
|
|
16
16
|
tenderly_sim_url: z.string().optional(),
|
|
17
|
-
tenderly_sim_status: z.enum(["
|
|
17
|
+
tenderly_sim_status: z.enum(["success", "failure", "unavailable"]).optional(),
|
|
18
18
|
expected_value_change: z.string().optional(),
|
|
19
19
|
before: z
|
|
20
20
|
.object({ total_account_value: z.string(), used_margin: z.string() })
|
|
@@ -97,12 +97,13 @@ export const AssetPricesOutput = z.object({
|
|
|
97
97
|
});
|
|
98
98
|
export const PoolListOutput = z.object({
|
|
99
99
|
pools: z.array(z.record(z.unknown())),
|
|
100
|
+
context_notes: z.array(z.string()).optional(),
|
|
100
101
|
});
|
|
101
102
|
export const PoolDetailOutput = z.object({
|
|
102
103
|
pool: z.record(z.unknown()),
|
|
103
104
|
apy_history: z.array(z.record(z.unknown())),
|
|
104
105
|
});
|
|
105
|
-
export const PointsWalletOutput = z.
|
|
106
|
+
export const PointsWalletOutput = z.object({}).passthrough();
|
|
106
107
|
export const PointsLeaderboardOutput = z.object({
|
|
107
108
|
total: z.number(),
|
|
108
109
|
offset: z.number(),
|
|
@@ -114,9 +115,10 @@ export const StrategyListOutput = z.object({
|
|
|
114
115
|
offset: z.number(),
|
|
115
116
|
limit: z.number(),
|
|
116
117
|
strategies: z.array(z.record(z.unknown())),
|
|
118
|
+
context_notes: z.array(z.string()).optional(),
|
|
117
119
|
});
|
|
118
|
-
export const StrategyDetailOutput = z.
|
|
119
|
-
export const StrategyRecommendationOutput = z.
|
|
120
|
+
export const StrategyDetailOutput = z.object({}).passthrough();
|
|
121
|
+
export const StrategyRecommendationOutput = z.object({}).passthrough();
|
|
120
122
|
export const GuideOutput = z.object({
|
|
121
123
|
topic: z.string(),
|
|
122
124
|
content: z.string(),
|
package/dist/tools/read/pools.js
CHANGED
|
@@ -21,7 +21,7 @@ export function registerPoolTools(server, api) {
|
|
|
21
21
|
if (Array.isArray(result) && result.length === 0) {
|
|
22
22
|
const empty = {
|
|
23
23
|
pools: [],
|
|
24
|
-
|
|
24
|
+
context_notes: [`No lending pools found on chain ${chain_id}.`],
|
|
25
25
|
};
|
|
26
26
|
return {
|
|
27
27
|
content: [{ type: "text", text: JSON.stringify(empty, null, 2) }],
|
|
@@ -49,7 +49,9 @@ export function registerStrategyTools(server, api) {
|
|
|
49
49
|
strategies,
|
|
50
50
|
};
|
|
51
51
|
if (total === 0 && all.length > 0) {
|
|
52
|
-
result.
|
|
52
|
+
result.context_notes = [
|
|
53
|
+
`Featured strategies are not curated for chain ${chain_id} yet. Backend returned ${all.length} Base strategies; filtered out. Use featured_only=false to list all strategies on this chain.`,
|
|
54
|
+
];
|
|
53
55
|
}
|
|
54
56
|
return {
|
|
55
57
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
@@ -161,8 +163,9 @@ export function registerStrategyTools(server, api) {
|
|
|
161
163
|
rec.removed_assets.length === 0 &&
|
|
162
164
|
Number(rec.current_apy ?? 0) === 0 &&
|
|
163
165
|
Number(rec.proposed_apy ?? 0) === 0) {
|
|
164
|
-
rec.
|
|
165
|
-
"Account has no active positions — no rebalancing recommendations available."
|
|
166
|
+
rec.context_notes = [
|
|
167
|
+
"Account has no active positions — no rebalancing recommendations available.",
|
|
168
|
+
];
|
|
166
169
|
}
|
|
167
170
|
return {
|
|
168
171
|
content: [{ type: "text", text: JSON.stringify(rec, null, 2) }],
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
|
|
3
3
|
import { getPublicClient } from "../../../clients/chain.js";
|
|
4
4
|
import { readAccountMetadata } from "./metadata.js";
|
|
5
|
-
import { formatBatchedResponse } from "./format-response.js";
|
|
5
|
+
import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
|
|
6
6
|
import { TOKENS } from "../../../config/addresses.js";
|
|
7
7
|
import { validateAddress, validateChainId } from "../../../utils/validation.js";
|
|
8
8
|
import { BatchedTransactionOutput } from "../../output-schemas.js";
|
|
@@ -299,7 +299,7 @@ export function registerAddLiquidityTool(server, api, chains) {
|
|
|
299
299
|
const result = await api.getBundleCalldata(body);
|
|
300
300
|
const res = result;
|
|
301
301
|
// Surface simulation failure — do NOT return calldata
|
|
302
|
-
if (res.tenderly_sim_status
|
|
302
|
+
if (isSimulationFailed(res.tenderly_sim_status)) {
|
|
303
303
|
const simUrl = res.tenderly_sim_url
|
|
304
304
|
? `\nTenderly simulation: ${res.tenderly_sim_url}`
|
|
305
305
|
: "";
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
|
|
3
3
|
import { getPublicClient } from "../../../clients/chain.js";
|
|
4
4
|
import { readAccountMetadata } from "./metadata.js";
|
|
5
|
-
import { formatBatchedResponse } from "./format-response.js";
|
|
5
|
+
import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
|
|
6
6
|
import { validateAddress, validateChainId } from "../../../utils/validation.js";
|
|
7
7
|
import { BatchedTransactionOutput } from "../../output-schemas.js";
|
|
8
8
|
export function registerCloseTool(server, api, chains) {
|
|
@@ -179,7 +179,7 @@ The returned calldata is time-sensitive — sign and broadcast within 30 seconds
|
|
|
179
179
|
};
|
|
180
180
|
const result = await api.getBundleCalldata(body);
|
|
181
181
|
const res = result;
|
|
182
|
-
if (res.tenderly_sim_status
|
|
182
|
+
if (isSimulationFailed(res.tenderly_sim_status)) {
|
|
183
183
|
const simUrl = res.tenderly_sim_url
|
|
184
184
|
? `\nTenderly simulation: ${res.tenderly_sim_url}`
|
|
185
185
|
: "";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
|
|
3
|
-
import { formatBatchedResponse } from "./format-response.js";
|
|
3
|
+
import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
|
|
4
4
|
import { validateAddress } from "../../../utils/validation.js";
|
|
5
5
|
import { BatchedTransactionOutput } from "../../output-schemas.js";
|
|
6
6
|
export function registerDeleverageTool(server, api) {
|
|
@@ -39,7 +39,7 @@ export function registerDeleverageTool(server, api) {
|
|
|
39
39
|
slippage: slippage ?? 100,
|
|
40
40
|
});
|
|
41
41
|
const res = result;
|
|
42
|
-
if (res.tenderly_sim_status
|
|
42
|
+
if (isSimulationFailed(res.tenderly_sim_status)) {
|
|
43
43
|
const simUrl = res.tenderly_sim_url
|
|
44
44
|
? `\nTenderly simulation: ${res.tenderly_sim_url}`
|
|
45
45
|
: "";
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { appendDataSuffix } from "../../../utils/attribution.js";
|
|
2
|
+
// Backend emits `tenderly_sim_status` as a JSON boolean (Python bool). We normalize
|
|
3
|
+
// to a 3-state string enum for clearer tool output. Historically the TS types
|
|
4
|
+
// claimed `string`, so legacy "true"/"false" strings are also tolerated here.
|
|
5
|
+
export function isSimulationFailed(status) {
|
|
6
|
+
return status === false || status === "false";
|
|
7
|
+
}
|
|
8
|
+
function normalizeSimStatus(status) {
|
|
9
|
+
if (status === true || status === "true")
|
|
10
|
+
return "success";
|
|
11
|
+
if (status === false || status === "false")
|
|
12
|
+
return "failure";
|
|
13
|
+
return "unavailable";
|
|
14
|
+
}
|
|
2
15
|
export function formatBatchedResponse(result, chainId, description) {
|
|
3
16
|
const to = (result.fx_call_to ?? "");
|
|
4
17
|
const data = appendDataSuffix((result.calldata ?? ""));
|
|
@@ -9,12 +22,7 @@ export function formatBatchedResponse(result, chainId, description) {
|
|
|
9
22
|
if (result.tenderly_sim_url != null) {
|
|
10
23
|
response.tenderly_sim_url = result.tenderly_sim_url;
|
|
11
24
|
}
|
|
12
|
-
|
|
13
|
-
response.tenderly_sim_status = result.tenderly_sim_status;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
response.tenderly_sim_status = "unavailable";
|
|
17
|
-
}
|
|
25
|
+
response.tenderly_sim_status = normalizeSimStatus(result.tenderly_sim_status);
|
|
18
26
|
if (result.expected_value_change != null) {
|
|
19
27
|
response.expected_value_change = String(result.expected_value_change);
|
|
20
28
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
|
|
3
|
-
import { formatBatchedResponse } from "./format-response.js";
|
|
3
|
+
import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
|
|
4
4
|
import { validateAddress } from "../../../utils/validation.js";
|
|
5
5
|
import { BatchedTransactionOutput } from "../../output-schemas.js";
|
|
6
6
|
export function registerRemoveLiquidityTool(server, api) {
|
|
@@ -39,7 +39,7 @@ The returned calldata is time-sensitive — sign and broadcast within 30 seconds
|
|
|
39
39
|
adjustment,
|
|
40
40
|
});
|
|
41
41
|
const res = result;
|
|
42
|
-
if (res.tenderly_sim_status
|
|
42
|
+
if (isSimulationFailed(res.tenderly_sim_status)) {
|
|
43
43
|
const simUrl = res.tenderly_sim_url
|
|
44
44
|
? `\nTenderly simulation: ${res.tenderly_sim_url}`
|
|
45
45
|
: "";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
|
|
3
|
-
import { formatBatchedResponse } from "./format-response.js";
|
|
3
|
+
import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
|
|
4
4
|
import { validateAddress } from "../../../utils/validation.js";
|
|
5
5
|
import { BatchedTransactionOutput } from "../../output-schemas.js";
|
|
6
6
|
export function registerStakeTool(server, api) {
|
|
@@ -33,7 +33,7 @@ export function registerStakeTool(server, api) {
|
|
|
33
33
|
asset_id,
|
|
34
34
|
});
|
|
35
35
|
const claimRes = result;
|
|
36
|
-
if (claimRes.tenderly_sim_status
|
|
36
|
+
if (isSimulationFailed(claimRes.tenderly_sim_status)) {
|
|
37
37
|
const simUrl = claimRes.tenderly_sim_url
|
|
38
38
|
? `\nTenderly simulation: ${claimRes.tenderly_sim_url}`
|
|
39
39
|
: "";
|
|
@@ -68,7 +68,7 @@ export function registerStakeTool(server, api) {
|
|
|
68
68
|
asset_id,
|
|
69
69
|
});
|
|
70
70
|
const res = result;
|
|
71
|
-
if (res.tenderly_sim_status
|
|
71
|
+
if (isSimulationFailed(res.tenderly_sim_status)) {
|
|
72
72
|
const simUrl = res.tenderly_sim_url
|
|
73
73
|
? `\nTenderly simulation: ${res.tenderly_sim_url}`
|
|
74
74
|
: "";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
|
|
3
|
-
import { formatBatchedResponse } from "./format-response.js";
|
|
3
|
+
import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
|
|
4
4
|
import { validateAddress } from "../../../utils/validation.js";
|
|
5
5
|
import { BatchedTransactionOutput } from "../../output-schemas.js";
|
|
6
6
|
export function registerSwapTool(server, api) {
|
|
@@ -36,7 +36,7 @@ export function registerSwapTool(server, api) {
|
|
|
36
36
|
slippage: slippage ?? 100,
|
|
37
37
|
});
|
|
38
38
|
const res = result;
|
|
39
|
-
if (res.tenderly_sim_status
|
|
39
|
+
if (isSimulationFailed(res.tenderly_sim_status)) {
|
|
40
40
|
const simUrl = res.tenderly_sim_url
|
|
41
41
|
? `\nTenderly simulation: ${res.tenderly_sim_url}`
|
|
42
42
|
: "";
|
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.4.
|
|
4
|
+
"version": "0.4.3",
|
|
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",
|
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.4.
|
|
6
|
+
"version": "0.4.3",
|
|
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.4.
|
|
16
|
+
"version": "0.4.3",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|
package/skills/openclaw/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: arcadia-finance
|
|
3
|
-
version: 1.1.
|
|
3
|
+
version: 1.1.1
|
|
4
4
|
description: "DeFi liquidity management on Uniswap and Aerodrome, live on Base, Unichain, and Optimism. Deploy concentrated liquidity positions with automated rebalancing, compounding, yield optimization, and leverage, or provide single-sided liquidity to lending pools."
|
|
5
5
|
metadata:
|
|
6
6
|
openclaw:
|