@arcadia-finance/mcp-server 0.4.5 → 0.5.0

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.
Files changed (34) hide show
  1. package/README.md +5 -10
  2. package/dist/clients/api.js +23 -0
  3. package/dist/config/addresses.js +49 -188
  4. package/dist/index.js +4 -2
  5. package/dist/prompts/workflows.js +15 -13
  6. package/dist/resources/guides.js +1 -1
  7. package/dist/tools/dev/send.js +7 -5
  8. package/dist/tools/index.js +4 -14
  9. package/dist/tools/output-schemas.js +42 -6
  10. package/dist/tools/read/account.js +80 -42
  11. package/dist/tools/read/asset-managers.js +138 -113
  12. package/dist/tools/read/guides.js +3 -3
  13. package/dist/tools/write/asset-managers/automations.js +241 -0
  14. package/dist/tools/write/asset-managers/intents.js +247 -0
  15. package/dist/tools/write/asset-managers/shared.js +0 -26
  16. package/dist/utils/http-config.js +37 -0
  17. package/dist/utils/validation.js +16 -0
  18. package/llms-full.txt +39 -80
  19. package/llms.txt +9 -14
  20. package/package.json +1 -1
  21. package/server.json +2 -2
  22. package/skills/clamm-liquidity/SKILL.md +90 -69
  23. package/skills/clamm-liquidity/automation.md +153 -76
  24. package/skills/clamm-liquidity/selection.md +6 -5
  25. package/skills/clamm-liquidity/strategies.md +40 -34
  26. package/skills/openclaw/SKILL.md +3 -3
  27. package/skills/openclaw/contracts.md +29 -16
  28. package/dist/tools/write/asset-managers/compounder.js +0 -113
  29. package/dist/tools/write/asset-managers/cow-swapper.js +0 -50
  30. package/dist/tools/write/asset-managers/encoding.js +0 -162
  31. package/dist/tools/write/asset-managers/merkl-operator.js +0 -52
  32. package/dist/tools/write/asset-managers/rebalancer.js +0 -109
  33. package/dist/tools/write/asset-managers/set-asset-managers.js +0 -76
  34. package/dist/tools/write/asset-managers/yield-claimer.js +0 -117
@@ -1,117 +0,0 @@
1
- import { z } from "zod";
2
- import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
3
- import { getAmProtocolAddress, getStandaloneAmAddress } from "../../../config/addresses.js";
4
- import { validateAddress, validateChainId } from "../../../utils/validation.js";
5
- import { CLAIMER_INITIATOR, COWSWAPPER_INITIATOR, encodeYieldClaimerCallbackData, encodeYieldClaimerCoupledCallbackData, encodeCowSwapTokenMetadata, disabledIntent, } from "./encoding.js";
6
- import { IntentOutput } from "../../output-schemas.js";
7
- import { DEX_PROTOCOL_SCHEMA, dexProtocolToAmKey, formatResult } from "./shared.js";
8
- export function registerYieldClaimerTools(server, _chains) {
9
- server.registerTool("write.asset_manager.yield_claimer", {
10
- annotations: {
11
- title: "Encode Yield Claimer Automation",
12
- readOnlyHint: true,
13
- destructiveHint: false,
14
- idempotentHint: true,
15
- openWorldHint: false,
16
- },
17
- description: "Encode args for the standalone yield claimer automation. Periodically claims pending fees/emissions and sends them to a designated recipient (wallet, another account, or any address). Returns { asset_managers, statuses, datas } — pass to write.account.set_asset_managers. Combinable with other intent tools.",
18
- outputSchema: IntentOutput,
19
- inputSchema: {
20
- dex_protocol: DEX_PROTOCOL_SCHEMA,
21
- fee_recipient: z
22
- .string()
23
- .describe("Address to receive claimed fees (wallet address or any destination)"),
24
- enabled: z.boolean().default(true).describe("True to enable, false to disable"),
25
- chain_id: z.number().default(8453).describe(CHAIN_ID_DESCRIPTION),
26
- },
27
- }, async (params) => {
28
- try {
29
- const validChainId = validateChainId(params.chain_id);
30
- const amKey = dexProtocolToAmKey(params.dex_protocol);
31
- const amAddress = getAmProtocolAddress(validChainId, "yieldClaimers", amKey);
32
- if (!params.enabled)
33
- return formatResult(disabledIntent([amAddress], `Disable yield_claimer (${params.dex_protocol})`));
34
- const validFeeRecipient = validateAddress(params.fee_recipient, "fee_recipient");
35
- const callbackData = encodeYieldClaimerCallbackData(CLAIMER_INITIATOR, validFeeRecipient);
36
- const result = {
37
- description: `Enable yield_claimer (${params.dex_protocol})`,
38
- asset_managers: [amAddress],
39
- statuses: [true],
40
- datas: [callbackData],
41
- };
42
- return formatResult(result);
43
- }
44
- catch (err) {
45
- return {
46
- content: [
47
- {
48
- type: "text",
49
- text: `Error: ${err instanceof Error ? err.message : String(err)}`,
50
- },
51
- ],
52
- isError: true,
53
- };
54
- }
55
- });
56
- server.registerTool("write.asset_manager.yield_claimer_cowswap", {
57
- annotations: {
58
- title: "Encode Yield Claimer + CowSwap Automation",
59
- readOnlyHint: true,
60
- destructiveHint: false,
61
- idempotentHint: true,
62
- openWorldHint: false,
63
- },
64
- description: "Encode args for yield claimer coupled with CowSwap. Claims LP fees, then swaps the claimed tokens to a target token via CowSwap batch auctions (MEV-protected). For staked LPs, sell_tokens is the staking reward token list (e.g. [AERO_address]). For non-staked LPs, sell_tokens is all LP fee tokens except the buy_token — e.g. for a WETH/USDC LP claiming fees as USDC, use sell_tokens: [WETH_address], buy_token: USDC_address. Sets metadata on BOTH the CowSwapper and the Yield Claimer. Returns { asset_managers, statuses, datas } with 2 entries (cowswapper + yield_claimer). Base only. Combinable with other intent tools.",
65
- outputSchema: IntentOutput,
66
- inputSchema: {
67
- dex_protocol: DEX_PROTOCOL_SCHEMA,
68
- sell_tokens: z
69
- .array(z.string())
70
- .describe("Token addresses to sell. Staked LP: [AERO]. Non-staked: [token0, token1] minus buy_token."),
71
- buy_token: z.string().describe("Token address to receive after swap"),
72
- fee_recipient: z.string().describe("Address to receive claimed fees"),
73
- enabled: z.boolean().default(true).describe("True to enable, false to disable"),
74
- chain_id: z.number().default(8453).describe(CHAIN_ID_DESCRIPTION),
75
- },
76
- }, async (params) => {
77
- try {
78
- const validChainId = validateChainId(params.chain_id);
79
- const amKey = dexProtocolToAmKey(params.dex_protocol);
80
- let cowSwapperAddress;
81
- try {
82
- cowSwapperAddress = getStandaloneAmAddress(validChainId, "cowSwapper");
83
- }
84
- catch (err) {
85
- const reason = err instanceof Error ? err.message : String(err);
86
- throw new Error(`yield_claimer_cowswap requires cow_swapper. ${reason}`);
87
- }
88
- const yieldClaimerAddress = getAmProtocolAddress(validChainId, "yieldClaimers", amKey);
89
- if (!params.enabled) {
90
- return formatResult(disabledIntent([cowSwapperAddress, yieldClaimerAddress], `Disable yield_claimer_cowswap (${params.dex_protocol})`));
91
- }
92
- const validSellTokens = params.sell_tokens.map((t, i) => validateAddress(t, `sell_tokens[${i}]`));
93
- const validBuyToken = validateAddress(params.buy_token, "buy_token");
94
- const validFeeRecipient = validateAddress(params.fee_recipient, "fee_recipient");
95
- const cowSwapperData = encodeCowSwapTokenMetadata("cow_swap_yield_claim", validSellTokens, validBuyToken);
96
- const yieldClaimerData = encodeYieldClaimerCoupledCallbackData(COWSWAPPER_INITIATOR, validFeeRecipient, "cow_swap_yield_claim");
97
- const result = {
98
- description: `Enable yield_claimer_cowswap (${params.dex_protocol}, cowswap)`,
99
- asset_managers: [cowSwapperAddress, yieldClaimerAddress],
100
- statuses: [true, true],
101
- datas: [cowSwapperData, yieldClaimerData],
102
- };
103
- return formatResult(result);
104
- }
105
- catch (err) {
106
- return {
107
- content: [
108
- {
109
- type: "text",
110
- text: `Error: ${err instanceof Error ? err.message : String(err)}`,
111
- },
112
- ],
113
- isError: true,
114
- };
115
- }
116
- });
117
- }