@arcadia-finance/mcp-server 0.3.4 → 0.3.5
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 +2 -1
- package/dist/config/addresses.js +55 -3
- package/dist/config/chains.js +10 -2
- package/dist/tools/dev/send.js +4 -2
- package/dist/tools/read/account.js +5 -4
- package/dist/tools/read/asset-managers.js +9 -2
- package/dist/tools/read/assets.js +3 -2
- package/dist/tools/read/pools.js +3 -2
- package/dist/tools/read/strategy.js +27 -5
- package/dist/tools/read/wallet.js +4 -3
- package/dist/tools/write/account/add-liquidity.js +2 -1
- package/dist/tools/write/account/borrow.js +2 -1
- package/dist/tools/write/account/close.js +2 -1
- package/dist/tools/write/account/create.js +2 -1
- package/dist/tools/write/account/deleverage.js +2 -1
- package/dist/tools/write/account/deposit.js +2 -1
- package/dist/tools/write/account/remove-liquidity.js +2 -1
- package/dist/tools/write/account/repay.js +2 -1
- package/dist/tools/write/account/stake.js +2 -1
- package/dist/tools/write/account/swap.js +2 -1
- package/dist/tools/write/account/withdraw.js +2 -1
- package/dist/tools/write/asset-managers/compounder.js +6 -4
- package/dist/tools/write/asset-managers/merkl-operator.js +2 -1
- package/dist/tools/write/asset-managers/rebalancer.js +2 -1
- package/dist/tools/write/asset-managers/set-asset-managers.js +2 -1
- package/dist/tools/write/asset-managers/shared.js +4 -0
- package/dist/tools/write/asset-managers/yield-claimer.js +6 -4
- package/dist/tools/write/wallet/approve.js +2 -1
- package/dist/utils/validation.js +2 -2
- package/llms-full.txt +34 -34
- package/llms.txt +1 -1
- package/package.json +2 -2
- package/server.json +9 -3
- package/skills/clamm-liquidity/SKILL.md +30 -3
- package/skills/openclaw/SKILL.md +30 -22
- package/skills/openclaw/arcadia.sh +101 -0
- package/skills/openclaw/contracts.md +20 -2
- package/skills/openclaw/arcadia.mjs +0 -49
package/skills/openclaw/SKILL.md
CHANGED
|
@@ -4,68 +4,76 @@ description: "DeFi liquidity management on Uniswap and Aerodrome, live on Base a
|
|
|
4
4
|
metadata:
|
|
5
5
|
openclaw:
|
|
6
6
|
homepage: https://arcadia.finance
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
package: "@modelcontextprotocol/sdk"
|
|
10
|
-
bins: []
|
|
7
|
+
requires:
|
|
8
|
+
bins: [curl, jq]
|
|
11
9
|
---
|
|
12
10
|
|
|
13
11
|
# Arcadia Finance
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
> **Agent note:** `{baseDir}` refers to the directory containing this SKILL.md file. Resolve all `{baseDir}` paths relative to it.
|
|
14
|
+
|
|
15
|
+
Arcadia helps users deploy and manage concentrated liquidity positions on Uniswap, Aerodrome, and Velodrome with automated rebalancing, compounding, yield optimization, and optional leverage. Supported chains: Base (8453), Unichain (130), Optimism (10).
|
|
16
16
|
|
|
17
17
|
## CLI Usage
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
# Discover all available tools (run this first)
|
|
21
|
+
{baseDir}/arcadia.sh --list
|
|
22
|
+
|
|
23
|
+
# Call a specific tool
|
|
24
|
+
{baseDir}/arcadia.sh <tool_name> '<json_args>'
|
|
22
25
|
```
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
Requires: `curl`, `jq`. No other dependencies.
|
|
25
28
|
|
|
26
29
|
## Read Operations
|
|
27
30
|
|
|
28
31
|
```bash
|
|
29
32
|
# List all accounts for a wallet
|
|
30
|
-
|
|
33
|
+
{baseDir}/arcadia.sh read_wallet_accounts '{"wallet_address":"0x..."}'
|
|
31
34
|
|
|
32
35
|
# Account details (health factor, collateral, debt, positions)
|
|
33
|
-
|
|
36
|
+
{baseDir}/arcadia.sh read_account_info '{"account_address":"0x..."}'
|
|
34
37
|
|
|
35
38
|
# Featured LP strategies with APY
|
|
36
|
-
|
|
39
|
+
{baseDir}/arcadia.sh read_strategy_list '{"featured_only":true}'
|
|
37
40
|
|
|
38
41
|
# Lending pools (TVL, APY, utilization)
|
|
39
|
-
|
|
42
|
+
{baseDir}/arcadia.sh read_pool_list '{}'
|
|
40
43
|
|
|
41
44
|
# Workflow guides (automation setup, strategy selection)
|
|
42
|
-
|
|
45
|
+
{baseDir}/arcadia.sh read_guides '{"topic":"overview"}'
|
|
43
46
|
|
|
44
47
|
# Available automations (rebalancer, compounder, yield claimer)
|
|
45
|
-
|
|
48
|
+
{baseDir}/arcadia.sh read_asset_manager_intents '{}'
|
|
46
49
|
```
|
|
47
50
|
|
|
48
51
|
## Write Operations
|
|
49
52
|
|
|
50
|
-
All write tools return unsigned transactions `{ to, data, value, chainId }`. See `wallet-signing.md` for
|
|
53
|
+
All write tools return unsigned transactions `{ to, data, value, chainId }`. Sign with your wallet before broadcasting. See `{baseDir}/wallet-signing.md` for wallet options.
|
|
51
54
|
|
|
52
55
|
```bash
|
|
53
56
|
# Open LP position (deposits + swaps + mints LP atomically)
|
|
54
|
-
|
|
57
|
+
{baseDir}/arcadia.sh write_account_add_liquidity '{"account_address":"0x...","wallet_address":"0x...","positions":[{"strategy_id":123}],"deposits":[{"asset":"0x...","amount":"1000000","decimals":6}]}'
|
|
55
58
|
|
|
56
59
|
# Close position (burn LP + swap + repay in one tx)
|
|
57
|
-
|
|
60
|
+
{baseDir}/arcadia.sh write_account_close '{"account_address":"0x...","assets":[...],"receive_assets":[...]}'
|
|
61
|
+
|
|
62
|
+
# Create a new account (salt must be unique per wallet)
|
|
63
|
+
{baseDir}/arcadia.sh write_account_create '{"wallet_address":"0x...","salt":1,"chain_id":8453}'
|
|
58
64
|
|
|
59
65
|
# Enable automation
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
{baseDir}/arcadia.sh write_asset_manager_rebalancer '{"dex_protocol":"slipstream"}'
|
|
67
|
+
{baseDir}/arcadia.sh write_account_set_asset_managers '{"account_address":"0x...","asset_managers":[...],"statuses":[...],"datas":[...]}'
|
|
62
68
|
```
|
|
63
69
|
|
|
64
70
|
## Configuration
|
|
65
71
|
|
|
66
72
|
The CLI connects to `https://mcp.arcadia.finance/mcp` by default. Set `ARCADIA_MCP_URL` to override (e.g. for local development).
|
|
67
73
|
|
|
68
|
-
## Safety
|
|
74
|
+
## Data and Safety
|
|
75
|
+
|
|
76
|
+
This skill connects to Arcadia's public API at `https://mcp.arcadia.finance/mcp` (override via `ARCADIA_MCP_URL`). Tool calls send public wallet addresses, account addresses, and transaction parameters to this server. This is the same data that is publicly visible on-chain. No private keys or signing capabilities are transmitted.
|
|
69
77
|
|
|
70
78
|
- Write tools return unsigned transactions only. Never auto-sign.
|
|
71
79
|
- Always confirm transaction details with the user before signing.
|
|
@@ -75,7 +83,7 @@ The CLI connects to `https://mcp.arcadia.finance/mcp` by default. Set `ARCADIA_M
|
|
|
75
83
|
## References
|
|
76
84
|
|
|
77
85
|
- Full tool documentation: https://mcp.arcadia.finance/llms-full.txt
|
|
78
|
-
- Contract addresses: see `contracts.md`
|
|
79
|
-
- Signing guide: see `wallet-signing.md`
|
|
86
|
+
- Contract addresses: see `{baseDir}/contracts.md`
|
|
87
|
+
- Signing guide: see `{baseDir}/wallet-signing.md`
|
|
80
88
|
- Website: https://arcadia.finance
|
|
81
89
|
- Docs: https://docs.arcadia.finance
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CLI wrapper for Arcadia Finance MCP server.
|
|
3
|
+
# Uses curl + jq to call tools over Streamable HTTP.
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# ./arcadia.sh <tool_name> '<json_args>'
|
|
7
|
+
# ./arcadia.sh --list
|
|
8
|
+
#
|
|
9
|
+
# Requires: curl, jq
|
|
10
|
+
|
|
11
|
+
set -euo pipefail
|
|
12
|
+
|
|
13
|
+
MCP_URL="${ARCADIA_MCP_URL:-https://mcp.arcadia.finance/mcp}"
|
|
14
|
+
|
|
15
|
+
for bin in curl jq; do
|
|
16
|
+
if ! command -v "$bin" >/dev/null 2>&1; then
|
|
17
|
+
echo "Required: $bin" >&2
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
done
|
|
21
|
+
|
|
22
|
+
TOOL_NAME="${1:-}"
|
|
23
|
+
ARGS_JSON="${2:-"{}"}"
|
|
24
|
+
|
|
25
|
+
if [[ -z "$TOOL_NAME" ]]; then
|
|
26
|
+
echo "Usage: $0 <tool_name> '<json_args>'"
|
|
27
|
+
echo " $0 --list"
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
HEADERS_FILE=$(mktemp)
|
|
32
|
+
trap 'rm -f "$HEADERS_FILE"' EXIT
|
|
33
|
+
|
|
34
|
+
# Parse SSE response: extract the data: line and parse as JSON
|
|
35
|
+
parse_sse() {
|
|
36
|
+
grep '^data: ' | head -1 | sed 's/^data: //'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# Initialize session
|
|
40
|
+
INIT_RESPONSE=$(curl -s -X POST "$MCP_URL" \
|
|
41
|
+
-H "Content-Type: application/json" \
|
|
42
|
+
-H "Accept: application/json, text/event-stream" \
|
|
43
|
+
-D "$HEADERS_FILE" \
|
|
44
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"arcadia-openclaw","version":"1.0.0"}}}' 2>/dev/null) || true
|
|
45
|
+
|
|
46
|
+
SESSION_ID=$(grep -i 'mcp-session-id' "$HEADERS_FILE" 2>/dev/null | awk '{print $2}' | tr -d '\r') || true
|
|
47
|
+
|
|
48
|
+
if [[ -z "$SESSION_ID" ]]; then
|
|
49
|
+
echo "Failed to connect to $MCP_URL" >&2
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
# Send initialized notification
|
|
54
|
+
curl -sf -X POST "$MCP_URL" \
|
|
55
|
+
-H "Content-Type: application/json" \
|
|
56
|
+
-H "Accept: application/json, text/event-stream" \
|
|
57
|
+
-H "Mcp-Session-Id: $SESSION_ID" \
|
|
58
|
+
-d '{"jsonrpc":"2.0","method":"notifications/initialized"}' \
|
|
59
|
+
-o /dev/null 2>/dev/null || true
|
|
60
|
+
|
|
61
|
+
if [[ "$TOOL_NAME" == "--list" ]]; then
|
|
62
|
+
RESPONSE=$(curl -sf -X POST "$MCP_URL" \
|
|
63
|
+
-H "Content-Type: application/json" \
|
|
64
|
+
-H "Accept: application/json, text/event-stream" \
|
|
65
|
+
-H "Mcp-Session-Id: $SESSION_ID" \
|
|
66
|
+
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}')
|
|
67
|
+
|
|
68
|
+
echo "$RESPONSE" | parse_sse | jq -r '.result.tools | sort_by(.name)[] | "\(.name): \(.description[0:120])"'
|
|
69
|
+
else
|
|
70
|
+
if ! echo "$ARGS_JSON" | jq . >/dev/null 2>&1; then
|
|
71
|
+
echo "ERROR: Invalid JSON arguments: $ARGS_JSON" >&2
|
|
72
|
+
exit 1
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
PAYLOAD=$(jq -nc --arg name "$TOOL_NAME" --argjson args "$ARGS_JSON" \
|
|
76
|
+
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":$name,"arguments":$args}}')
|
|
77
|
+
|
|
78
|
+
RESPONSE=$(curl -sf -X POST "$MCP_URL" \
|
|
79
|
+
-H "Content-Type: application/json" \
|
|
80
|
+
-H "Accept: application/json, text/event-stream" \
|
|
81
|
+
-H "Mcp-Session-Id: $SESSION_ID" \
|
|
82
|
+
-d "$PAYLOAD")
|
|
83
|
+
|
|
84
|
+
RESULT=$(echo "$RESPONSE" | parse_sse)
|
|
85
|
+
IS_ERROR=$(echo "$RESULT" | jq -r '.result.isError // false')
|
|
86
|
+
TEXT=$(echo "$RESULT" | jq -r '.result.content[0].text // empty')
|
|
87
|
+
|
|
88
|
+
if [[ "$IS_ERROR" == "true" ]]; then
|
|
89
|
+
if echo "$TEXT" | grep -qi "internal exception\|500\|internal server error"; then
|
|
90
|
+
echo "ERROR: Request failed. Check that IDs and addresses are valid. Details: $TEXT" >&2
|
|
91
|
+
else
|
|
92
|
+
echo "ERROR: $TEXT" >&2
|
|
93
|
+
fi
|
|
94
|
+
exit 1
|
|
95
|
+
else
|
|
96
|
+
echo "$TEXT"
|
|
97
|
+
fi
|
|
98
|
+
fi
|
|
99
|
+
|
|
100
|
+
# Cleanup session
|
|
101
|
+
curl -sf -X DELETE "$MCP_URL" -H "Mcp-Session-Id: $SESSION_ID" -o /dev/null 2>/dev/null || true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Arcadia Contract Addresses
|
|
2
2
|
|
|
3
|
-
Supported chains: Base (8453), Unichain (130).
|
|
3
|
+
Supported chains: Base (8453), Unichain (130), Optimism (10).
|
|
4
4
|
|
|
5
5
|
## Protocol (same on all chains)
|
|
6
6
|
|
|
@@ -18,6 +18,13 @@ Supported chains: Base (8453), Unichain (130).
|
|
|
18
18
|
| LP_USDC | 0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1 |
|
|
19
19
|
| LP_CBBTC | 0xa37E9b4369dc20940009030BfbC2088F09645e3B |
|
|
20
20
|
|
|
21
|
+
## Lending Pools (Optimism)
|
|
22
|
+
|
|
23
|
+
| Pool | Address |
|
|
24
|
+
| ------- | ------------------------------------------ |
|
|
25
|
+
| LP_WETH | 0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2 |
|
|
26
|
+
| LP_USDC | 0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1 |
|
|
27
|
+
|
|
21
28
|
## Key Tokens (Base)
|
|
22
29
|
|
|
23
30
|
| Token | Address | Decimals |
|
|
@@ -27,6 +34,17 @@ Supported chains: Base (8453), Unichain (130).
|
|
|
27
34
|
| cbBTC | 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf | 8 |
|
|
28
35
|
| AERO | 0x940181a94A35A4569E4529A3CDfB74e38FD98631 | 18 |
|
|
29
36
|
|
|
37
|
+
## Key Tokens (Optimism)
|
|
38
|
+
|
|
39
|
+
| Token | Address | Decimals |
|
|
40
|
+
| ------ | ------------------------------------------ | -------- |
|
|
41
|
+
| WETH | 0x4200000000000000000000000000000000000006 | 18 |
|
|
42
|
+
| USDC | 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85 | 6 |
|
|
43
|
+
| OP | 0x4200000000000000000000000000000000000042 | 18 |
|
|
44
|
+
| VELO | 0x9560e827aF36c94D2Ac33a39bCE1Fe78631088Db | 18 |
|
|
45
|
+
| WBTC | 0x68f180fcCe6836688e9084f035309E29Bf0A2095 | 8 |
|
|
46
|
+
| wstETH | 0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb | 18 |
|
|
47
|
+
|
|
30
48
|
## Asset Managers
|
|
31
49
|
|
|
32
|
-
Rebalancers, compounders, and yield claimers are deployed per DEX protocol. Use `read_asset_manager_intents` to discover available automations and their addresses.
|
|
50
|
+
Rebalancers, compounders, and yield claimers are deployed per DEX protocol. Slipstream V3 is Base-only. Optimism supports Slipstream V1 (Velodrome), Uniswap V3, and Uniswap V4. No CoW Swap on Optimism. Use `read_asset_manager_intents` to discover available automations and their addresses per chain.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* CLI wrapper for Arcadia Finance MCP server.
|
|
5
|
-
* Connects to the remote endpoint and calls tools by name.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* node arcadia.mjs <tool_name> '<json_args>'
|
|
9
|
-
* node arcadia.mjs --list
|
|
10
|
-
*
|
|
11
|
-
* Requires: npm install @modelcontextprotocol/sdk
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
15
|
-
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
16
|
-
|
|
17
|
-
const ENDPOINT = process.env.ARCADIA_MCP_URL || "https://mcp.arcadia.finance/mcp";
|
|
18
|
-
const [toolName, argsJson] = process.argv.slice(2);
|
|
19
|
-
|
|
20
|
-
if (!toolName) {
|
|
21
|
-
console.error("Usage: node arcadia.mjs <tool_name> '<json_args>'");
|
|
22
|
-
console.error(" node arcadia.mjs --list");
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const client = new Client({ name: "arcadia-openclaw", version: "1.0.0" });
|
|
27
|
-
const transport = new StreamableHTTPClientTransport(new URL(ENDPOINT));
|
|
28
|
-
await client.connect(transport);
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
if (toolName === "--list") {
|
|
32
|
-
const { tools } = await client.listTools();
|
|
33
|
-
for (const t of tools.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
34
|
-
console.log(`${t.name}: ${t.description?.substring(0, 120)}`);
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
const args = argsJson ? JSON.parse(argsJson) : {};
|
|
38
|
-
const result = await client.callTool({ name: toolName, arguments: args });
|
|
39
|
-
const text = result.content?.[0]?.text ?? "";
|
|
40
|
-
if (result.isError) {
|
|
41
|
-
console.error(`ERROR: ${text}`);
|
|
42
|
-
process.exitCode = 1;
|
|
43
|
-
} else {
|
|
44
|
-
console.log(text);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
} finally {
|
|
48
|
-
await client.close();
|
|
49
|
-
}
|