@arcadia-finance/mcp-server 0.4.5 → 0.4.6

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.
@@ -106,6 +106,19 @@ const YIELD_CLAIMERS_V2_0_1 = {
106
106
  uniV3: "0x40462e71Effd9974Fee04B6b327B701D663f753e",
107
107
  uniV4: "0x3BC2B398eEEE9807ff76fdb4E11526dE0Ee80cEa",
108
108
  };
109
+ // Optimism-specific V2.1.1 overrides: slipstreamV3 was deployed at different addresses on Optimism.
110
+ const REBALANCERS_V2_1_1_OPTIMISM = {
111
+ ...REBALANCERS_V2_1_1,
112
+ slipstreamV3: "0x33442fC10a20Aad0ddD73F6ae24500F5B370DC51",
113
+ };
114
+ const COMPOUNDERS_V2_1_1_OPTIMISM = {
115
+ ...COMPOUNDERS_V2_1_1,
116
+ slipstreamV3: "0x3e7b6997399eC402491c4A049e4CD727d3aA1738",
117
+ };
118
+ const YIELD_CLAIMERS_V2_1_1_OPTIMISM = {
119
+ ...YIELD_CLAIMERS_V2_1_1,
120
+ slipstreamV3: "0x3630bDb1Ac7cF8A435411391db75450350814F42",
121
+ };
109
122
  // Deployed versions per chain, newest first. The first entry is treated as
110
123
  // the "current" version (used for new registrations). Older entries are
111
124
  // probed in read.account.info so users registered on older versions are
@@ -122,9 +135,9 @@ const CHAIN_AM_VERSIONS = {
122
135
  yieldClaimers: [YIELD_CLAIMERS_V2_1_1],
123
136
  },
124
137
  10: {
125
- rebalancers: [REBALANCERS_V2_1_1],
126
- compounders: [COMPOUNDERS_V2_1_1],
127
- yieldClaimers: [YIELD_CLAIMERS_V2_1_1],
138
+ rebalancers: [REBALANCERS_V2_1_1_OPTIMISM],
139
+ compounders: [COMPOUNDERS_V2_1_1_OPTIMISM],
140
+ yieldClaimers: [YIELD_CLAIMERS_V2_1_1_OPTIMISM],
128
141
  },
129
142
  };
130
143
  const STANDALONE_AM_ADDRESSES = {
@@ -133,11 +146,11 @@ const STANDALONE_AM_ADDRESSES = {
133
146
  cowSwapper: "0xFfC742E68D41389BE9Ef1aFD518F036064DA2Bb6",
134
147
  };
135
148
  // Per-chain availability — update these when deploying to new chains.
136
- // Slipstream V3 position manager is only live on Base; Unichain and Optimism have V1 only.
149
+ // Slipstream V2 is Base-only. V3 is live on Base and Optimism. Unichain has V1 only.
137
150
  const CHAIN_PROTOCOLS = {
138
151
  8453: new Set(["slipstreamV1", "slipstreamV2", "slipstreamV3", "uniV3", "uniV4"]),
139
152
  130: new Set(["slipstreamV1", "uniV3", "uniV4"]),
140
- 10: new Set(["slipstreamV1", "uniV3", "uniV4"]),
153
+ 10: new Set(["slipstreamV1", "slipstreamV3", "uniV3", "uniV4"]),
141
154
  };
142
155
  const CHAIN_STANDALONE_AMS = {
143
156
  8453: new Set(["merklOperator", "gasRelayer", "cowSwapper"]),
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ import { registerAllTools } from "./tools/index.js";
16
16
  import { registerAllResources } from "./resources/index.js";
17
17
  import { registerAllPrompts } from "./prompts/index.js";
18
18
  import { wrapServerForHttp, convertToolNames } from "./utils/tool-naming.js";
19
+ import { applyTrustProxyFromEnv, parseListenPort, parseRateLimitRpm } from "./utils/http-config.js";
19
20
  const require = createRequire(import.meta.url);
20
21
  const pkg = require("../package.json");
21
22
  const apiClient = new ArcadiaApiClient();
@@ -37,7 +38,8 @@ if (transportMode === "http") {
37
38
  const { StreamableHTTPServerTransport } = await import("@modelcontextprotocol/sdk/server/streamableHttp.js");
38
39
  const express = (await import("express")).default;
39
40
  const app = express();
40
- const port = parseInt(process.env.PORT ?? "3000", 10);
41
+ applyTrustProxyFromEnv(app, process.env.TRUST_PROXY);
42
+ const port = parseListenPort(process.env.PORT);
41
43
  const ALLOWED_ORIGINS = (process.env.ALLOWED_ORIGINS ?? "https://mcp.arcadia.finance")
42
44
  .split(",")
43
45
  .map((o) => o.trim());
@@ -61,7 +63,7 @@ if (transportMode === "http") {
61
63
  res.status(204).end();
62
64
  });
63
65
  const { default: rateLimit, ipKeyGenerator } = await import("express-rate-limit");
64
- const rpm = parseInt(process.env.RATE_LIMIT_RPM ?? "60", 10);
66
+ const rpm = parseRateLimitRpm(process.env.RATE_LIMIT_RPM);
65
67
  app.use("/mcp", rateLimit({
66
68
  windowMs: 60_000,
67
69
  max: rpm,
@@ -4,7 +4,7 @@ import { privateKeyToAccount } from "viem/accounts";
4
4
  import { base, optimism, unichain } from "viem/chains";
5
5
  import { CHAIN_ID_DESCRIPTION } from "../../config/chains.js";
6
6
  import { DevSendOutput } from "../output-schemas.js";
7
- import { validateAddress } from "../../utils/validation.js";
7
+ import { validateAddress, validateHexCalldata, parseWeiDecimalString, } from "../../utils/validation.js";
8
8
  const VIEM_CHAINS = {
9
9
  8453: base,
10
10
  130: unichain,
@@ -42,6 +42,8 @@ export function registerSendTool(server, chains) {
42
42
  };
43
43
  }
44
44
  const validTo = validateAddress(params.to, "to");
45
+ const calldata = validateHexCalldata(params.data, "data");
46
+ const valueWei = parseWeiDecimalString(params.value, "value");
45
47
  const chain = VIEM_CHAINS[params.chain_id];
46
48
  const chainConfig = chains[params.chain_id];
47
49
  if (!chainConfig) {
@@ -59,14 +61,14 @@ export function registerSendTool(server, chains) {
59
61
  const gasEstimate = await client.estimateGas({
60
62
  account: account.address,
61
63
  to: validTo,
62
- data: params.data,
63
- value: BigInt(params.value),
64
+ data: calldata,
65
+ value: valueWei,
64
66
  });
65
67
  const gasLimit = (gasEstimate * 120n) / 100n;
66
68
  const hash = await wallet.sendTransaction({
67
69
  to: validTo,
68
- data: params.data,
69
- value: BigInt(params.value),
70
+ data: calldata,
71
+ value: valueWei,
70
72
  gas: gasLimit,
71
73
  chain,
72
74
  });
@@ -62,7 +62,7 @@ export function registerAccountTools(server, api, chains) {
62
62
  idempotentHint: true,
63
63
  openWorldHint: true,
64
64
  },
65
- description: "Get full overview of an Arcadia account: health factor, collateral value, debt, deposited assets, liquidation price, and automation status. Health factor = 1 - (used_margin / liquidation_value): 1 = no debt (safest), >0 = healthy, 0 = liquidation threshold, <0 = past liquidation. Higher is safer. On all supported chains returns an `automation` object showing which asset managers are enabled (rebalancer, compounder, yield_claimer, merkl_operator, gas_relayer, cow_swapper). Automation detection spans every asset-manager version deployed on the selected chain, so registrations made on older versions are still reported as active; the returned value is the user-facing dex_protocol (e.g. 'slipstream') with no version suffix. LP positions in assets[] include a dex_protocol field (slipstream, slipstream_v2, slipstream_v3, staked_slipstream, staked_slipstream_v2, staked_slipstream_v3, uniV3, uniV4) — use this as the dex_protocol param for write.asset_manager.* tools. Slipstream V2 and V3 pools are Base-only; Unichain and Optimism support only Slipstream V1, uniV3, and uniV4. The automation object uses internal AM key names (slipstreamV1, slipstreamV2, slipstreamV3, uniV3, uniV4): map slipstreamV1 → 'slipstream'/'staked_slipstream', slipstreamV2 → 'slipstream_v2'/'staked_slipstream_v2', slipstreamV3 → 'slipstream_v3'/'staked_slipstream_v3', uniV3 → 'uniV3', uniV4 → 'uniV4'. Numeric fields without a _usd suffix are in the account's numeraire token raw units (divide by 10^decimals: 6 for USDC, 18 for WETH, 8 for cbBTC). Fields ending in _usd are in USD with 18 decimals (divide by 1e18). health_factor is unitless. Asset amounts are raw token units. To list all accounts for a wallet, use read.wallet.accounts.",
65
+ description: "Get full overview of an Arcadia account: health factor, collateral value, debt, deposited assets, liquidation price, and automation status. Health factor = 1 - (used_margin / liquidation_value): 1 = no debt (safest), >0 = healthy, 0 = liquidation threshold, <0 = past liquidation. Higher is safer. On all supported chains returns an `automation` object showing which asset managers are enabled (rebalancer, compounder, yield_claimer, merkl_operator, gas_relayer, cow_swapper). Automation detection spans every asset-manager version deployed on the selected chain, so registrations made on older versions are still reported as active; the returned value is the user-facing dex_protocol (e.g. 'slipstream') with no version suffix. LP positions in assets[] include a dex_protocol field (slipstream, slipstream_v2, slipstream_v3, staked_slipstream, staked_slipstream_v2, staked_slipstream_v3, uniV3, uniV4) — use this as the dex_protocol param for write.asset_manager.* tools. Slipstream V2 is Base-only. V3 is available on Base and Optimism. Unichain supports only Slipstream V1, uniV3, and uniV4. The automation object uses internal AM key names (slipstreamV1, slipstreamV2, slipstreamV3, uniV3, uniV4): map slipstreamV1 → 'slipstream'/'staked_slipstream', slipstreamV2 → 'slipstream_v2'/'staked_slipstream_v2', slipstreamV3 → 'slipstream_v3'/'staked_slipstream_v3', uniV3 → 'uniV3', uniV4 → 'uniV4'. Numeric fields without a _usd suffix are in the account's numeraire token raw units (divide by 10^decimals: 6 for USDC, 18 for WETH, 8 for cbBTC). Fields ending in _usd are in USD with 18 decimals (divide by 1e18). health_factor is unitless. Asset amounts are raw token units. To list all accounts for a wallet, use read.wallet.accounts.",
66
66
  inputSchema: {
67
67
  account_address: z.string().describe("Arcadia account address"),
68
68
  chain_id: z.number().default(8453).describe(CHAIN_ID_DESCRIPTION),
@@ -0,0 +1,37 @@
1
+ /** Listen port from PORT env. Throws at startup so a bad PORT does not silently break binding. */
2
+ export function parseListenPort(raw) {
3
+ const n = parseInt(raw ?? "3000", 10);
4
+ if (!Number.isFinite(n) || n < 1 || n > 65535) {
5
+ throw new Error(`Invalid PORT: "${raw ?? ""}". Expected an integer from 1 to 65535.`);
6
+ }
7
+ return n;
8
+ }
9
+ /** Max requests per minute from RATE_LIMIT_RPM. Warns and falls back to 60 on invalid input. */
10
+ export function parseRateLimitRpm(raw) {
11
+ const n = parseInt(raw ?? "60", 10);
12
+ if (!Number.isFinite(n) || n < 1) {
13
+ console.warn(`Invalid RATE_LIMIT_RPM "${raw ?? ""}", using default 60`);
14
+ return 60;
15
+ }
16
+ return Math.min(n, 1_000_000);
17
+ }
18
+ /** Enables Express req.ip when behind proxies. TRUST_PROXY: "1", "true", or a hop count ("2"). */
19
+ export function applyTrustProxyFromEnv(app, raw) {
20
+ const hops = parseTrustProxyHopCount(raw);
21
+ if (hops === undefined)
22
+ return;
23
+ app.set("trust proxy", hops);
24
+ }
25
+ export function parseTrustProxyHopCount(raw) {
26
+ if (!raw?.trim())
27
+ return undefined;
28
+ const t = raw.trim().toLowerCase();
29
+ if (t === "true" || t === "1" || t === "yes")
30
+ return 1;
31
+ const n = parseInt(raw, 10);
32
+ if (!Number.isFinite(n) || n < 1 || n > 32) {
33
+ console.warn(`Invalid TRUST_PROXY "${raw.trim()}". Expected 1–32 hops or true/1/yes. Rate limits will use socket IP only.`);
34
+ return undefined;
35
+ }
36
+ return n;
37
+ }
@@ -14,3 +14,19 @@ export function validateChainId(chainId) {
14
14
  }
15
15
  return chainId;
16
16
  }
17
+ /** ABI-encoded calldata: 0x plus pairs of hex digits (empty calldata is 0x). */
18
+ export function validateHexCalldata(data, label = "data") {
19
+ const d = data.trim();
20
+ if (!/^0x(?:[0-9a-fA-F]{2})*$/.test(d)) {
21
+ throw new Error(`Invalid ${label}: expected hex calldata starting with 0x and an even number of hex digits after the prefix.`);
22
+ }
23
+ return d;
24
+ }
25
+ /** Wei amount as a decimal string (avoids ambiguous BigInt() on partial hex). */
26
+ export function parseWeiDecimalString(s, label = "value") {
27
+ const t = s.trim();
28
+ if (!/^\d+$/.test(t)) {
29
+ throw new Error(`Invalid ${label}: expected a non-negative decimal wei string (digits only), e.g. "0" or "1000000000000000000".`);
30
+ }
31
+ return BigInt(t);
32
+ }
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.5",
4
+ "version": "0.4.6",
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.5",
6
+ "version": "0.4.6",
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.5",
16
+ "version": "0.4.6",
17
17
  "transport": {
18
18
  "type": "stdio"
19
19
  },
@@ -14,6 +14,8 @@ Arcadia is a platform for managing concentrated liquidity positions with automat
14
14
  - **Automation strategy config** (tick range, rebalance thresholds) is not currently settable via MCP — this requires Arcadia platform access.
15
15
  - **Health factor** = `1 - (used_margin / liquidation_value)`. Higher is safer. `1` = no debt, `>0` = healthy, `0` = liquidation threshold, `<0` = past liquidation. Keep above 0.5 for leveraged positions; act immediately below 0.2.
16
16
  - **Minimum margin** — each lending pool enforces a fixed minimum margin denominated in the pool's numeraire (e.g. WETH for the WETH pool, USDC for the USDC pool), typically a few dollars in value. This gets **added to the debt** when computing `used_margin` (i.e. `used_margin = open_debt + minimum_margin`). It ensures liquidations remain profitable (covering gas costs) and prevents dust attacks. For small positions the fixed minimum margin dominates the used margin, pushing health factor lower than the leverage ratio alone would suggest (e.g. HF ~0.3 at 2× leverage). Increase position size for a healthier starting HF. `write.account.add_liquidity` also validates deposits against per-asset minimum amounts from strategy risk factors.
17
+ - **`asset_id`** is always an integer (NFT token ID for LP positions, 0 for ERC20 tokens).
18
+ - **Wrapping ETH** — ETH must be wrapped to WETH before depositing. Call WETH's `deposit()` function (payable) with the ETH amount. No MCP tool for this, use your wallet.
17
19
 
18
20
  ## Transaction Signing
19
21
 
@@ -103,69 +105,92 @@ These tools batch multiple operations into ONE atomic transaction. Always prefer
103
105
  | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
104
106
  | `dev.send` | Sign and broadcast an unsigned transaction using a local private key. Pass the `{ to, data, value, chainId }` from any `write.*` tool. **Not for production** — use a dedicated wallet MCP server (Fireblocks, Safe, Turnkey, etc.) instead. |
105
107
 
106
- ## Token Addresses (Base 8453)
107
-
108
- | Token | Address | Decimals |
109
- | ----- | -------------------------------------------- | -------- |
110
- | WETH | `0x4200000000000000000000000000000000000006` | 18 |
111
- | USDC | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` | 6 |
112
- | cbBTC | `0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf` | 8 |
113
- | AERO | `0x940181a94A35A4569E4529A3CDfB74e38FD98631` | 18 |
114
- | AAA | `0xaaa843fb2916c0B57454270418E121C626402AAa` | 18 |
115
- | stAAA | `0xDeA1531d8a1505785eb517C7A28526443df223F3` | 18 |
116
-
117
- **Wrapping ETH:** ETH must be wrapped to WETH before depositing. Call WETH's `deposit()` function (payable) with the ETH amount. No MCP tool for this — use your wallet.
118
-
119
- ## Contract Addresses (Base 8453)
108
+ ## Shared Addresses
120
109
 
121
110
  | Contract | Address |
122
111
  | -------- | -------------------------------------------- |
123
112
  | Factory | `0xDa14Fdd72345c4d2511357214c5B89A919768e59` |
124
113
 
125
- **`asset_id`** is always an integer (NFT token ID for LP positions, 0 for ERC20 tokens).
126
-
127
- ## Lending Pool Addresses (Base 8453)
114
+ ### Lending Pools
128
115
 
129
- Use as `pool_address` in `write.account.borrow` / `write.account.repay`, as `creditor` in `write.account.create` / `write.account.deleverage`:
116
+ Use as `pool_address` in `write.account.borrow` / `write.account.repay`, as `creditor` in `write.account.create` / `write.account.deleverage`. Same CREATE2 addresses on Base and Optimism. Unichain has no lending pools.
130
117
 
131
- | Asset | Pool Address |
132
- | ----- | -------------------------------------------- |
133
- | WETH | `0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2` |
134
- | USDC | `0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1` |
135
- | cbBTC | `0xa37E9b4369dc20940009030BfbC2088F09645e3B` |
118
+ | Asset | Pool Address | Chains |
119
+ | ----- | -------------------------------------------- | -------------- |
120
+ | WETH | `0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2` | Base, Optimism |
121
+ | USDC | `0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1` | Base, Optimism |
122
+ | cbBTC | `0xa37E9b4369dc20940009030BfbC2088F09645e3B` | Base only |
136
123
 
137
- ## Asset Manager Addresses
124
+ ### Asset Manager Addresses
138
125
 
139
126
  Addresses are auto-resolved by `write.asset_manager.*` intent tools based on `dex_protocol`, targeting the latest deployed version on the selected chain. Listed here for reference. All require V3/V4 accounts. Older asset-manager versions remain on-chain for users who registered before the latest version shipped; `read.account.info` detects active registrations across every deployed version and reports the dex_protocol with no version suffix.
140
127
 
141
- | Type | Protocol | Address |
142
- | -------------- | ------------- | -------------------------------------------- |
143
- | Rebalancer | Slipstream V1 | `0x5802454749cc0c4A6F28D5001B4cD84432e2b79F` |
144
- | Rebalancer | Slipstream V2 | `0x953Ff365d0b562ceC658dc46B394E9282338d9Ea` |
145
- | Rebalancer | Slipstream V3 | `0x37c6258aEe125d520B6f03fc2cb490955050D557` |
146
- | Rebalancer | Uniswap V3 | `0xbA1D0c99c261F94b9C8b52465890Cca27dd993Bd` |
147
- | Rebalancer | Uniswap V4 | `0x01EDaF0067a10D18c88D2876c0A85Ee0096a5Ac0` |
148
- | Compounder | Slipstream V1 | `0x467837f44A71e3eAB90AEcfC995c84DC6B3cfCF7` |
149
- | Compounder | Slipstream V2 | `0x35e59448C7145482E56212510cC689612AB4F61f` |
150
- | Compounder | Slipstream V3 | `0xd42A3Ac56456bD5422835B36C35Cacb6448ddCd9` |
151
- | Compounder | Uniswap V3 | `0x02e1fa043214E51eDf1F0478c6D0d3D5658a2DC3` |
152
- | Compounder | Uniswap V4 | `0xAA95c9c402b195D8690eCaea2341a76e3266B189` |
153
- | Yield Claimer | Slipstream V1 | `0x5a8278D37b7a787574b6Aa7E18d8C02D994f18Ba` |
154
- | Yield Claimer | Slipstream V2 | `0xc8bF4B2c740FF665864E9494832520f18822871C` |
155
- | Yield Claimer | Slipstream V3 | `0x8c1Fbf38118fD5A704b6E7babcB7AF1a9A291980` |
156
- | Yield Claimer | Uniswap V3 | `0x75Ed28EA8601Ce9F5FbcAB1c2428f04A57aFaA16` |
157
- | Yield Claimer | Uniswap V4 | `0xD8aa21AB7f9B8601CB7d7A776D3AFA1602d5D8D4` |
158
- | Merkl Operator | All | `0x969F0251360b9Cf11c68f6Ce9587924c1B8b42C6` |
159
- | CoW Swapper | Base only | `0xFfC742E68D41389BE9Ef1aFD518F036064DA2Bb6` |
160
- | Gas Relayer | All | `0xD938C8d04cF91094fecAF0A2018EAac483a40137` |
161
-
162
- The addresses above are deployed deterministically and apply to every chain where the protocol exists. Slipstream V2 and V3 are not deployed on Unichain or Optimism, so only the Slipstream V1, Uniswap V3, and Uniswap V4 rows apply there. CoW Swapper is Base-only as noted in the table.
163
-
164
- **Slipstream V1 vs V2 vs V3:** The pool determines the version — each pool is bound to a specific Slipstream version. `read.account.info` returns a `dex_protocol` field on LP positions (derived from the position manager address), so you can read the protocol directly from the account overview. Pass this value (`slipstream`, `slipstream_v2`, `slipstream_v3`, or their `staked_*` variants) as `dex_protocol` to `write.asset_manager.*` intent tools to auto-resolve the correct AM address.
165
-
166
- ## Token, Contract, and Lending Pool Addresses (Optimism 10)
167
-
168
- On Optimism, only Slipstream V1 (Velodrome), Uniswap V3, and Uniswap V4 are supported. No cbBTC pool, no CoW Swap.
128
+ Standalone AMs (not tied to a DEX protocol, same address on all supported chains):
129
+
130
+ | Type | Address | Chains |
131
+ | -------------- | -------------------------------------------- | ------------------------ |
132
+ | Merkl Operator | `0x969F0251360b9Cf11c68f6Ce9587924c1B8b42C6` | Base, Optimism, Unichain |
133
+ | Gas Relayer | `0xD938C8d04cF91094fecAF0A2018EAac483a40137` | Base, Optimism, Unichain |
134
+ | CoW Swapper | `0xFfC742E68D41389BE9Ef1aFD518F036064DA2Bb6` | Base only |
135
+
136
+ Protocol-specific AMs (rebalancer, compounder, yield claimer). Slipstream V2 is Base-only. All other addresses apply to every chain where the protocol exists:
137
+
138
+ | Type | Protocol | Address |
139
+ | ------------- | ------------- | -------------------------------------------- |
140
+ | Rebalancer | Slipstream V1 | `0x5802454749cc0c4A6F28D5001B4cD84432e2b79F` |
141
+ | Rebalancer | Slipstream V2 | `0x953Ff365d0b562ceC658dc46B394E9282338d9Ea` |
142
+ | Rebalancer | Slipstream V3 | `0x37c6258aEe125d520B6f03fc2cb490955050D557` |
143
+ | Rebalancer | Uniswap V3 | `0xbA1D0c99c261F94b9C8b52465890Cca27dd993Bd` |
144
+ | Rebalancer | Uniswap V4 | `0x01EDaF0067a10D18c88D2876c0A85Ee0096a5Ac0` |
145
+ | Compounder | Slipstream V1 | `0x467837f44A71e3eAB90AEcfC995c84DC6B3cfCF7` |
146
+ | Compounder | Slipstream V2 | `0x35e59448C7145482E56212510cC689612AB4F61f` |
147
+ | Compounder | Slipstream V3 | `0xd42A3Ac56456bD5422835B36C35Cacb6448ddCd9` |
148
+ | Compounder | Uniswap V3 | `0x02e1fa043214E51eDf1F0478c6D0d3D5658a2DC3` |
149
+ | Compounder | Uniswap V4 | `0xAA95c9c402b195D8690eCaea2341a76e3266B189` |
150
+ | Yield Claimer | Slipstream V1 | `0x5a8278D37b7a787574b6Aa7E18d8C02D994f18Ba` |
151
+ | Yield Claimer | Slipstream V2 | `0xc8bF4B2c740FF665864E9494832520f18822871C` |
152
+ | Yield Claimer | Slipstream V3 | `0x8c1Fbf38118fD5A704b6E7babcB7AF1a9A291980` |
153
+ | Yield Claimer | Uniswap V3 | `0x75Ed28EA8601Ce9F5FbcAB1c2428f04A57aFaA16` |
154
+ | Yield Claimer | Uniswap V4 | `0xD8aa21AB7f9B8601CB7d7A776D3AFA1602d5D8D4` |
155
+
156
+ Slipstream V3 on Optimism uses different addresses (exception to the deterministic deployment pattern):
157
+
158
+ | Type | Address (Optimism) |
159
+ | ------------- | -------------------------------------------- |
160
+ | Rebalancer | `0x33442fC10a20Aad0ddD73F6ae24500F5B370DC51` |
161
+ | Compounder | `0x3e7b6997399eC402491c4A049e4CD727d3aA1738` |
162
+ | Yield Claimer | `0x3630bDb1Ac7cF8A435411391db75450350814F42` |
163
+
164
+ **Slipstream V1 vs V2 vs V3:** The pool determines the version, each pool is bound to a specific Slipstream version. `read.account.info` returns a `dex_protocol` field on LP positions (derived from the position manager address), so you can read the protocol directly from the account overview. Pass this value (`slipstream`, `slipstream_v2`, `slipstream_v3`, or their `staked_*` variants) as `dex_protocol` to `write.asset_manager.*` intent tools to auto-resolve the correct AM address.
165
+
166
+ ## Account Versions
167
+
168
+ Spot vs margin is determined by whether a **creditor** (lending pool) is set at account creation, not by version number.
169
+
170
+ - `account_version: 3` — **margin account** (created with a `creditor`). Can borrow, leverage, and mint LP. Uses an onchain whitelist of allowed collateral tokens.
171
+ - `account_version: 4` or `0` (latest) — **spot account** (no creditor, no borrowing). Can hold assets and mint LP with `leverage: 0`. Accepts any ERC20 (no onchain whitelist).
172
+ - `account_version: 1` or `2` — legacy. Not supported by current MCP tools (`write.asset_manager.*` and `write.account.set_asset_managers` require V3/V4).
173
+ - For **leveraged LP strategies**, use `account_version: 3` with a creditor.
174
+ - To check an existing account's version: call `read.account.info` — the response includes the account version.
175
+
176
+ ## Chain-Specific Addresses
177
+
178
+ ### Base (8453)
179
+
180
+ Protocols: Slipstream V1, Slipstream V2, Slipstream V3, Uniswap V3, Uniswap V4.
181
+
182
+ | Token | Address | Decimals |
183
+ | ----- | -------------------------------------------- | -------- |
184
+ | WETH | `0x4200000000000000000000000000000000000006` | 18 |
185
+ | USDC | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` | 6 |
186
+ | cbBTC | `0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf` | 8 |
187
+ | AERO | `0x940181a94A35A4569E4529A3CDfB74e38FD98631` | 18 |
188
+ | AAA | `0xaaa843fb2916c0B57454270418E121C626402AAa` | 18 |
189
+ | stAAA | `0xDeA1531d8a1505785eb517C7A28526443df223F3` | 18 |
190
+
191
+ ### Optimism (10)
192
+
193
+ Protocols: Slipstream V1 (Velodrome), Slipstream V3, Uniswap V3, Uniswap V4. No Slipstream V2, no cbBTC pool.
169
194
 
170
195
  | Token | Address | Decimals |
171
196
  | ------ | -------------------------------------------- | -------- |
@@ -176,24 +201,17 @@ On Optimism, only Slipstream V1 (Velodrome), Uniswap V3, and Uniswap V4 are supp
176
201
  | WBTC | `0x68f180fcCe6836688e9084f035309E29Bf0A2095` | 8 |
177
202
  | wstETH | `0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb` | 18 |
178
203
 
179
- Lending pools (same CREATE2 addresses as Base):
180
-
181
- | Asset | Pool Address |
182
- | ----- | -------------------------------------------- |
183
- | WETH | `0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2` |
184
- | USDC | `0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1` |
204
+ ### Unichain (130)
185
205
 
186
- Available automations on Optimism: rebalancer, compounder, yield_claimer, merkl_operator. `cow_swapper`, `compounder_staked`, and `yield_claimer_cowswap` are Base-only (CoW Swap is not deployed on Optimism).
206
+ Protocols: Slipstream V1, Uniswap V3, Uniswap V4. No Slipstream V2/V3. No lending pools.
187
207
 
188
- ## Account Versions
189
-
190
- Spot vs margin is determined by whether a **creditor** (lending pool) is set at account creation, not by version number.
191
-
192
- - `account_version: 3` — **margin account** (created with a `creditor`). Can borrow, leverage, and mint LP. Uses an onchain whitelist of allowed collateral tokens.
193
- - `account_version: 4` or `0` (latest) — **spot account** (no creditor, no borrowing). Can hold assets and mint LP with `leverage: 0`. Accepts any ERC20 (no onchain whitelist).
194
- - `account_version: 1` or `2` — legacy. Not supported by current MCP tools (`write.asset_manager.*` and `write.account.set_asset_managers` require V3/V4).
195
- - For **leveraged LP strategies**, use `account_version: 3` with a creditor.
196
- - To check an existing account's version: call `read.account.info` — the response includes the account version.
208
+ | Token | Address | Decimals |
209
+ | ----- | -------------------------------------------- | -------- |
210
+ | WETH | `0x4200000000000000000000000000000000000006` | 18 |
211
+ | USDC | `0x078D782b760474a361dDA0AF3839290b0EF57AD6` | 6 |
212
+ | WBTC | `0x0555E30da8f98308EdB960aa94C0Db47230d2B9c` | 8 |
213
+ | UNI | `0x8f187aA05619a017077f5308904739877ce9eA21` | 18 |
214
+ | VELO | `0x7f9AdFbd38b669F03d1d11000Bc76b9AaEA28A81` | 18 |
197
215
 
198
216
  ## Reference Files
199
217
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: arcadia-finance
3
- version: 1.1.2
3
+ version: 1.1.3
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:
@@ -2,7 +2,7 @@
2
2
 
3
3
  Supported chains: Base (8453), Unichain (130), Optimism (10).
4
4
 
5
- ## Protocol (same on all chains)
5
+ ## Shared Addresses
6
6
 
7
7
  | Contract | Address |
8
8
  | ---------- | ------------------------------------------ |
@@ -10,22 +10,29 @@ Supported chains: Base (8453), Unichain (130), Optimism (10).
10
10
  | Registry | 0xd0690557600eb8Be8391D1d97346e2aab5300d5f |
11
11
  | Liquidator | 0xA4B0b9fD1d91fA2De44F6ABFd59cC14bA1E1a7Af |
12
12
 
13
- ## Lending Pools (Base)
13
+ Lending pools (same CREATE2 addresses on Base and Optimism, Unichain has none):
14
14
 
15
- | Pool | Address |
16
- | -------- | ------------------------------------------ |
17
- | LP_WETH | 0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2 |
18
- | LP_USDC | 0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1 |
19
- | LP_CBBTC | 0xa37E9b4369dc20940009030BfbC2088F09645e3B |
15
+ | Pool | Address | Chains |
16
+ | -------- | ------------------------------------------ | -------------- |
17
+ | LP_WETH | 0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2 | Base, Optimism |
18
+ | LP_USDC | 0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1 | Base, Optimism |
19
+ | LP_CBBTC | 0xa37E9b4369dc20940009030BfbC2088F09645e3B | Base only |
20
20
 
21
- ## Lending Pools (Optimism)
21
+ ## Asset Managers
22
+
23
+ Rebalancers, compounders, and yield claimers are deployed per DEX protocol. Most share the same address on every chain.
24
+
25
+ Protocol availability per chain:
26
+
27
+ - **Base**: Slipstream V1, V2, V3, Uniswap V3, V4, CoW Swap
28
+ - **Optimism**: Slipstream V1, V3, Uniswap V3, V4 (no V2, no CoW Swap). V3 uses different AM addresses than Base (exception to the deterministic deployment pattern).
29
+ - **Unichain**: Slipstream V1, Uniswap V3, V4 (no V2/V3, no CoW Swap)
30
+
31
+ Use `read.asset_manager.intents` to discover available automations and their addresses per chain.
22
32
 
23
- | Pool | Address |
24
- | ------- | ------------------------------------------ |
25
- | LP_WETH | 0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2 |
26
- | LP_USDC | 0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1 |
33
+ ## Chain-Specific Tokens
27
34
 
28
- ## Key Tokens (Base)
35
+ ### Base (8453)
29
36
 
30
37
  | Token | Address | Decimals |
31
38
  | ----- | ------------------------------------------ | -------- |
@@ -34,7 +41,7 @@ Supported chains: Base (8453), Unichain (130), Optimism (10).
34
41
  | cbBTC | 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf | 8 |
35
42
  | AERO | 0x940181a94A35A4569E4529A3CDfB74e38FD98631 | 18 |
36
43
 
37
- ## Key Tokens (Optimism)
44
+ ### Optimism (10)
38
45
 
39
46
  | Token | Address | Decimals |
40
47
  | ------ | ------------------------------------------ | -------- |
@@ -45,6 +52,12 @@ Supported chains: Base (8453), Unichain (130), Optimism (10).
45
52
  | WBTC | 0x68f180fcCe6836688e9084f035309E29Bf0A2095 | 8 |
46
53
  | wstETH | 0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb | 18 |
47
54
 
48
- ## Asset Managers
55
+ ### Unichain (130)
49
56
 
50
- Rebalancers, compounders, and yield claimers are deployed per DEX protocol and share the same address on every chain where the protocol exists. Slipstream V2 and V3 are Base-only; Unichain and Optimism support Slipstream V1, Uniswap V3, and Uniswap V4. CoW Swap is Base-only. Use `read.asset_manager.intents` to discover available automations and their addresses per chain.
57
+ | Token | Address | Decimals |
58
+ | ----- | ------------------------------------------ | -------- |
59
+ | WETH | 0x4200000000000000000000000000000000000006 | 18 |
60
+ | USDC | 0x078D782b760474a361dDA0AF3839290b0EF57AD6 | 6 |
61
+ | WBTC | 0x0555E30da8f98308EdB960aa94C0Db47230d2B9c | 8 |
62
+ | UNI | 0x8f187aA05619a017077f5308904739877ce9eA21 | 18 |
63
+ | VELO | 0x7f9AdFbd38b669F03d1d11000Bc76b9AaEA28A81 | 18 |