@arcadia-finance/mcp-server 0.1.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 (59) hide show
  1. package/LICENSE.md +97 -0
  2. package/README.md +186 -0
  3. package/dist/abis/account.json +1012 -0
  4. package/dist/abis/account_v4.json +1027 -0
  5. package/dist/abis/chainlink.json +509 -0
  6. package/dist/abis/erc20.json +299 -0
  7. package/dist/abis/factory.json +938 -0
  8. package/dist/abis/gauge_helper.json +84 -0
  9. package/dist/abis/index.js +26 -0
  10. package/dist/abis/mainreg.json +1172 -0
  11. package/dist/abis/nftmanager.json +1221 -0
  12. package/dist/abis/nftmanager_v4.json +1297 -0
  13. package/dist/abis/pool.json +2136 -0
  14. package/dist/abis/slipstream_nftmanager.json +1312 -0
  15. package/dist/abis/staked_aero_am.json +1220 -0
  16. package/dist/abis/staked_slipstream_am.json +1131 -0
  17. package/dist/abis/state_viewer.json +365 -0
  18. package/dist/abis/tranche.json +1004 -0
  19. package/dist/abis/wrapped_aero_am.json +1232 -0
  20. package/dist/abis/wrapped_staked_slipstream_am.json +338 -0
  21. package/dist/clients/api.js +189 -0
  22. package/dist/clients/chain.js +30 -0
  23. package/dist/config/addresses.js +94 -0
  24. package/dist/config/chains.js +31 -0
  25. package/dist/index.js +29 -0
  26. package/dist/skills/clamm-liquidity/SKILL.md +167 -0
  27. package/dist/skills/clamm-liquidity/automation.md +138 -0
  28. package/dist/skills/clamm-liquidity/selection.md +183 -0
  29. package/dist/skills/clamm-liquidity/strategies.md +337 -0
  30. package/dist/tools/advanced/account-metadata.js +46 -0
  31. package/dist/tools/advanced/add-liquidity.js +310 -0
  32. package/dist/tools/advanced/close-position.js +208 -0
  33. package/dist/tools/advanced/format-response.js +26 -0
  34. package/dist/tools/advanced/position-actions.js +95 -0
  35. package/dist/tools/advanced/remove-liquidity.js +68 -0
  36. package/dist/tools/advanced/repay-with-collateral.js +66 -0
  37. package/dist/tools/advanced/swap.js +64 -0
  38. package/dist/tools/index.js +52 -0
  39. package/dist/tools/read/accounts.js +243 -0
  40. package/dist/tools/read/allowances.js +86 -0
  41. package/dist/tools/read/assets.js +54 -0
  42. package/dist/tools/read/balances.js +93 -0
  43. package/dist/tools/read/guides.js +59 -0
  44. package/dist/tools/read/points.js +25 -0
  45. package/dist/tools/read/pools.js +48 -0
  46. package/dist/tools/read/protocol.js +94 -0
  47. package/dist/tools/write/approve.js +99 -0
  48. package/dist/tools/write/borrow.js +87 -0
  49. package/dist/tools/write/configure-asset-manager.js +258 -0
  50. package/dist/tools/write/create-account.js +112 -0
  51. package/dist/tools/write/deposit.js +104 -0
  52. package/dist/tools/write/repay.js +56 -0
  53. package/dist/tools/write/set-asset-manager.js +65 -0
  54. package/dist/tools/write/sign-and-send.js +90 -0
  55. package/dist/tools/write/withdraw.js +114 -0
  56. package/dist/types/api.js +5 -0
  57. package/dist/utils/attribution.js +20 -0
  58. package/dist/utils/validation.js +17 -0
  59. package/package.json +67 -0
@@ -0,0 +1,338 @@
1
+ [
2
+ { "type": "constructor", "inputs": [], "stateMutability": "nonpayable" },
3
+ {
4
+ "type": "function",
5
+ "name": "AERO",
6
+ "inputs": [],
7
+ "outputs": [{ "name": "", "type": "address", "internalType": "contract ERC20" }],
8
+ "stateMutability": "view"
9
+ },
10
+ {
11
+ "type": "function",
12
+ "name": "CL_FACTORY",
13
+ "inputs": [],
14
+ "outputs": [{ "name": "", "type": "address", "internalType": "address" }],
15
+ "stateMutability": "view"
16
+ },
17
+ {
18
+ "type": "function",
19
+ "name": "POSITION_MANAGER",
20
+ "inputs": [],
21
+ "outputs": [
22
+ {
23
+ "name": "",
24
+ "type": "address",
25
+ "internalType": "contract ICLPositionManager"
26
+ }
27
+ ],
28
+ "stateMutability": "view"
29
+ },
30
+ {
31
+ "type": "function",
32
+ "name": "approve",
33
+ "inputs": [
34
+ { "name": "spender", "type": "address", "internalType": "address" },
35
+ { "name": "id", "type": "uint256", "internalType": "uint256" }
36
+ ],
37
+ "outputs": [],
38
+ "stateMutability": "nonpayable"
39
+ },
40
+ {
41
+ "type": "function",
42
+ "name": "balanceOf",
43
+ "inputs": [{ "name": "owner", "type": "address", "internalType": "address" }],
44
+ "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
45
+ "stateMutability": "view"
46
+ },
47
+ {
48
+ "type": "function",
49
+ "name": "baseURI",
50
+ "inputs": [],
51
+ "outputs": [{ "name": "", "type": "string", "internalType": "string" }],
52
+ "stateMutability": "view"
53
+ },
54
+ {
55
+ "type": "function",
56
+ "name": "burn",
57
+ "inputs": [{ "name": "positionId", "type": "uint256", "internalType": "uint256" }],
58
+ "outputs": [{ "name": "rewards", "type": "uint256", "internalType": "uint256" }],
59
+ "stateMutability": "nonpayable"
60
+ },
61
+ {
62
+ "type": "function",
63
+ "name": "claimReward",
64
+ "inputs": [{ "name": "positionId", "type": "uint256", "internalType": "uint256" }],
65
+ "outputs": [{ "name": "rewards", "type": "uint256", "internalType": "uint256" }],
66
+ "stateMutability": "nonpayable"
67
+ },
68
+ {
69
+ "type": "function",
70
+ "name": "getApproved",
71
+ "inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }],
72
+ "outputs": [{ "name": "", "type": "address", "internalType": "address" }],
73
+ "stateMutability": "view"
74
+ },
75
+ {
76
+ "type": "function",
77
+ "name": "idToGauge",
78
+ "inputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }],
79
+ "outputs": [{ "name": "gauge", "type": "address", "internalType": "address" }],
80
+ "stateMutability": "view"
81
+ },
82
+ {
83
+ "type": "function",
84
+ "name": "isApprovedForAll",
85
+ "inputs": [
86
+ { "name": "", "type": "address", "internalType": "address" },
87
+ { "name": "", "type": "address", "internalType": "address" }
88
+ ],
89
+ "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
90
+ "stateMutability": "view"
91
+ },
92
+ {
93
+ "type": "function",
94
+ "name": "mint",
95
+ "inputs": [{ "name": "positionId", "type": "uint256", "internalType": "uint256" }],
96
+ "outputs": [{ "name": "positionId_", "type": "uint256", "internalType": "uint256" }],
97
+ "stateMutability": "nonpayable"
98
+ },
99
+ {
100
+ "type": "function",
101
+ "name": "name",
102
+ "inputs": [],
103
+ "outputs": [{ "name": "", "type": "string", "internalType": "string" }],
104
+ "stateMutability": "view"
105
+ },
106
+ {
107
+ "type": "function",
108
+ "name": "onERC721Received",
109
+ "inputs": [
110
+ { "name": "", "type": "address", "internalType": "address" },
111
+ { "name": "", "type": "address", "internalType": "address" },
112
+ { "name": "", "type": "uint256", "internalType": "uint256" },
113
+ { "name": "", "type": "bytes", "internalType": "bytes" }
114
+ ],
115
+ "outputs": [{ "name": "", "type": "bytes4", "internalType": "bytes4" }],
116
+ "stateMutability": "pure"
117
+ },
118
+ {
119
+ "type": "function",
120
+ "name": "owner",
121
+ "inputs": [],
122
+ "outputs": [{ "name": "", "type": "address", "internalType": "address" }],
123
+ "stateMutability": "view"
124
+ },
125
+ {
126
+ "type": "function",
127
+ "name": "ownerOf",
128
+ "inputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }],
129
+ "outputs": [{ "name": "owner", "type": "address", "internalType": "address" }],
130
+ "stateMutability": "view"
131
+ },
132
+ {
133
+ "type": "function",
134
+ "name": "rewardOf",
135
+ "inputs": [{ "name": "positionId", "type": "uint256", "internalType": "uint256" }],
136
+ "outputs": [{ "name": "rewards", "type": "uint256", "internalType": "uint256" }],
137
+ "stateMutability": "view"
138
+ },
139
+ {
140
+ "type": "function",
141
+ "name": "safeTransferFrom",
142
+ "inputs": [
143
+ { "name": "from", "type": "address", "internalType": "address" },
144
+ { "name": "to", "type": "address", "internalType": "address" },
145
+ { "name": "id", "type": "uint256", "internalType": "uint256" }
146
+ ],
147
+ "outputs": [],
148
+ "stateMutability": "nonpayable"
149
+ },
150
+ {
151
+ "type": "function",
152
+ "name": "safeTransferFrom",
153
+ "inputs": [
154
+ { "name": "from", "type": "address", "internalType": "address" },
155
+ { "name": "to", "type": "address", "internalType": "address" },
156
+ { "name": "id", "type": "uint256", "internalType": "uint256" },
157
+ { "name": "data", "type": "bytes", "internalType": "bytes" }
158
+ ],
159
+ "outputs": [],
160
+ "stateMutability": "nonpayable"
161
+ },
162
+ {
163
+ "type": "function",
164
+ "name": "setApprovalForAll",
165
+ "inputs": [
166
+ { "name": "operator", "type": "address", "internalType": "address" },
167
+ { "name": "approved", "type": "bool", "internalType": "bool" }
168
+ ],
169
+ "outputs": [],
170
+ "stateMutability": "nonpayable"
171
+ },
172
+ {
173
+ "type": "function",
174
+ "name": "setBaseURI",
175
+ "inputs": [{ "name": "newBaseURI", "type": "string", "internalType": "string" }],
176
+ "outputs": [],
177
+ "stateMutability": "nonpayable"
178
+ },
179
+ {
180
+ "type": "function",
181
+ "name": "supportsInterface",
182
+ "inputs": [{ "name": "interfaceId", "type": "bytes4", "internalType": "bytes4" }],
183
+ "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
184
+ "stateMutability": "view"
185
+ },
186
+ {
187
+ "type": "function",
188
+ "name": "symbol",
189
+ "inputs": [],
190
+ "outputs": [{ "name": "", "type": "string", "internalType": "string" }],
191
+ "stateMutability": "view"
192
+ },
193
+ {
194
+ "type": "function",
195
+ "name": "tokenURI",
196
+ "inputs": [{ "name": "tokenId", "type": "uint256", "internalType": "uint256" }],
197
+ "outputs": [{ "name": "uri", "type": "string", "internalType": "string" }],
198
+ "stateMutability": "view"
199
+ },
200
+ {
201
+ "type": "function",
202
+ "name": "transferFrom",
203
+ "inputs": [
204
+ { "name": "from", "type": "address", "internalType": "address" },
205
+ { "name": "to", "type": "address", "internalType": "address" },
206
+ { "name": "id", "type": "uint256", "internalType": "uint256" }
207
+ ],
208
+ "outputs": [],
209
+ "stateMutability": "nonpayable"
210
+ },
211
+ {
212
+ "type": "function",
213
+ "name": "transferOwnership",
214
+ "inputs": [{ "name": "newOwner", "type": "address", "internalType": "address" }],
215
+ "outputs": [],
216
+ "stateMutability": "nonpayable"
217
+ },
218
+ {
219
+ "type": "event",
220
+ "name": "Approval",
221
+ "inputs": [
222
+ {
223
+ "name": "owner",
224
+ "type": "address",
225
+ "indexed": true,
226
+ "internalType": "address"
227
+ },
228
+ {
229
+ "name": "spender",
230
+ "type": "address",
231
+ "indexed": true,
232
+ "internalType": "address"
233
+ },
234
+ {
235
+ "name": "id",
236
+ "type": "uint256",
237
+ "indexed": true,
238
+ "internalType": "uint256"
239
+ }
240
+ ],
241
+ "anonymous": false
242
+ },
243
+ {
244
+ "type": "event",
245
+ "name": "ApprovalForAll",
246
+ "inputs": [
247
+ {
248
+ "name": "owner",
249
+ "type": "address",
250
+ "indexed": true,
251
+ "internalType": "address"
252
+ },
253
+ {
254
+ "name": "operator",
255
+ "type": "address",
256
+ "indexed": true,
257
+ "internalType": "address"
258
+ },
259
+ {
260
+ "name": "approved",
261
+ "type": "bool",
262
+ "indexed": false,
263
+ "internalType": "bool"
264
+ }
265
+ ],
266
+ "anonymous": false
267
+ },
268
+ {
269
+ "type": "event",
270
+ "name": "OwnershipTransferred",
271
+ "inputs": [
272
+ {
273
+ "name": "user",
274
+ "type": "address",
275
+ "indexed": true,
276
+ "internalType": "address"
277
+ },
278
+ {
279
+ "name": "newOwner",
280
+ "type": "address",
281
+ "indexed": true,
282
+ "internalType": "address"
283
+ }
284
+ ],
285
+ "anonymous": false
286
+ },
287
+ {
288
+ "type": "event",
289
+ "name": "RewardPaid",
290
+ "inputs": [
291
+ {
292
+ "name": "positionId",
293
+ "type": "uint256",
294
+ "indexed": true,
295
+ "internalType": "uint256"
296
+ },
297
+ {
298
+ "name": "reward",
299
+ "type": "address",
300
+ "indexed": true,
301
+ "internalType": "address"
302
+ },
303
+ {
304
+ "name": "amount",
305
+ "type": "uint128",
306
+ "indexed": false,
307
+ "internalType": "uint128"
308
+ }
309
+ ],
310
+ "anonymous": false
311
+ },
312
+ {
313
+ "type": "event",
314
+ "name": "Transfer",
315
+ "inputs": [
316
+ {
317
+ "name": "from",
318
+ "type": "address",
319
+ "indexed": true,
320
+ "internalType": "address"
321
+ },
322
+ {
323
+ "name": "to",
324
+ "type": "address",
325
+ "indexed": true,
326
+ "internalType": "address"
327
+ },
328
+ {
329
+ "name": "id",
330
+ "type": "uint256",
331
+ "indexed": true,
332
+ "internalType": "uint256"
333
+ }
334
+ ],
335
+ "anonymous": false
336
+ },
337
+ { "type": "error", "name": "NotOwner", "inputs": [] }
338
+ ]
@@ -0,0 +1,189 @@
1
+ const DEFAULT_BASE_URL = "https://api.arcadia.finance";
2
+ const API_PREFIX = "/v1/api";
3
+ const DEFAULT_HEADERS = { "User-Agent": "arcadia-mcp/0.1.0" };
4
+ export class ArcadiaApiClient {
5
+ baseUrl;
6
+ timeout;
7
+ constructor(baseUrl, timeout = 30_000) {
8
+ this.baseUrl = (baseUrl ?? process.env.ARCADIA_API_URL ?? DEFAULT_BASE_URL).replace(/\/$/, "");
9
+ this.timeout = timeout;
10
+ }
11
+ async throwApiError(resp, path) {
12
+ const body = await resp.text().catch(() => "");
13
+ const status = resp.status;
14
+ let hint = "";
15
+ if (status === 400) {
16
+ hint =
17
+ " Check that all parameters are valid (correct address format, supported chain_id, valid amounts).";
18
+ }
19
+ else if (status === 404) {
20
+ hint = " The resource was not found. Verify the account/pool/strategy exists on this chain.";
21
+ }
22
+ else if (status === 422) {
23
+ hint = " Invalid input. The API rejected the request parameters.";
24
+ }
25
+ else if (status === 500) {
26
+ hint =
27
+ " Internal backend error. Common causes: account has no creditor (spot account used where margin account is required), unsupported asset type, or transient backend issue. Retry once — if it persists, check account type and parameters.";
28
+ }
29
+ else if (status === 502 || status === 503 || status === 504) {
30
+ hint = " Backend is temporarily unavailable. Retry after a few seconds.";
31
+ }
32
+ const detail = body.length > 500 ? body.slice(0, 500) + "..." : body;
33
+ throw new Error(`Arcadia API error (${status} on ${path}): ${detail || resp.statusText}${hint}`);
34
+ }
35
+ async get(path, params) {
36
+ const url = new URL(`${this.baseUrl}${API_PREFIX}${path}`);
37
+ if (params) {
38
+ for (const [k, v] of Object.entries(params)) {
39
+ if (v !== undefined && v !== null) {
40
+ url.searchParams.set(k, String(v));
41
+ }
42
+ }
43
+ }
44
+ const resp = await fetch(url.toString(), {
45
+ headers: DEFAULT_HEADERS,
46
+ signal: AbortSignal.timeout(this.timeout),
47
+ });
48
+ if (!resp.ok)
49
+ await this.throwApiError(resp, path);
50
+ return resp.json();
51
+ }
52
+ async post(path, body) {
53
+ const url = `${this.baseUrl}${API_PREFIX}${path}`;
54
+ const resp = await fetch(url, {
55
+ method: "POST",
56
+ headers: { ...DEFAULT_HEADERS, "Content-Type": "application/json" },
57
+ body: JSON.stringify(body),
58
+ signal: AbortSignal.timeout(this.timeout),
59
+ });
60
+ if (!resp.ok)
61
+ await this.throwApiError(resp, path);
62
+ return resp.json();
63
+ }
64
+ // ── Accounts ─────────────────────────────────────────────────────
65
+ async getAccounts(chainId, owner) {
66
+ return this.get("/accounts", { chain_id: chainId, owner });
67
+ }
68
+ async getAccountOverview(chainId, account) {
69
+ return this.get("/accounts/overview", { chain_id: chainId, account });
70
+ }
71
+ async getLiquidationPrice(chainId, account) {
72
+ return this.get("/accounts/liquidation", { chain_id: chainId, account });
73
+ }
74
+ async getAccountHistory(chainId, account, days = 14) {
75
+ const end = Math.floor(Date.now() / 1000);
76
+ const start = end - days * 86400;
77
+ return this.get("/accounts/historic_account_values", {
78
+ chain_id: chainId,
79
+ account_address: account,
80
+ start,
81
+ end,
82
+ });
83
+ }
84
+ async getLeaderboard(chainId) {
85
+ return this.get("/accounts/leaderboard", { chain_id: chainId });
86
+ }
87
+ // ── PnL & Yield ─────────────────────────────────────────────────
88
+ async getPnlCostBasis(chainId, account) {
89
+ return this.get("/accounts/pnl_cost_basis", { chain_id: chainId, account_address: account });
90
+ }
91
+ async getYieldEarned(chainId, account) {
92
+ return this.get("/accounts/yield_earned", { chain_id: chainId, account_address: account });
93
+ }
94
+ // ── Assets & Prices ─────────────────────────────────────────────
95
+ async getAssets(chainId) {
96
+ return this.get("/assets", { chain_id: chainId });
97
+ }
98
+ async getPrice(chainId, asset) {
99
+ return this.get("/assets/price", { chain_id: chainId, asset });
100
+ }
101
+ async getPrices(chainId, assets) {
102
+ const url = new URL(`${this.baseUrl}${API_PREFIX}/assets/prices`);
103
+ url.searchParams.set("chain_id", String(chainId));
104
+ for (const a of assets) {
105
+ url.searchParams.append("assets", a);
106
+ }
107
+ const resp = await fetch(url.toString(), {
108
+ headers: DEFAULT_HEADERS,
109
+ signal: AbortSignal.timeout(this.timeout),
110
+ });
111
+ if (!resp.ok)
112
+ await this.throwApiError(resp, "/assets/prices");
113
+ return resp.json();
114
+ }
115
+ // ── Pools ────────────────────────────────────────────────────────
116
+ async getPools(chainId) {
117
+ return this.get("/pools", { chain_id: chainId });
118
+ }
119
+ async getPoolsData(chainId) {
120
+ return this.get("/pools_data", { chain_id: chainId });
121
+ }
122
+ async getPoolApyHistory(chainId, poolAddress, days = 14) {
123
+ return this.get("/pools/historic_apy", {
124
+ chain_id: chainId,
125
+ pool_address: poolAddress,
126
+ days,
127
+ });
128
+ }
129
+ // ── Strategies ───────────────────────────────────────────────────
130
+ async getStrategies(chainId) {
131
+ return this.get("/strategies", { chain_id: chainId });
132
+ }
133
+ async getStrategyInfo(chainId, strategyId) {
134
+ return this.get(`/strategies/${strategyId}/info`, { chain_id: chainId });
135
+ }
136
+ async getFeatured(chainId) {
137
+ return this.get("/featured", { chain_id: chainId });
138
+ }
139
+ // ── Points ───────────────────────────────────────────────────────
140
+ async getPoints(wallet) {
141
+ return this.get("/points", { wallet_address: wallet });
142
+ }
143
+ async getPointsLeaderboard() {
144
+ return this.get("/points/leaderboard");
145
+ }
146
+ // ── Recommendation ───────────────────────────────────────────────
147
+ async getRecommendation(chainId, account) {
148
+ return this.get("/recommendation", { chain_id: chainId, account });
149
+ }
150
+ // ── AAA Token ────────────────────────────────────────────────────
151
+ async getCirculatingSupply() {
152
+ return this.get("/aaa/circulating_cmc");
153
+ }
154
+ // ── Bundle / Calldata (for advanced write tools) ─────────────────
155
+ async getBundleCalldata(body) {
156
+ return this.post("/bundles/calldata", body);
157
+ }
158
+ async getSwapCalldata(params) {
159
+ return this.get("/bundles/swap_calldata", params);
160
+ }
161
+ async getRepayCalldata(params) {
162
+ return this.get("/bundles/repay_calldata", params);
163
+ }
164
+ async getDecreaseLiquidityCalldata(params) {
165
+ const { asset_id, asset_address, ...rest } = params;
166
+ return this.get("/bundles/decrease_liquidity", {
167
+ ...rest,
168
+ asset: asset_address,
169
+ position_id: asset_id,
170
+ });
171
+ }
172
+ async getStakeCalldata(params) {
173
+ const { asset_id, asset_address, ...rest } = params;
174
+ return this.get("/bundles/stake", {
175
+ ...rest,
176
+ asset: asset_address,
177
+ position_id: asset_id,
178
+ });
179
+ }
180
+ async getClaimCalldata(params) {
181
+ const { asset_id, asset_address, ...rest } = params;
182
+ return this.get("/bundles/claim", {
183
+ ...rest,
184
+ asset: asset_address,
185
+ position_id: asset_id,
186
+ });
187
+ }
188
+ }
189
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1,30 @@
1
+ import { createPublicClient, http, defineChain } from "viem";
2
+ import { base, optimism } from "viem/chains";
3
+ const unichain = defineChain({
4
+ id: 130,
5
+ name: "Unichain",
6
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
7
+ rpcUrls: {
8
+ default: { http: ["https://mainnet.unichain.org"] },
9
+ },
10
+ });
11
+ const viemChains = {
12
+ 8453: base,
13
+ 10: optimism,
14
+ 130: unichain,
15
+ };
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ const clients = new Map();
18
+ export function getPublicClient(chainId, chainConfigs) {
19
+ let client = clients.get(chainId);
20
+ if (!client) {
21
+ const config = chainConfigs[chainId];
22
+ client = createPublicClient({
23
+ chain: viemChains[chainId],
24
+ transport: http(config.rpcUrl),
25
+ });
26
+ clients.set(chainId, client);
27
+ }
28
+ return client;
29
+ }
30
+ //# sourceMappingURL=chain.js.map
@@ -0,0 +1,94 @@
1
+ // Protocol contracts — same addresses on all chains
2
+ export const PROTOCOL = {
3
+ factory: "0xDa14Fdd72345c4d2511357214c5B89A919768e59",
4
+ registry: "0xd0690557600eb8Be8391D1d97346e2aab5300d5f",
5
+ liquidator: "0xA4B0b9fD1d91fA2De44F6ABFd59cC14bA1E1a7Af",
6
+ accountV1: "0xbea2B6d45ACaF62385877D835970a0788719cAe1",
7
+ actionMulticall: "0xa48D4201030C09CEA82f5B0955b9C837699D3c32",
8
+ chainlinkOM: "0x6a5485E3ce6913890ae5e8bDc08a868D432eEB31",
9
+ standardERC20AM: "0xfBecEaFC96ed6fc800753d3eE6782b6F9a60Eed7",
10
+ uniswapV3AM: "0x21bd524cC54CA78A7c48254d4676184f781667dC",
11
+ uniswapV4AM: "0xb808971ea73341b0d7286B3D67F08De321f80465",
12
+ slipstreamAM: "0xd3A7055bBcDA4F8F49e5c5dE7E83B09a33633F44",
13
+ slipstreamV2AM: "0x3aDE1F1FdC666B1bFAd376345EA878D1c11EB73B",
14
+ wrappedAeroAM: "0x17B5826382e3a5257b829cF0546A08Bd77409270",
15
+ stakedAeroAM: "0x9f42361B7602Df1A8Ae28Bf63E6cb1883CD44C27",
16
+ stakedSlipstreamAM: "0x1Dc7A0f5336F52724B650E39174cfcbbEdD67bF1",
17
+ stakedSlipstreamV2AM: "0xBed6C3E35B9B1e044b3Bc71465769EdFDC0FDD4c",
18
+ alienBaseAM: "0x79dD8b8d4abB5dEEA986DB1BF0a02E4CA42ae416",
19
+ gaugeHelper: "0x2feb44C740eB4e64aDE33E0D44Ef30049Fb06CC5",
20
+ clHelper: "0x1496Bd3502DE0Dd5b1D44E16623cCc5118771117",
21
+ };
22
+ export const POOLS = {
23
+ 8453: {
24
+ LP_WETH: "0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2",
25
+ LP_USDC: "0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1",
26
+ LP_CBBTC: "0xa37E9b4369dc20940009030BfbC2088F09645e3B",
27
+ },
28
+ };
29
+ export const TRANCHES = {
30
+ 8453: {
31
+ sr_WETH: "0x393893caeB06B5C16728bb1E354b6c36942b1382",
32
+ sr_USDC: "0xEFE32813dBA3A783059d50e5358b9e3661218daD",
33
+ sr_CBBTC: "0x9c63A4c499B323a25D389Da759c2ac1e385eEc92",
34
+ },
35
+ };
36
+ export const TOKENS = {
37
+ 8453: {
38
+ WETH: { address: "0x4200000000000000000000000000000000000006", decimals: 18 },
39
+ USDC: { address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", decimals: 6 },
40
+ cbBTC: { address: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf", decimals: 8 },
41
+ AERO: { address: "0x940181a94A35A4569E4529A3CDfB74e38FD98631", decimals: 18 },
42
+ AAA: { address: "0xaaa843fb2916c0B57454270418E121C626402AAa", decimals: 18 },
43
+ stAAA: { address: "0xDeA1531d8a1505785eb517C7A28526443df223F3", decimals: 18 },
44
+ },
45
+ };
46
+ export const ASSET_MANAGERS = {
47
+ base: {
48
+ // Rebalancers — use V2.1.1 (latest). Match to your LP protocol.
49
+ rebalancers: {
50
+ slipstreamV1: "0x5802454749cc0c4A6F28D5001B4cD84432e2b79F",
51
+ slipstreamV2: "0x953Ff365d0b562ceC658dc46B394E9282338d9Ea",
52
+ uniV3: "0xbA1D0c99c261F94b9C8b52465890Cca27dd993Bd",
53
+ uniV4: "0x01EDaF0067a10D18c88D2876c0A85Ee0096a5Ac0",
54
+ },
55
+ // Compounders — auto-reinvest trading fees into the position
56
+ compounders: {
57
+ slipstreamV1: "0x467837f44A71e3eAB90AEcfC995c84DC6B3cfCF7",
58
+ slipstreamV2: "0x35e59448C7145482E56212510cC689612AB4F61f",
59
+ uniV3: "0x02e1fa043214E51eDf1F0478c6D0d3D5658a2DC3",
60
+ uniV4: "0xAA95c9c402b195D8690eCaea2341a76e3266B189",
61
+ },
62
+ // Yield Claimers — claim pending fees/emissions to a recipient
63
+ yieldClaimers: {
64
+ slipstreamV1: "0x5a8278D37b7a787574b6Aa7E18d8C02D994f18Ba",
65
+ slipstreamV2: "0xc8bF4B2c740FF665864E9494832520f18822871C",
66
+ uniV3: "0x75Ed28EA8601Ce9F5FbcAB1c2428f04A57aFaA16",
67
+ uniV4: "0xD8aa21AB7f9B8601CB7d7A776D3AFA1602d5D8D4",
68
+ },
69
+ // Merkl Operator — claims external Merkl incentive rewards for the account
70
+ merklOperator: "0x969F0251360b9Cf11c68f6Ce9587924c1B8b42C6",
71
+ // CoW Swapper — places CoW Protocol swap orders on behalf of the account
72
+ cowSwapper: "0xc928013A219EC9F18dE7B2dee6A50Ba626811854",
73
+ // Gas Relayer — approve AAA tokens here to pay for extra rebalances beyond free quota
74
+ gasRelayer: "0xD938C8d04cF91094fecAF0A2018EAac483a40137",
75
+ },
76
+ };
77
+ // Minimal strategy hook — required for rebalancer onSetAssetManager callback
78
+ export const MINIMAL_STRATEGY_HOOK = "0x13beD1A58d87c0454872656c5328103aAe5eB86A";
79
+ // Position manager → protocol mapping (for Slipstream V1/V2 detection)
80
+ // Staked and wrapped staked variants use the same asset managers as their base protocol.
81
+ export const POSITION_MANAGERS = {
82
+ "0x827922686190790b37229fd06084350e74485b72": "slipstream",
83
+ "0x1dc7a0f5336f52724b650e39174cfcbbedd67bf1": "slipstream",
84
+ "0xd74339e0f10fce96894916b93e5cc7de89c98272": "slipstream",
85
+ "0xa990c6a764b73bf43cee5bb40339c3322fb9d55f": "slipstream_v2",
86
+ "0xbed6c3e35b9b1e044b3bc71465769edfdc0fdd4c": "slipstream_v2",
87
+ "0x147a2ccbaf4521ad209a2875ae0b3c496f4b25a4": "slipstream_v2",
88
+ };
89
+ // Chain-specific addresses
90
+ export const STATE_VIEWERS = {
91
+ 8453: "0xA3c0c9b65baD0b08107Aa264b0f3dB444b867A71",
92
+ 130: "0x86e8631A016F9068C3f085fAF484Ee3F5fDee8f2",
93
+ };
94
+ //# sourceMappingURL=addresses.js.map
@@ -0,0 +1,31 @@
1
+ export const SUPPORTED_CHAIN_IDS = [8453, 10, 130];
2
+ export function getChainConfigs() {
3
+ return {
4
+ 8453: {
5
+ name: "base",
6
+ chainId: 8453,
7
+ rpcUrl: process.env.RPC_URL_BASE ?? "https://mainnet.base.org",
8
+ stateViewer: "0xA3c0c9b65baD0b08107Aa264b0f3dB444b867A71",
9
+ },
10
+ 10: {
11
+ name: "optimism",
12
+ chainId: 10,
13
+ rpcUrl: process.env.RPC_URL_OPTIMISM ?? "https://mainnet.optimism.io",
14
+ stateViewer: null, // TBD — Optimism deployment pending
15
+ },
16
+ 130: {
17
+ name: "unichain",
18
+ chainId: 130,
19
+ rpcUrl: process.env.RPC_URL_UNICHAIN ?? "https://mainnet.unichain.org",
20
+ stateViewer: "0x86e8631A016F9068C3f085fAF484Ee3F5fDee8f2",
21
+ },
22
+ };
23
+ }
24
+ export function resolveChainId(input) {
25
+ const id = typeof input === "string" ? parseInt(input, 10) : input;
26
+ if (!SUPPORTED_CHAIN_IDS.includes(id)) {
27
+ throw new Error(`Unsupported chain ID: ${id}. Arcadia is deployed on Base (8453), Optimism (10), and Unichain (130).`);
28
+ }
29
+ return id;
30
+ }
31
+ //# sourceMappingURL=chains.js.map