@arcadia-finance/mcp-server 0.5.1 → 0.6.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.
- package/README.md +58 -52
- package/dist/clients/api.js +52 -11
- package/dist/clients/chain.js +25 -0
- package/dist/config/addresses.js +22 -2
- package/dist/config/chains.js +12 -4
- package/dist/index.js +36 -134
- package/dist/prompts/workflows.js +54 -18
- package/dist/resources/guides.js +1 -1
- package/dist/tools/aero.js +157 -0
- package/dist/tools/dev/send.js +4 -4
- package/dist/tools/index.js +6 -0
- package/dist/tools/output-schemas.js +103 -29
- package/dist/tools/read/account.js +57 -15
- package/dist/tools/read/aero-upgrade.js +53 -0
- package/dist/tools/read/asset-managers.js +9 -9
- package/dist/tools/read/assets.js +9 -9
- package/dist/tools/read/guides.js +4 -4
- package/dist/tools/read/points.js +4 -4
- package/dist/tools/read/pools.js +10 -9
- package/dist/tools/read/shapes.js +48 -0
- package/dist/tools/read/strategy.js +14 -13
- package/dist/tools/read/wallet.js +15 -15
- package/dist/tools/write/account/add-liquidity.js +9 -9
- package/dist/tools/write/account/aero-upgrade.js +124 -0
- package/dist/tools/write/account/borrow.js +5 -5
- package/dist/tools/write/account/close.js +8 -8
- package/dist/tools/write/account/create.js +3 -3
- package/dist/tools/write/account/deleverage.js +4 -4
- package/dist/tools/write/account/deposit.js +4 -4
- package/dist/tools/write/account/format-response.js +1 -1
- package/dist/tools/write/account/remove-liquidity.js +6 -6
- package/dist/tools/write/account/repay.js +4 -4
- package/dist/tools/write/account/stake.js +5 -5
- package/dist/tools/write/account/swap.js +4 -4
- package/dist/tools/write/account/withdraw.js +5 -5
- package/dist/tools/write/asset-managers/automations.js +14 -14
- package/dist/tools/write/asset-managers/intents.js +10 -7
- package/dist/tools/write/pool/deposit.js +5 -5
- package/dist/tools/write/pool/redeem.js +4 -4
- package/dist/tools/write/wallet/approve.js +4 -4
- package/dist/tools/write/wallet/upgrade-velo.js +76 -0
- package/dist/utils/analytics.js +68 -0
- package/dist/utils/http-config.js +4 -4
- package/llms-full.txt +114 -77
- package/llms.txt +47 -44
- package/package.json +8 -4
- package/server.json +10 -4
- package/skills/clamm-liquidity/SKILL.md +101 -83
- package/skills/clamm-liquidity/automation.md +14 -14
- package/skills/clamm-liquidity/selection.md +13 -13
- package/skills/clamm-liquidity/strategies.md +135 -53
- package/skills/openclaw/SKILL.md +3 -3
- package/skills/openclaw/arcadia.sh +24 -45
- package/skills/openclaw/contracts.md +19 -16
- package/dist/utils/tool-naming.js +0 -91
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://lobehub.com/mcp/arcadia-finance-mcp-server)
|
|
10
10
|
[](https://glama.ai/mcp/servers/arcadia-finance/mcp-server)
|
|
11
11
|
|
|
12
|
-
MCP server for [Arcadia Finance](https://arcadia.finance), a platform for concentrated liquidity on Uniswap and
|
|
12
|
+
MCP server for [Arcadia Finance](https://arcadia.finance), a platform for concentrated liquidity on Uniswap and Aero 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
|
|
|
14
14
|
Designed for AI agents (Claude, Cursor, etc.) to interact with Arcadia onchain.
|
|
15
15
|
|
|
@@ -24,24 +24,25 @@ Designed for AI agents (Claude, Cursor, etc.) to interact with Arcadia onchain.
|
|
|
24
24
|
|
|
25
25
|
| Tool | Description |
|
|
26
26
|
| ------------------------------ | ----------------------------------------------------------------------------------------------------------- |
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
27
|
+
| `read_account_info` | Account overview: health factor, collateral, debt, positions, liquidation price, automation status. |
|
|
28
|
+
| `read_account_history` | Historical account value over time. |
|
|
29
|
+
| `read_account_pnl` | PnL and yield data for an account. |
|
|
30
|
+
| `read_wallet_accounts` | List all Arcadia accounts owned by a wallet address. |
|
|
31
|
+
| `read_account_aero_upgrade` | What a wallet's accounts (or one account) have to upgrade to Aero: status and counts, no calldata. |
|
|
32
|
+
| `read_wallet_balances` | On-chain ERC20 balances and native ETH for a wallet address. |
|
|
33
|
+
| `read_wallet_allowances` | Check ERC20 token allowances for a spender. Use before `write_wallet_approve` to avoid redundant approvals. |
|
|
34
|
+
| `read_wallet_points` | Points balance for a specific wallet address. |
|
|
35
|
+
| `read_asset_list` | Supported collateral assets with addresses, types, decimals. |
|
|
36
|
+
| `read_asset_prices` | USD prices for one or more asset addresses. |
|
|
37
|
+
| `read_pool_list` | All lending pools: TVL, APY, utilization, liquidity. |
|
|
38
|
+
| `read_pool_info` | Single pool detail with APY history over time. |
|
|
39
|
+
| `read_point_leaderboard` | Paginated Arcadia points leaderboard. |
|
|
40
|
+
| `read_strategy_list` | LP strategies with APY, underlyings, pool info. Supports featured filter and pagination. |
|
|
41
|
+
| `read_strategy_info` | Full detail for a specific LP strategy: APY per range width, pool config. |
|
|
42
|
+
| `read_strategy_recommendation` | Rebalancing recommendation for an account. |
|
|
43
|
+
| `read_guides` | Reference guides: automation setup, strategy selection, strategy templates. |
|
|
44
|
+
| `read_asset_manager_intents` | Automation intents and their params; add `account_address` for live per-account availability. |
|
|
45
|
+
| `read_asset_manager_current` | Automations enabled on an account: decoded config, mapped intents, Merkl state, superseded managers. |
|
|
45
46
|
|
|
46
47
|
### Write Tools
|
|
47
48
|
|
|
@@ -49,30 +50,32 @@ All write tools return unsigned transactions as `{ to, data, value, chainId }`.
|
|
|
49
50
|
|
|
50
51
|
| Tool | Description |
|
|
51
52
|
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
53
|
+
| `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. |
|
|
54
|
+
| `write_wallet_upgrade_velo` | Upgrade wallet VELO on Optimism to the new AERO on Base (approve, then the payable deposit). |
|
|
55
|
+
| `write_pool_deposit` | Lend the pool's underlying asset into an ERC-4626 tranche to earn interest. Mints tranche shares to the receiver. |
|
|
56
|
+
| `write_pool_redeem` | Redeem tranche shares back into the underlying asset (lender exit). |
|
|
57
|
+
| `write_account_create` | Create a new Arcadia account via Factory. |
|
|
58
|
+
| `write_account_deposit` | Deposit ERC20 tokens into an account. |
|
|
59
|
+
| `write_account_withdraw` | Withdraw assets from an account. |
|
|
60
|
+
| `write_account_borrow` | Borrow from a lending pool. |
|
|
61
|
+
| `write_account_repay` | Repay debt to a lending pool from wallet. |
|
|
62
|
+
| `write_account_add_liquidity` | Flash-action: deposit + swap + mint LP + optional leverage, atomically. |
|
|
63
|
+
| `write_account_remove_liquidity` | Remove/decrease LP position liquidity. |
|
|
64
|
+
| `write_account_swap` | Swap assets within an account (backend-routed). |
|
|
65
|
+
| `write_account_deleverage` | Repay debt by selling collateral (swap + repay in one tx). |
|
|
66
|
+
| `write_account_close` | Atomic close: burn LP + swap + repay debt in one tx. |
|
|
67
|
+
| `write_account_stake` | Stake, unstake, or claim rewards for LP positions. |
|
|
68
|
+
| `write_account_aero_upgrade` | Upgrade an account to Aero: its Slipstream positions move to Aero CL and its old AERO becomes the new AERO, in one flashAction. |
|
|
69
|
+
| `write_account_automations` | Configure automations from an intents array (full desired state). Returns the unsigned setAssetManagers tx. |
|
|
70
|
+
| `write_account_automations_delta` | Enable/disable individual automations, leaving the rest untouched. |
|
|
68
71
|
|
|
69
72
|
### Dev Tools
|
|
70
73
|
|
|
71
74
|
Always registered but requires `PK` env var to function.
|
|
72
75
|
|
|
73
|
-
| Tool | Description
|
|
74
|
-
| ---------- |
|
|
75
|
-
| `
|
|
76
|
+
| Tool | Description |
|
|
77
|
+
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
78
|
+
| `dev_send` | Sign and broadcast an unsigned transaction using a local private key (`PK` env var). Not for production: use a dedicated wallet MCP server instead. |
|
|
76
79
|
|
|
77
80
|
## Transaction Signing
|
|
78
81
|
|
|
@@ -103,11 +106,11 @@ import { base } from "viem/chains";
|
|
|
103
106
|
const account = privateKeyToAccount("0x...");
|
|
104
107
|
const client = createWalletClient({ account, chain: base, transport: http() });
|
|
105
108
|
|
|
106
|
-
// tx = result from any
|
|
109
|
+
// tx = result from any write_* tool
|
|
107
110
|
const hash = await client.sendTransaction(tx);
|
|
108
111
|
```
|
|
109
112
|
|
|
110
|
-
**Built-in `
|
|
113
|
+
**Built-in `dev_send` tool (development only):**
|
|
111
114
|
The server includes a dev-only signing tool that reads a private key from the `PK` environment variable. Set `PK` via a `.env` file or your MCP client config:
|
|
112
115
|
|
|
113
116
|
```bash
|
|
@@ -131,18 +134,21 @@ yarn build
|
|
|
131
134
|
|
|
132
135
|
**Environment variables:**
|
|
133
136
|
|
|
134
|
-
| Variable
|
|
135
|
-
|
|
|
136
|
-
| `RPC_URL_BASE`
|
|
137
|
-
| `RPC_URL_UNICHAIN`
|
|
138
|
-
| `RPC_URL_OPTIMISM`
|
|
139
|
-
| `
|
|
140
|
-
| `
|
|
141
|
-
| `
|
|
142
|
-
| `
|
|
143
|
-
| `
|
|
144
|
-
|
|
145
|
-
|
|
137
|
+
| Variable | Required | Default | Transport | Description |
|
|
138
|
+
| ------------------- | -------- | ----------------------------- | --------- | -------------------------------------------------------------- |
|
|
139
|
+
| `RPC_URL_BASE` | No | Public RPC | Both | RPC URL for Base (8453). |
|
|
140
|
+
| `RPC_URL_UNICHAIN` | No | Public RPC | Both | RPC URL for Unichain (130). |
|
|
141
|
+
| `RPC_URL_OPTIMISM` | No | Public RPC | Both | RPC URL for Optimism (10). |
|
|
142
|
+
| `RPC_URL_ROBINHOOD` | No | Public RPC | Both | RPC URL for Robinhood (4663). |
|
|
143
|
+
| `PK` | No | none | Both | Private key (hex) for dev-only `dev_send` tool. |
|
|
144
|
+
| `TRANSPORT` | No | `stdio` | — | Transport mode: `stdio` or `http`. |
|
|
145
|
+
| `PORT` | No | `3000` | HTTP | Listen port for HTTP transport. |
|
|
146
|
+
| `ALLOWED_ORIGINS` | No | `https://mcp.arcadia.finance` | HTTP | Comma-separated allowed Origin headers (CORS / DNS rebinding). |
|
|
147
|
+
| `RATE_LIMIT_RPM` | No | `600` | HTTP | Max requests per minute per client IP. |
|
|
148
|
+
| `POSTHOG_KEY` | No | none | HTTP | PostHog project key. Unset = no analytics are sent. |
|
|
149
|
+
| `POSTHOG_HOST` | No | `https://eu.i.posthog.com` | HTTP | PostHog ingestion host. |
|
|
150
|
+
|
|
151
|
+
**Supported chains:** Base (8453), Unichain (130), Optimism (10), Robinhood (4663)
|
|
146
152
|
|
|
147
153
|
## MCP Client Configuration
|
|
148
154
|
|
package/dist/clients/api.js
CHANGED
|
@@ -5,6 +5,17 @@ const pkg = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url))
|
|
|
5
5
|
const DEFAULT_BASE_URL = "https://api.arcadia.finance";
|
|
6
6
|
const API_PREFIX = "/v1/api";
|
|
7
7
|
const DEFAULT_HEADERS = { "User-Agent": `arcadia-mcp/${pkg.version}` };
|
|
8
|
+
/** Non-2xx backend response. `body` is the parsed JSON body when there is one, else the raw text. */
|
|
9
|
+
export class ArcadiaApiError extends Error {
|
|
10
|
+
status;
|
|
11
|
+
body;
|
|
12
|
+
constructor(message, status, body) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.status = status;
|
|
15
|
+
this.body = body;
|
|
16
|
+
this.name = "ArcadiaApiError";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
8
19
|
export class ArcadiaApiClient {
|
|
9
20
|
baseUrl;
|
|
10
21
|
timeout;
|
|
@@ -28,19 +39,32 @@ export class ArcadiaApiClient {
|
|
|
28
39
|
}
|
|
29
40
|
else if (status === 500) {
|
|
30
41
|
hint =
|
|
31
|
-
" Internal backend error. Common causes: account has no creditor (spot account used where margin required), position does not exist in the account, unsupported asset type, or transient issue. Verify account and position details with
|
|
42
|
+
" Internal backend error. Common causes: account has no creditor (spot account used where margin required), position does not exist in the account, unsupported asset type, or transient issue. Verify account and position details with read_account_info, then retry once.";
|
|
32
43
|
}
|
|
33
44
|
else if (status === 502 || status === 503 || status === 504) {
|
|
34
45
|
hint = " Backend is temporarily unavailable. Retry after a few seconds.";
|
|
35
46
|
}
|
|
36
47
|
const detail = body.length > 500 ? body.slice(0, 500) + "..." : body;
|
|
37
|
-
|
|
48
|
+
let parsed = body;
|
|
49
|
+
try {
|
|
50
|
+
parsed = JSON.parse(body);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// Not JSON: keep the raw text.
|
|
54
|
+
}
|
|
55
|
+
throw new ArcadiaApiError(`Arcadia API error (${status} on ${path}): ${detail || resp.statusText}${hint}`, status, parsed);
|
|
38
56
|
}
|
|
39
57
|
async get(path, params) {
|
|
40
58
|
const url = new URL(`${this.baseUrl}${API_PREFIX}${path}`);
|
|
41
59
|
if (params) {
|
|
42
60
|
for (const [k, v] of Object.entries(params)) {
|
|
43
|
-
if (v
|
|
61
|
+
if (v === undefined || v === null)
|
|
62
|
+
continue;
|
|
63
|
+
if (Array.isArray(v)) {
|
|
64
|
+
for (const item of v)
|
|
65
|
+
url.searchParams.append(k, item);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
44
68
|
url.searchParams.set(k, String(v));
|
|
45
69
|
}
|
|
46
70
|
}
|
|
@@ -53,13 +77,13 @@ export class ArcadiaApiClient {
|
|
|
53
77
|
await this.throwApiError(resp, path);
|
|
54
78
|
return resp.json();
|
|
55
79
|
}
|
|
56
|
-
async post(path, body) {
|
|
80
|
+
async post(path, body, timeoutMs) {
|
|
57
81
|
const url = `${this.baseUrl}${API_PREFIX}${path}`;
|
|
58
82
|
const resp = await fetch(url, {
|
|
59
83
|
method: "POST",
|
|
60
84
|
headers: { ...DEFAULT_HEADERS, "Content-Type": "application/json" },
|
|
61
85
|
body: JSON.stringify(body),
|
|
62
|
-
signal: AbortSignal.timeout(this.timeout),
|
|
86
|
+
signal: AbortSignal.timeout(timeoutMs ?? this.timeout),
|
|
63
87
|
});
|
|
64
88
|
if (!resp.ok)
|
|
65
89
|
await this.throwApiError(resp, path);
|
|
@@ -120,12 +144,6 @@ export class ArcadiaApiClient {
|
|
|
120
144
|
async getPools(chainId) {
|
|
121
145
|
return this.get("/pools", { chain_id: chainId });
|
|
122
146
|
}
|
|
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
147
|
async getPoolApyHistory(chainId, poolAddress, days = 14) {
|
|
130
148
|
return this.get("/pools/historic_apy", {
|
|
131
149
|
chain_id: chainId,
|
|
@@ -192,6 +210,29 @@ export class ArcadiaApiClient {
|
|
|
192
210
|
position_id: asset_id,
|
|
193
211
|
});
|
|
194
212
|
}
|
|
213
|
+
// ── Aero (MetadexCL V1) upgrade ──────────────────────────────────
|
|
214
|
+
// The backend plans the upgrade, builds the ActionManager flashAction and
|
|
215
|
+
// simulates it. These return its responses unchanged.
|
|
216
|
+
/** Exactly one of owner_address and account_address. */
|
|
217
|
+
async getAeroUpgradeCandidates(params) {
|
|
218
|
+
return this.get("/bundles/aero_migration_candidates", params);
|
|
219
|
+
}
|
|
220
|
+
/** `choices` are `<position_manager>:<position_id>:<pool>` picks; the endpoint reads them from one comma-separated param. */
|
|
221
|
+
async getAeroUpgradePlan(params) {
|
|
222
|
+
const { choices, ...rest } = params;
|
|
223
|
+
return this.get("/bundles/aero_upgrade", {
|
|
224
|
+
...rest,
|
|
225
|
+
choices: choices && choices.length > 0 ? choices.join(",") : undefined,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
async postAeroUpgradeBatch(body) {
|
|
229
|
+
// The backend plans and simulates the accounts one after another, a few seconds each.
|
|
230
|
+
const timeoutMs = Math.max(this.timeout, 20_000 * body.accounts.length);
|
|
231
|
+
return this.post("/bundles/aero_upgrade/batch", body, timeoutMs);
|
|
232
|
+
}
|
|
233
|
+
async getUpgradeVeloCalldata(params) {
|
|
234
|
+
return this.get("/bundles/upgrade_velo", params);
|
|
235
|
+
}
|
|
195
236
|
// ── Automations (intent compiler) ────────────────────────────────
|
|
196
237
|
// The backend owns intent resolution, compatibility validation and metadata
|
|
197
238
|
// encoding. These endpoints return finished setAssetManagers calldata.
|
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
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
// Aero CL (MetadexCL V1). EIP-55 values from team-tooling _SHARED/aero-migration/addresses.md.
|
|
2
|
+
export const AERO_NPM_BASE = "0x4857DB576eE0e45F10525eC59527BfD10beeC60b";
|
|
3
|
+
export const AERO_NPM_OP = "0x4857DB576eE0e45F10525eC59527BfD10beeC60b";
|
|
4
|
+
export const AERO_NPM_ROBINHOOD = "0x4857DB576eE0e45F10525eC59527BfD10beeC60b";
|
|
5
|
+
// Arcadia Metadex CL modules (identical on Base, Optimism and Robinhood).
|
|
6
|
+
export const ARC_STAKED_METADEX_CL_AM = "0x0f34F7F7B558F43a821AF4181f0F8e5bC4B74892";
|
|
7
|
+
export const ARC_WRAPPED_STAKED_METADEX_CL = "0x323808A037628F2BaF4F42784E011FCf9C49A88b";
|
|
1
8
|
// Protocol contracts — same addresses on all chains
|
|
2
9
|
export const PROTOCOL = {
|
|
3
10
|
factory: "0xDa14Fdd72345c4d2511357214c5B89A919768e59",
|
|
@@ -49,7 +56,8 @@ export const TOKENS = {
|
|
|
49
56
|
WETH: { address: "0x4200000000000000000000000000000000000006", decimals: 18 },
|
|
50
57
|
USDC: { address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", decimals: 6 },
|
|
51
58
|
cbBTC: { address: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf", decimals: 8 },
|
|
52
|
-
AERO: { address: "
|
|
59
|
+
AERO: { address: "0x3f5bF3EdAc59d650D8fDf9657a71F2f904A3a4Ee", decimals: 18 },
|
|
60
|
+
"AERO (legacy)": { address: "0x940181a94A35A4569E4529A3CDfB74e38FD98631", decimals: 18 },
|
|
53
61
|
AAA: { address: "0xaaa843fb2916c0B57454270418E121C626402AAa", decimals: 18 },
|
|
54
62
|
stAAA: { address: "0xDeA1531d8a1505785eb517C7A28526443df223F3", decimals: 18 },
|
|
55
63
|
},
|
|
@@ -85,6 +93,7 @@ const BACKEND_PROTOCOL_TO_DEX_PROTOCOL = {
|
|
|
85
93
|
slipstream_v2: "slipstream_v2",
|
|
86
94
|
slipstream_v3: "slipstream_v3",
|
|
87
95
|
slipstream_v3_op: "slipstream_v3",
|
|
96
|
+
metadexcl_v1: "metadexcl_v1",
|
|
88
97
|
uniswap_v3: "uniV3",
|
|
89
98
|
uniswap_v4: "uniV4",
|
|
90
99
|
};
|
|
@@ -100,7 +109,8 @@ export function backendProtocolToDexProtocol(protocol) {
|
|
|
100
109
|
export const STATE_VIEWERS = {
|
|
101
110
|
8453: "0xA3c0c9b65baD0b08107Aa264b0f3dB444b867A71",
|
|
102
111
|
130: "0x86e8631A016F9068C3f085fAF484Ee3F5fDee8f2",
|
|
103
|
-
10: "
|
|
112
|
+
10: "0xc18a3169788F4F75A170290584ECA6395C75Ecdb",
|
|
113
|
+
4663: "0xF3334192D15450CdD385c8B70e03f9A6bD9E673b",
|
|
104
114
|
};
|
|
105
115
|
// LP position manager address (lowercase) → dex_protocol value
|
|
106
116
|
// Chain-specific: non-staked LP position manager addresses differ per chain
|
|
@@ -111,6 +121,7 @@ export const CHAIN_POSITION_MANAGERS = {
|
|
|
111
121
|
"0xe1f8cd9ac4e4a65f54f38a5cdafca44f6dd68b53": "slipstream_v3",
|
|
112
122
|
"0x03a520b32c04bf3beef7beb72e919cf822ed34f1": "uniV3",
|
|
113
123
|
"0x7c5f5a4bbd8fd63184577525326123b519429bdc": "uniV4",
|
|
124
|
+
[AERO_NPM_BASE.toLowerCase()]: "metadexcl_v1",
|
|
114
125
|
},
|
|
115
126
|
130: {
|
|
116
127
|
"0x991d5546c4b442b4c5fdc4c8b8b8d131deb24702": "slipstream",
|
|
@@ -122,6 +133,13 @@ export const CHAIN_POSITION_MANAGERS = {
|
|
|
122
133
|
"0xf7f8ccce99ca2896ec75d3a399d152db96808399": "slipstream_v3",
|
|
123
134
|
"0xc36442b4a4522e871399cd717abdd847ab11fe88": "uniV3",
|
|
124
135
|
"0x3c3ea4b57a46241e54610e5f022e5c45859a1017": "uniV4",
|
|
136
|
+
[AERO_NPM_OP.toLowerCase()]: "metadexcl_v1",
|
|
137
|
+
},
|
|
138
|
+
// Uniswap V3/V4 and Aero CL. No Slipstream V1-V3 or Aerodrome deployment on Robinhood.
|
|
139
|
+
4663: {
|
|
140
|
+
"0x73991a25c818bf1f1128deaab1492d45638de0d3": "uniV3",
|
|
141
|
+
"0x58daec3116aae6d93017baaea7749052e8a04fa7": "uniV4",
|
|
142
|
+
[AERO_NPM_ROBINHOOD.toLowerCase()]: "metadexcl_v1",
|
|
125
143
|
},
|
|
126
144
|
};
|
|
127
145
|
// Staked / wrapped-staked position managers. V1 and V2 are deployed at the same
|
|
@@ -134,6 +152,8 @@ export const UNIVERSAL_POSITION_MANAGERS = {
|
|
|
134
152
|
"0xd74339e0f10fce96894916b93e5cc7de89c98272": "staked_slipstream", // WrappedStakedSlipstream V1
|
|
135
153
|
"0x147a2ccbaf4521ad209a2875ae0b3c496f4b25a4": "staked_slipstream_v2", // WrappedStakedSlipstream V2
|
|
136
154
|
"0x9189bc25f8fac157b4d87b0b3c14f56ba1477d53": "staked_slipstream_v3", // WrappedStakedSlipstream V3
|
|
155
|
+
[ARC_STAKED_METADEX_CL_AM.toLowerCase()]: "staked_metadexcl_v1", // StakedMetadex03CLAM
|
|
156
|
+
[ARC_WRAPPED_STAKED_METADEX_CL.toLowerCase()]: "staked_metadexcl_v1", // WrappedStakedMetadexCL
|
|
137
157
|
};
|
|
138
158
|
export const CHAIN_STAKED_POSITION_MANAGERS = {
|
|
139
159
|
10: {
|
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
|
}
|