@arcadia-finance/mcp-server 0.1.5 → 0.2.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.
@@ -4,7 +4,7 @@ import { accountAbi } from "../../abis/index.js";
4
4
  import { appendDataSuffix } from "../../utils/attribution.js";
5
5
  import { validateAddress } from "../../utils/validation.js";
6
6
  export function registerSetAssetManagerTool(server, _chains) {
7
- server.registerTool("build_set_asset_manager_tx", {
7
+ server.registerTool("write.set_asset_manager", {
8
8
  annotations: {
9
9
  title: "Build Set Asset Manager Transaction",
10
10
  readOnlyHint: false,
@@ -12,7 +12,7 @@ export function registerSetAssetManagerTool(server, _chains) {
12
12
  idempotentHint: true,
13
13
  openWorldHint: false,
14
14
  },
15
- description: "Build an unsigned transaction to grant or revoke an asset manager's permission on an Arcadia V3/V4 account via setAssetManagers. This ONLY toggles the permission flag — it does NOT configure initiator, fees, or strategy parameters. For full setup (enable + configure in one tx), use build_configure_asset_manager_tx instead. For asset manager addresses, call get_guide('automation'). Returns { transaction: { to, data, value, chainId } }.",
15
+ description: "Build an unsigned transaction to grant or revoke an asset manager's permission on an Arcadia V3/V4 account via setAssetManagers. This ONLY toggles the permission flag — it does NOT configure initiator, fees, or strategy parameters. For full setup (enable + configure in one tx), use write.configure_asset_manager instead. For asset manager addresses, call read.guide('automation'). Returns { transaction: { to, data, value, chainId } }.",
16
16
  inputSchema: {
17
17
  account_address: z.string().describe("Arcadia account address (V3 or V4)"),
18
18
  asset_manager_address: z
@@ -8,7 +8,7 @@ const VIEM_CHAINS = {
8
8
  130: unichain,
9
9
  };
10
10
  export function registerSignAndSendTool(server, chains) {
11
- server.registerTool("sign_and_send_tx", {
11
+ server.registerTool("dev.sign_and_send", {
12
12
  annotations: {
13
13
  title: "Sign and Send Transaction",
14
14
  readOnlyHint: false,
@@ -16,7 +16,7 @@ export function registerSignAndSendTool(server, chains) {
16
16
  idempotentHint: false,
17
17
  openWorldHint: true,
18
18
  },
19
- description: "DEV ONLY — Sign and broadcast an unsigned transaction using a local private key (PK env var). For production, use a dedicated wallet MCP server (Fireblocks, Safe, Turnkey, etc.) instead of this tool. Takes the transaction object returned by any build_*_tx tool and submits it onchain.",
19
+ description: "DEV ONLY — Sign and broadcast an unsigned transaction using a local private key (PK env var). For production, use a dedicated wallet MCP server (Fireblocks, Safe, Turnkey, etc.) instead of this tool. Takes the transaction object returned by any write.* or advanced.* tool and submits it onchain.",
20
20
  inputSchema: {
21
21
  to: z.string().describe("Target contract address"),
22
22
  data: z.string().describe("Encoded calldata (hex)"),
@@ -5,7 +5,7 @@ import { getPublicClient } from "../../clients/chain.js";
5
5
  import { appendDataSuffix } from "../../utils/attribution.js";
6
6
  import { validateAddress, validateChainId } from "../../utils/validation.js";
7
7
  export function registerWithdrawTool(server, chains) {
8
- server.registerTool("build_withdraw_tx", {
8
+ server.registerTool("write.withdraw", {
9
9
  annotations: {
10
10
  title: "Build Withdraw Transaction",
11
11
  readOnlyHint: false,
@@ -13,7 +13,7 @@ export function registerWithdrawTool(server, chains) {
13
13
  idempotentHint: true,
14
14
  openWorldHint: false,
15
15
  },
16
- description: "Build an unsigned transaction to withdraw assets from an Arcadia account to the owner's wallet. Only the account owner can withdraw. Will revert if the account has debt and withdrawal would make it undercollateralized. Does not support max_uint256 — pass exact amounts from get_account_info. Account version is auto-detected on-chain (override with account_version if needed).",
16
+ description: "Build an unsigned transaction to withdraw assets from an Arcadia account to the owner's wallet. Only the account owner can withdraw. Will revert if the account has debt and withdrawal would make it undercollateralized. Does not support max_uint256 — pass exact amounts from read.account_info. Account version is auto-detected on-chain (override with account_version if needed).",
17
17
  inputSchema: {
18
18
  account_address: z.string().describe("Arcadia account address"),
19
19
  asset_addresses: z.array(z.string()).describe("Token contract addresses to withdraw"),
@@ -39,7 +39,7 @@ export function registerWithdrawTool(server, chains) {
39
39
  content: [
40
40
  {
41
41
  type: "text",
42
- text: 'Error: build_withdraw_tx does not support "max_uint256". Pass exact amounts from get_account_info.',
42
+ text: 'Error: write.withdraw does not support "max_uint256". Pass exact amounts from read.account_info.',
43
43
  },
44
44
  ],
45
45
  isError: true,
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.1.5",
4
+ "version": "0.2.0",
5
5
  "description": "MCP server for Arcadia Finance. Manage concentrated liquidity positions with leverage, automated rebalancing, and yield optimization on Base, Optimism, and Unichain.",
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": "Manage Uniswap and Aerodrome liquidity positions with automated rebalancing and leverage.",
6
- "version": "0.1.5",
6
+ "version": "0.2.0",
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.1.5",
16
+ "version": "0.2.0",
17
17
  "transport": {
18
18
  "type": "stdio"
19
19
  },
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: clamm-liquidity
3
3
  description: Agent guide for clAMM management on Arcadia Finance. Covers 25 MCP tools (+1 dev), automation setup (rebalancers, compounders, yield claimers, Merkl, CoW swapper), strategy selection framework, and strategy templates including delta neutral leveraged LP and protocol-owned liquidity.
4
- user-invokable: true
4
+ user-invocable: true
5
5
  ---
6
6
 
7
7
  # Arcadia Finance — clAMM Agent Guide
@@ -10,14 +10,14 @@ Arcadia is a platform for managing concentrated liquidity positions — with bui
10
10
 
11
11
  ## Key Constraints
12
12
 
13
- - **All `build_*_tx` tools return unsigned transactions** (`{ to, data, value, chainId }`) — you must sign and broadcast them. See "Transaction Signing" below.
13
+ - **All `write.*` and `advanced.*` tools return unsigned transactions** (`{ to, data, value, chainId }`) — you must sign and broadcast them. See "Transaction Signing" below.
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
- - **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. `build_add_liquidity_tx` also validates deposits against per-asset minimum amounts from strategy risk factors.
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. `advanced.add_liquidity` also validates deposits against per-asset minimum amounts from strategy risk factors.
17
17
 
18
18
  ## Transaction Signing
19
19
 
20
- Write and advanced tools (`build_*_tx`) return unsigned transaction calldata. This server does NOT sign or broadcast. After receiving a transaction object, you must:
20
+ Write and advanced tools (`write.*` / `advanced.*`) return unsigned transaction calldata. This server does NOT sign or broadcast. After receiving a transaction object, you must:
21
21
 
22
22
  1. **Sign** the transaction with the account owner's private key or wallet
23
23
  2. **Broadcast** it to the appropriate chain (Base 8453, Optimism 10, or Unichain 130)
@@ -28,7 +28,7 @@ How you sign depends on your setup:
28
28
  - **MPC wallet** (Fireblocks, Dfns, Turnkey) — pass the unsigned tx to your provider's signing API
29
29
  - **Smart account** (Safe, Biconomy) — wrap the tx as a UserOperation or Safe transaction
30
30
  - **Embedded wallet** (Privy, Dynamic) — use the provider's `sendTransaction` method
31
- - **Direct private key** (development only) — use the built-in `sign_and_send_tx` tool (set `PK` in a `.env` file or MCP client config), or viem/ethers `sendTransaction` with a local signer
31
+ - **Direct private key** (development only) — use the built-in `dev.sign_and_send` tool (set `PK` in a `.env` file or MCP client config), or viem/ethers `sendTransaction` with a local signer
32
32
 
33
33
  Example with viem:
34
34
 
@@ -49,51 +49,51 @@ Arcadia's flash-action tools can batch multiple DeFi operations into a single at
49
49
 
50
50
  ### Read Tools
51
51
 
52
- | Tool | When to use |
53
- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54
- | `get_account_info` | Account overview + liquidation price. Pass `account_address` for detail (returns positions with `asset_address`/`asset_id`, collateral, debt) or `wallet_address` to list accounts. |
55
- | `get_account_history` | Historical account value over time. Optional `days` param (default 14). |
56
- | `get_account_pnl` | PnL and yield earned — use to check if a strategy is still profitable. |
57
- | `get_assets` | Supported collateral assets with prices. Pass `asset_addresses` (single or comma-separated) for price lookup. |
58
- | `get_wallet_balances` | On-chain ERC20 balances and native ETH for a wallet. Use to pre-check if the wallet has enough tokens before depositing or adding liquidity. |
59
- | `get_allowance` | Check ERC20 token allowances for a spender. Use before `build_approve_tx` to avoid redundant approvals — skip if the current allowance is already sufficient. |
60
- | `get_lending_pools` | Pool TVL, APY, utilization, liquidity. Pass `pool_address` for detail + APY history (optional `days`, default 14). |
61
- | `get_strategies` | LP strategies with fee APY, underlyings, pool protocol. List view shows 7d avg APY for the strategy's default range (e.g. ±7.5% for volatile pairs). **Pass `strategy_id` to see APY per range width** (very_narrow → full_range) — narrower range = higher APY but more rebalancing cost/risk. Use `featured_only: true` for curated top strategies. |
62
- | `get_points` | Points for a wallet or leaderboard. No `chain_id` needed — points are cross-chain. |
63
- | `get_recommendation` | Rebalancing recommendation for an account. Uses 1d APY (not 7d like `get_strategies`), so numbers may differ. |
64
- | `get_guide` | Reference guides: `automation` (AM setup), `selection` (pool evaluation), `strategies` (step-by-step templates). |
52
+ | Tool | When to use |
53
+ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54
+ | `read.account_info` | Account overview + liquidation price. Pass `account_address` for detail (returns positions with `asset_address`/`asset_id`, collateral, debt) or `wallet_address` to list accounts. |
55
+ | `read.account_history` | Historical account value over time. Optional `days` param (default 14). |
56
+ | `read.account_pnl` | PnL and yield earned — use to check if a strategy is still profitable. |
57
+ | `read.assets` | Supported collateral assets with prices. Pass `asset_addresses` (single or comma-separated) for price lookup. |
58
+ | `read.wallet_balances` | On-chain ERC20 balances and native ETH for a wallet. Use to pre-check if the wallet has enough tokens before depositing or adding liquidity. |
59
+ | `read.allowance` | Check ERC20 token allowances for a spender. Use before `write.approve` to avoid redundant approvals — skip if the current allowance is already sufficient. |
60
+ | `read.lending_pools` | Pool TVL, APY, utilization, liquidity. Pass `pool_address` for detail + APY history (optional `days`, default 14). |
61
+ | `read.strategies` | LP strategies with fee APY, underlyings, pool protocol. List view shows 7d avg APY for the strategy's default range (e.g. ±7.5% for volatile pairs). **Pass `strategy_id` to see APY per range width** (very_narrow → full_range) — narrower range = higher APY but more rebalancing cost/risk. Use `featured_only: true` for curated top strategies. |
62
+ | `read.points` | Points for a wallet or leaderboard. No `chain_id` needed — points are cross-chain. |
63
+ | `read.recommendation` | Rebalancing recommendation for an account. Uses 1d APY (not 7d like `read.strategies`), so numbers may differ. |
64
+ | `read.guide` | Reference guides: `automation` (AM setup), `selection` (pool evaluation), `strategies` (step-by-step templates). |
65
65
 
66
66
  ### Preferred Write Tools (atomic/multi-step — use these first)
67
67
 
68
68
  These tools batch multiple operations into ONE atomic transaction. Always prefer these over individual tools.
69
69
 
70
- | Tool | Batches | When to use |
71
- | ---------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
72
- | `build_add_liquidity_tx` | deposit + swap + mint LP + optional borrow | Open LP position. Do NOT call `build_deposit_tx` separately — this handles wallet transfer atomically. |
73
- | `build_close_position_tx` | burn LP + swap + repay debt (up to 3 steps) | Close/exit a position. ALWAYS try this first. Tokens stay in account — follow up with `build_withdraw_tx`. |
74
- | `build_repay_with_collateral_tx` | swap collateral + repay debt | Repay debt using account collateral (no wallet tokens needed). Preferred for health factor fixes. |
75
- | `build_configure_asset_manager_tx` | grant permission + set initiator/fees/strategy params | Enable AND configure an automation (rebalancer, compounder, yield claimer, merkl) in one transaction. |
70
+ | Tool | Batches | When to use |
71
+ | -------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
72
+ | `advanced.add_liquidity` | deposit + swap + mint LP + optional borrow | Open LP position. Do NOT call `write.deposit` separately — this handles wallet transfer atomically. |
73
+ | `advanced.close_position` | burn LP + swap + repay debt (up to 3 steps) | Close/exit a position. ALWAYS try this first. Tokens stay in account — follow up with `write.withdraw`. |
74
+ | `advanced.repay_with_collateral` | swap collateral + repay debt | Repay debt using account collateral (no wallet tokens needed). Preferred for health factor fixes. |
75
+ | `write.configure_asset_manager` | grant permission + set initiator/fees/strategy params | Enable AND configure an automation (rebalancer, compounder, yield claimer, merkl) in one transaction. |
76
76
 
77
77
  ### Individual Write Tools (use when batched tools fail or for standalone operations)
78
78
 
79
- | Tool | When to use |
80
- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
81
- | `build_approve_tx` | Approve a token for spending. **Required before `build_deposit_tx`** and before `build_add_liquidity_tx` (when depositing from wallet). Call `get_allowance` first to check if already approved. |
82
- | `build_create_account_tx` | Create a new Arcadia account (one-time setup). Use `account_version: 0` for the latest version (recommended). |
83
- | `build_deposit_tx` | Deposit ERC20 tokens as collateral. NOT needed before `build_add_liquidity_tx` — that tool handles deposits atomically. |
84
- | `build_withdraw_tx` | Withdraw assets to account owner. Account version auto-detected on-chain. Params: `asset_addresses[]`, `asset_amounts[]` (exact amounts, no max_uint256), optional `asset_ids[]` (0 for ERC20). |
85
- | `build_borrow_tx` | Borrow from a lending pool. NOT needed for leveraged LP — `build_add_liquidity_tx` handles borrowing internally. |
86
- | `build_repay_tx` | Repay debt from wallet (approve pool first). Use `amount: "max_uint256"` to repay in full. For repaying with account collateral, prefer `build_repay_with_collateral_tx`. |
87
- | `build_swap_tx` | Swap assets within account (backend handles routing). For closing positions, prefer `build_close_position_tx`. |
88
- | `build_remove_liquidity_tx` | PARTIAL liquidity decrease only (position stays open). For full LP removal/exit, use `build_close_position_tx`. |
89
- | `build_position_action_tx` | Stake, unstake, or claim rewards for an LP position. Direction auto-detected from `asset_address`. |
90
- | `build_set_asset_manager_tx` | Grant/revoke AM permission only (no configuration). Use to revoke; for full setup prefer `build_configure_asset_manager_tx`. |
79
+ | Tool | When to use |
80
+ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
81
+ | `write.approve` | Approve a token for spending. **Required before `write.deposit`** and before `advanced.add_liquidity` (when depositing from wallet). Call `read.allowance` first to check if already approved. |
82
+ | `write.create_account` | Create a new Arcadia account (one-time setup). Use `account_version: 0` for the latest version (recommended). |
83
+ | `write.deposit` | Deposit ERC20 tokens as collateral. NOT needed before `advanced.add_liquidity` — that tool handles deposits atomically. |
84
+ | `write.withdraw` | Withdraw assets to account owner. Account version auto-detected on-chain. Params: `asset_addresses[]`, `asset_amounts[]` (exact amounts, no max_uint256), optional `asset_ids[]` (0 for ERC20). |
85
+ | `write.borrow` | Borrow from a lending pool. NOT needed for leveraged LP — `advanced.add_liquidity` handles borrowing internally. |
86
+ | `write.repay` | Repay debt from wallet (approve pool first). Use `amount: "max_uint256"` to repay in full. For repaying with account collateral, prefer `advanced.repay_with_collateral`. |
87
+ | `advanced.swap` | Swap assets within account (backend handles routing). For closing positions, prefer `advanced.close_position`. |
88
+ | `advanced.remove_liquidity` | PARTIAL liquidity decrease only (position stays open). For full LP removal/exit, use `advanced.close_position`. |
89
+ | `advanced.position_action` | Stake, unstake, or claim rewards for an LP position. Direction auto-detected from `asset_address`. |
90
+ | `write.set_asset_manager` | Grant/revoke AM permission only (no configuration). Use to revoke; for full setup prefer `write.configure_asset_manager`. |
91
91
 
92
92
  ### Dev Tools (only available when `PK` env var is set)
93
93
 
94
- | Tool | When to use |
95
- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
96
- | `sign_and_send_tx` | Sign and broadcast an unsigned transaction using a local private key. Pass the `{ to, data, value, chainId }` from any `build_*_tx` tool. **Not for production** — use a dedicated wallet MCP server (Fireblocks, Safe, Turnkey, etc.) instead. |
94
+ | Tool | When to use |
95
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
96
+ | `dev.sign_and_send` | Sign and broadcast an unsigned transaction using a local private key. Pass the `{ to, data, value, chainId }` from any `write.*` or `advanced.*` tool. **Not for production** — use a dedicated wallet MCP server (Fireblocks, Safe, Turnkey, etc.) instead. |
97
97
 
98
98
  ## Token Addresses (Base 8453)
99
99
 
@@ -118,7 +118,7 @@ These tools batch multiple operations into ONE atomic transaction. Always prefer
118
118
 
119
119
  ## Lending Pool Addresses (Base 8453)
120
120
 
121
- Use as `pool_address` in `build_borrow_tx` / `build_repay_tx`, as `creditor` in `build_create_account_tx` / `build_repay_with_collateral_tx`:
121
+ Use as `pool_address` in `write.borrow` / `write.repay`, as `creditor` in `write.create_account` / `advanced.repay_with_collateral`:
122
122
 
123
123
  | Asset | Pool Address |
124
124
  | ----- | -------------------------------------------- |
@@ -128,7 +128,7 @@ Use as `pool_address` in `build_borrow_tx` / `build_repay_tx`, as `creditor` in
128
128
 
129
129
  ## Asset Manager Addresses (Base 8453)
130
130
 
131
- Use with `build_configure_asset_manager_tx` (enable + configure) or `build_set_asset_manager_tx` (grant/revoke only). Both require V3/V4 accounts.
131
+ Use with `write.configure_asset_manager` (enable + configure) or `write.set_asset_manager` (grant/revoke only). Both require V3/V4 accounts.
132
132
 
133
133
  | Type | Protocol | Address |
134
134
  | -------------- | ------------- | -------------------------------------------- |
@@ -148,7 +148,7 @@ Use with `build_configure_asset_manager_tx` (enable + configure) or `build_set_a
148
148
  | CoW Swapper | All | `0xc928013A219EC9F18dE7B2dee6A50Ba626811854` |
149
149
  | Gas Relayer | All | `0xD938C8d04cF91094fecAF0A2018EAac483a40137` |
150
150
 
151
- **Slipstream V1 vs V2:** The pool determines the version — some pools are V1, some are V2. The API currently returns `protocol: "slipstream"` without V1/V2 distinction. To identify the version, check the position manager address from `get_account_info` against the known addresses (V1: `0x8279...`, V2: `0xa990...`). Alternatively, pass `pool_protocol` directly to `build_configure_asset_manager_tx` to auto-resolve the correct AM address. Staked and wrapped staked positions use the same asset managers as their base protocol.
151
+ **Slipstream V1 vs V2:** The pool determines the version — some pools are V1, some are V2. The API currently returns `protocol: "slipstream"` without V1/V2 distinction. To identify the version, check the position manager address from `read.account_info` against the known addresses (V1: `0x8279...`, V2: `0xa990...`). Alternatively, pass `pool_protocol` directly to `write.configure_asset_manager` to auto-resolve the correct AM address. Staked and wrapped staked positions use the same asset managers as their base protocol.
152
152
 
153
153
  ## Account Versions
154
154
 
@@ -156,9 +156,9 @@ Spot vs margin is determined by whether a **creditor** (lending pool) is set at
156
156
 
157
157
  - `account_version: 3` — **margin account** (created with a `creditor`). Can borrow, leverage, and mint LP. Uses an onchain whitelist of allowed collateral tokens.
158
158
  - `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).
159
- - `account_version: 1` or `2` — legacy. Not supported by current MCP tools (`build_set_asset_manager_tx` and `build_configure_asset_manager_tx` require V3/V4).
159
+ - `account_version: 1` or `2` — legacy. Not supported by current MCP tools (`write.set_asset_manager` and `write.configure_asset_manager` require V3/V4).
160
160
  - For **leveraged LP strategies**, use `account_version: 3` with a creditor.
161
- - To check an existing account's version: call `get_account_info` — the response includes the account version.
161
+ - To check an existing account's version: call `read.account_info` — the response includes the account version.
162
162
 
163
163
  ## Reference Files
164
164
 
@@ -4,14 +4,14 @@ All automation on Arcadia uses one of two tools (both V3/V4 accounts only), then
4
4
 
5
5
  ## Which tool to use
6
6
 
7
- **To enable + configure (recommended):** Use `build_configure_asset_manager_tx`. This grants permission AND sets strategy parameters (initiator, fee limits, trigger thresholds, fee recipient, etc.) in a single transaction.
7
+ **To enable + configure (recommended):** Use `write.configure_asset_manager`. This grants permission AND sets strategy parameters (initiator, fee limits, trigger thresholds, fee recipient, etc.) in a single transaction.
8
8
 
9
- **To grant/revoke only:** Use `build_set_asset_manager_tx`. This only grants or revokes permission — no configuration. Use this to revoke an asset manager.
9
+ **To grant/revoke only:** Use `write.set_asset_manager`. This only grants or revokes permission — no configuration. Use this to revoke an asset manager.
10
10
 
11
11
  ## Configure + enable
12
12
 
13
13
  ```
14
- build_configure_asset_manager_tx(
14
+ write.configure_asset_manager(
15
15
  account_address: <account>,
16
16
  asset_manager_address: <address from table below>,
17
17
  am_type: "rebalancer" | "compounder" | "yield_claimer" | "merkl_operator",
@@ -32,7 +32,7 @@ build_configure_asset_manager_tx(
32
32
  ## Grant/revoke only
33
33
 
34
34
  ```
35
- build_set_asset_manager_tx(
35
+ write.set_asset_manager(
36
36
  account_address: <account>,
37
37
  asset_manager_address: <address from table below>,
38
38
  enabled: true, // false to revoke
@@ -40,7 +40,7 @@ build_set_asset_manager_tx(
40
40
  )
41
41
  ```
42
42
 
43
- To revoke any AM: `build_set_asset_manager_tx(..., enabled: false)` or `build_configure_asset_manager_tx` is not used for revocation — use `build_set_asset_manager_tx` with `enabled: false`.
43
+ To revoke any AM: `write.set_asset_manager(..., enabled: false)` or `write.configure_asset_manager` is not used for revocation — use `write.set_asset_manager` with `enabled: false`.
44
44
 
45
45
  ---
46
46
 
@@ -109,7 +109,7 @@ Quota is also bypassed automatically when: gas cost < pending fees ÷ 2, or posi
109
109
  | Uniswap V3 | `0x75Ed28EA8601Ce9F5FbcAB1c2428f04A57aFaA16` | All |
110
110
  | Uniswap V4 | `0xD8aa21AB7f9B8601CB7d7A776D3AFA1602d5D8D4` | All |
111
111
 
112
- **Recipient config:** Set `fee_recipient` in `build_configure_asset_manager_tx` (V3/V4 accounts). Pass your wallet address or any destination address.
112
+ **Recipient config:** Set `fee_recipient` in `write.configure_asset_manager` (V3/V4 accounts). Pass your wallet address or any destination address.
113
113
 
114
114
  ---
115
115
 
@@ -117,7 +117,7 @@ Quota is also bypassed automatically when: gas cost < pending fees ÷ 2, or posi
117
117
 
118
118
  **What it does:** Bot claims external Merkl protocol incentive rewards into the account. These are additional rewards paid by token teams on top of regular LP fees — completely separate from trading fee yield.
119
119
 
120
- **When to enable:** When the pool you LP into has active Merkl campaigns. Check by looking at the pool APY breakdown in `get_strategies` — if there's a "Merkl" or "external rewards" component, enable this.
120
+ **When to enable:** When the pool you LP into has active Merkl campaigns. Check by looking at the pool APY breakdown in `read.strategies` — if there's a "Merkl" or "external rewards" component, enable this.
121
121
 
122
122
  **Address (all chains):** `0x969F0251360b9Cf11c68f6Ce9587924c1B8b42C6`
123
123
 
@@ -7,8 +7,8 @@ Use this guide to evaluate whether a strategy makes sense and how to configure i
7
7
  ## 1. Pool / Strategy Selection
8
8
 
9
9
  ```
10
- get_strategies(chain_id: 8453) // browse all LP strategies + fee APY
11
- get_lending_pools(chain_id: 8453) // check borrow cost for leveraged strategies
10
+ read.strategies(chain_id: 8453) // browse all LP strategies + fee APY
11
+ read.lending_pools(chain_id: 8453) // check borrow cost for leveraged strategies
12
12
  ```
13
13
 
14
14
  **Viability check (leveraged):**
@@ -32,12 +32,12 @@ Must be positive to justify the leverage cost. Higher leverage amplifies both si
32
32
 
33
33
  - Fee tier: higher fee tier (0.3%, 1%) = more fee per trade, better for volatile pairs
34
34
  - Volume + TVL: high volume/TVL ratio = fees are being earned actively
35
- - Active Merkl rewards: extra yield on top, check `get_strategies` APY breakdown
35
+ - Active Merkl rewards: extra yield on top, check `read.strategies` APY breakdown
36
36
 
37
37
  **`numeraire` — context-dependent meaning:**
38
38
 
39
- - **`build_add_liquidity_tx`**: `numeraire` = account base currency (typically the stable side, e.g. USDC for a WETH/USDC position). The backend uses it to denominate calculations and determine the optimal swap ratio. For WETH/USDC: `numeraire = 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` (USDC).
40
- - **`build_repay_with_collateral_tx`**: `numeraire` = the debt token you're repaying (e.g. WETH address when repaying WETH debt). This differs from the add liquidity usage.
39
+ - **`advanced.add_liquidity`**: `numeraire` = account base currency (typically the stable side, e.g. USDC for a WETH/USDC position). The backend uses it to denominate calculations and determine the optimal swap ratio. For WETH/USDC: `numeraire = 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` (USDC).
40
+ - **`advanced.repay_with_collateral`**: `numeraire` = the debt token you're repaying (e.g. WETH address when repaying WETH debt). This differs from the add liquidity usage.
41
41
 
42
42
  ---
43
43
 
@@ -45,7 +45,7 @@ Must be positive to justify the leverage cost. Higher leverage amplifies both si
45
45
 
46
46
  Range width is the central tradeoff in any LP strategy. It is set in the Arcadia platform after enabling the rebalancer. Understanding the full tradeoff is essential for choosing parameters — a simple fee APY comparison is not enough.
47
47
 
48
- **Core principle:** The `strategy_apy` from `get_strategies` (list view) is the 7-day average APY computed for that strategy's **default range width** (configured per strategy — e.g. very narrow for stables, ±7.5% / balanced for most volatile pairs). It is sampled every ~3 hours and averaged over 7d. It already reflects a concentrated range — NOT a full-range / pool-level number. Choosing a different range width changes your actual yield: narrower = higher fee capture but more rebalancing cost/risk, wider = lower fees but fewer rebalances. Call `get_strategies(strategy_id: <id>)` to see APY broken down by range width (very_narrow, narrow, balanced, wide, very_wide, full_range). The net return after rebalancing costs, IL, and gas determines the optimal width — see the model below.
48
+ **Core principle:** The `strategy_apy` from `read.strategies` (list view) is the 7-day average APY computed for that strategy's **default range width** (configured per strategy — e.g. very narrow for stables, ±7.5% / balanced for most volatile pairs). It is sampled every ~3 hours and averaged over 7d. It already reflects a concentrated range — NOT a full-range / pool-level number. Choosing a different range width changes your actual yield: narrower = higher fee capture but more rebalancing cost/risk, wider = lower fees but fewer rebalances. Call `read.strategies(strategy_id: <id>)` to see APY broken down by range width (very_narrow, narrow, balanced, wide, very_wide, full_range). The net return after rebalancing costs, IL, and gas determines the optimal width — see the model below.
49
49
 
50
50
  ### The full tradeoff
51
51
 
@@ -76,7 +76,7 @@ expected_net_return =
76
76
 
77
77
  Inputs to estimate from market data:
78
78
 
79
- - **time_in_range_fraction**: given the pool's historical volatility, how often does price stay within ±X% of the current price? Use `get_strategies` APY + historical vol data.
79
+ - **time_in_range_fraction**: given the pool's historical volatility, how often does price stay within ±X% of the current price? Use `read.strategies` APY + historical vol data.
80
80
  - **rebalance_frequency**: how many rebalances per day does the chosen range width require? Wider range = fewer rebalances.
81
81
  - **gas_cost_per_rebalance**: check current chain gas price × ~4M units per rebalance.
82
82
  - **IL_rate**: IL as a function of how far price moved before the rebalance; wider ranges accumulate less IL per rebalance.
@@ -137,7 +137,7 @@ Target collateral ratio ≥ 1.5 at entry (≈ health factor ~0.5+). Never open b
137
137
  - Borrow APY rising (utilization climbing in lending pool)
138
138
  - Market showing high volatility (gap risk)
139
139
  - Position already near support/resistance — a breakout would spike debt fast
140
- - Health factor dropping toward 0.5 (check with `get_account_info`)
140
+ - Health factor dropping toward 0.5 (check with `read.account_info`)
141
141
 
142
142
  ---
143
143
 
@@ -155,25 +155,25 @@ Target collateral ratio ≥ 1.5 at entry (≈ health factor ~0.5+). Never open b
155
155
 
156
156
  ## 5. Exit Signals
157
157
 
158
- Monitor periodically with `get_account_info` and `get_account_pnl`. Exit or adjust when:
158
+ Monitor periodically with `read.account_info` and `read.account_pnl`. Exit or adjust when:
159
159
 
160
- | Signal | Threshold | Action |
161
- | -------------------------------- | ----------------------- | ------------------------------------- |
162
- | Borrow APY > fee APY | Persists 3+ checks | Exit strategy — no longer profitable |
163
- | Health factor falling | < 0.5 | Add collateral or reduce debt |
164
- | Health factor critical | < 0.2 | Immediate action required |
165
- | Position out-of-range repeatedly | Bot can't keep up | Widen range or reduce leverage |
166
- | Net PnL negative over time | Check `get_account_pnl` | Evaluate whether IL is outpacing fees |
160
+ | Signal | Threshold | Action |
161
+ | -------------------------------- | ------------------------ | ------------------------------------- |
162
+ | Borrow APY > fee APY | Persists 3+ checks | Exit strategy — no longer profitable |
163
+ | Health factor falling | < 0.5 | Add collateral or reduce debt |
164
+ | Health factor critical | < 0.2 | Immediate action required |
165
+ | Position out-of-range repeatedly | Bot can't keep up | Widen range or reduce leverage |
166
+ | Net PnL negative over time | Check `read.account_pnl` | Evaluate whether IL is outpacing fees |
167
167
 
168
- **Closing in volatile conditions:** Atomic close (`build_close_position_tx`) may revert during high volatility or for low-liquidity pools because on-chain state diverges from when the backend computed the calldata. If atomic close fails, fall back to individual tools with tighter slippage — see strategies.md closing section for the full fallback sequence.
168
+ **Closing in volatile conditions:** Atomic close (`advanced.close_position`) may revert during high volatility or for low-liquidity pools because on-chain state diverges from when the backend computed the calldata. If atomic close fails, fall back to individual tools with tighter slippage — see strategies.md closing section for the full fallback sequence.
169
169
 
170
170
  ---
171
171
 
172
172
  ## 6. Quick Checklist Before Opening a Position
173
173
 
174
174
  ```
175
- [ ] get_strategies → fee_APY noted (7d avg for default range; call with strategy_id for per-range APY)
176
- [ ] get_lending_pools → borrow_APY noted (if leveraged)
175
+ [ ] read.strategies → fee_APY noted (7d avg for default range; call with strategy_id for per-range APY)
176
+ [ ] read.lending_pools → borrow_APY noted (if leveraged)
177
177
  [ ] net_APY = fee_APY - (leverage-1) × borrow_APY > 0
178
178
  [ ] Pair type matches strategy (volatile/stable for delta neutral)
179
179
  [ ] Range width: modeled or estimated for pair volatility + stAAA quota