From 2a68e2e700c4730349ef88e4a18c432a62d048bd Mon Sep 17 00:00:00 2001 From: Thomas Smets Date: Fri, 20 Mar 2026 10:59:32 +0100 Subject: [PATCH 1/5] Add Arcadia Finance skill: concentrated liquidity management on Base and Unichain Arcadia Finance provides LP position management on Uniswap and Aerodrome with automated rebalancing, compounding, yield optimization, and leverage. 38 tools (17 read, 20 write, 1 dev) exposed via remote MCP server at mcp.arcadia.finance. The CLI script connects over Streamable HTTP, so no API keys or local setup is needed. Includes: - SKILL.md with natural language examples and CLI usage - references/contracts.md with protocol and token addresses - references/wallet-signing.md with wallet MCP server options - scripts/arcadia.mjs CLI wrapper --- README.md | 1 + arcadia-finance/SKILL.md | 150 +++++++++++++++++++ arcadia-finance/references/contracts.md | 32 ++++ arcadia-finance/references/wallet-signing.md | 11 ++ arcadia-finance/scripts/arcadia.mjs | 49 ++++++ 5 files changed, 243 insertions(+) create mode 100644 arcadia-finance/SKILL.md create mode 100644 arcadia-finance/references/contracts.md create mode 100644 arcadia-finance/references/wallet-signing.md create mode 100644 arcadia-finance/scripts/arcadia.mjs diff --git a/README.md b/README.md index 688400ca..88bb03aa 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Bankr Skills equip builders with plug-and-play tools to build more powerful agen | Provider | Skill | Description | | --- | --- | --- | +| [Arcadia Finance](https://arcadia.finance) | [arcadia-finance](arcadia-finance/) | Concentrated liquidity management on Uniswap and Aerodrome. Deploy LP positions with automated rebalancing, compounding, leverage, and yield optimization on Base and Unichain. | | [Bankr](https://bankr.bot) | [bankr](bankr/) | Launch a token, earn from every trade, and fund your agent. Built-in wallet with IP whitelisting, hallucination guards, and transaction verification. | | [Builder's Garden](https://builders.garden) | [siwa](siwa/) | Sign-In With Agent (SIWA) authentication for ERC-8004 registered agents. Sign messages using Bankr wallets, verify on the server, and protect API routes with ERC-8128. | | [Axiom](https://clawbots.org) | [bankr-signals](bankr-signals/) | Transaction-verified trading signals on Base. Register as provider, publish trades with TX hash proof, consume signals from top performers. | diff --git a/arcadia-finance/SKILL.md b/arcadia-finance/SKILL.md new file mode 100644 index 00000000..6132d1cb --- /dev/null +++ b/arcadia-finance/SKILL.md @@ -0,0 +1,150 @@ +--- +name: arcadia-finance +description: Manage concentrated liquidity positions on Uniswap and Aerodrome via Arcadia Finance. Use when the user wants to deploy LP positions, add or remove liquidity, rebalance positions, set up automated compounding, borrow against LP collateral, manage yield optimization, or use leverage on Base or Unichain. Returns unsigned transactions for safe wallet signing. +metadata: + { + "clawdbot": + { + "emoji": "🏛️", + "homepage": "https://arcadia.finance", + "requires": { "bins": ["node"] }, + }, + } +--- + +# Arcadia Finance + +Manage concentrated liquidity positions on Uniswap and Aerodrome with automated rebalancing, compounding, yield optimization, and optional leverage. Supported chains: Base (8453), Unichain (130). + +## Quick Start + +### Check Your Positions + +``` +What are my Arcadia accounts for 0x...? +``` + +### Deploy a New LP Position + +``` +Show me the best Arcadia strategies for WETH/USDC on Base +``` + +``` +Open an LP position on Arcadia using 1000 USDC on the WETH/USDC strategy +``` + +### Set Up Automation + +``` +Enable the rebalancer on my Arcadia account 0x... +``` + +``` +Set up compounding on my Arcadia account +``` + +### Borrow Against LP Collateral + +``` +Borrow 500 USDC against my Arcadia account 0x... +``` + +### Close a Position + +``` +Close my Arcadia account 0x... and withdraw everything as USDC +``` + +## CLI Usage + +```bash +node scripts/arcadia.mjs '' +node scripts/arcadia.mjs --list +``` + +The `@modelcontextprotocol/sdk` dependency is required: + +```bash +npm install @modelcontextprotocol/sdk +``` + +## Read Operations + +```bash +# List all accounts for a wallet +node scripts/arcadia.mjs read_wallet_accounts '{"wallet_address":"0x..."}' + +# Account details (health factor, collateral, debt, positions) +node scripts/arcadia.mjs read_account_info '{"account_address":"0x..."}' + +# Featured LP strategies with APY +node scripts/arcadia.mjs read_strategy_list '{"featured_only":true}' + +# Lending pools (TVL, APY, utilization) +node scripts/arcadia.mjs read_pool_list '{}' + +# Available automations (rebalancer, compounder, yield claimer) +node scripts/arcadia.mjs read_asset_manager_intents '{}' + +# Workflow guides +node scripts/arcadia.mjs read_guides '{"topic":"overview"}' +``` + +## Write Operations + +All write tools return unsigned transactions `{ to, data, value, chainId }`. See `references/wallet-signing.md` for how to sign and broadcast. + +```bash +# Open LP position (deposits + swaps + mints LP atomically) +node scripts/arcadia.mjs write_account_add_liquidity '{"account_address":"0x...","wallet_address":"0x...","positions":[{"strategy_id":123}],"deposits":[{"asset":"0x...","amount":"1000000","decimals":6}]}' + +# Close position (burn LP + swap + repay in one tx) +node scripts/arcadia.mjs write_account_close '{"account_address":"0x...","assets":[...],"receive_assets":[...]}' + +# Enable automation +node scripts/arcadia.mjs write_asset_manager_rebalancer '{"dex_protocol":"slipstream"}' +node scripts/arcadia.mjs write_account_set_asset_managers '{"account_address":"0x...","asset_managers":[...],"statuses":[...],"datas":[...]}' +``` + +## Common Workflows + +### First-Time User + +1. **Browse strategies**: "Show me Arcadia strategies on Base" +2. **Create account**: "Create an Arcadia account on Base" +3. **Deposit and LP**: "Open an LP position using 1000 USDC on the WETH/USDC strategy" +4. **Enable automation**: "Enable the rebalancer on my account" + +### Leverage Farming + +1. **Open position**: "Open an LP position on Arcadia with 1000 USDC" +2. **Borrow**: "Borrow 500 USDC against my Arcadia account" +3. **Add more liquidity**: "Add the borrowed USDC as liquidity" +4. **Monitor health**: "What's the health factor on my account?" + +### Yield Optimization + +1. **Check automations**: "What automations are available on Arcadia?" +2. **Enable compounder**: "Set up compounding on my account" +3. **Enable yield claimer**: "Enable the yield claimer on my account" +4. **Check PnL**: "Show my Arcadia account PnL" + +## Safety + +- Write tools return unsigned transactions only. Never auto-sign. +- Always confirm transaction details with the user before signing. +- Check account health factor with `read_account_info` before risky operations (borrow, deleverage). +- Do not pass private keys or secrets as tool arguments. Only public addresses and amounts are needed. + +## Configuration + +The CLI connects to `https://mcp.arcadia.finance/mcp` by default. Set `ARCADIA_MCP_URL` to override. + +## References + +- **[Contract Addresses](references/contracts.md)**: Protocol contracts, lending pools, key tokens +- **[Wallet Signing](references/wallet-signing.md)**: How to sign unsigned transactions +- **Full tool docs**: https://mcp.arcadia.finance/llms-full.txt +- **Website**: https://arcadia.finance +- **Docs**: https://docs.arcadia.finance diff --git a/arcadia-finance/references/contracts.md b/arcadia-finance/references/contracts.md new file mode 100644 index 00000000..fc1aedcc --- /dev/null +++ b/arcadia-finance/references/contracts.md @@ -0,0 +1,32 @@ +# Arcadia Contract Addresses + +Supported chains: Base (8453), Unichain (130). + +## Protocol (same on all chains) + +| Contract | Address | +| ---------- | ------------------------------------------ | +| Factory | 0xDa14Fdd72345c4d2511357214c5B89A919768e59 | +| Registry | 0xd0690557600eb8Be8391D1d97346e2aab5300d5f | +| Liquidator | 0xA4B0b9fD1d91fA2De44F6ABFd59cC14bA1E1a7Af | + +## Lending Pools (Base) + +| Pool | Address | +| -------- | ------------------------------------------ | +| LP_WETH | 0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2 | +| LP_USDC | 0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1 | +| LP_CBBTC | 0xa37E9b4369dc20940009030BfbC2088F09645e3B | + +## Key Tokens (Base) + +| Token | Address | Decimals | +| ----- | ------------------------------------------ | -------- | +| WETH | 0x4200000000000000000000000000000000000006 | 18 | +| USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 | 6 | +| cbBTC | 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf | 8 | +| AERO | 0x940181a94A35A4569E4529A3CDfB74e38FD98631 | 18 | + +## Asset Managers + +Rebalancers, compounders, and yield claimers are deployed per DEX protocol. Use `read_asset_manager_intents` to discover available automations and their addresses. diff --git a/arcadia-finance/references/wallet-signing.md b/arcadia-finance/references/wallet-signing.md new file mode 100644 index 00000000..109107a9 --- /dev/null +++ b/arcadia-finance/references/wallet-signing.md @@ -0,0 +1,11 @@ +# Signing Unsigned Transactions + +All Arcadia write tools return unsigned transactions as `{ to, data, value, chainId }`. You need a separate wallet to sign and broadcast. Never expose private keys to the agent. + +## Wallet MCP Servers (recommended) + +- MCP Wallet Signer (github.com/nikicat/mcp-wallet-signer): routes to browser wallet (MetaMask, Rabby), non-custodial +- Phantom MCP (@phantom/mcp-server): for Phantom wallet users +- Privy MCP (github.com/incentivai-io/privy-mcp-server): wallet infrastructure +- Coinbase AgentKit (github.com/coinbase/agentkit): wallet-agnostic signing +- Safe MCP (github.com/safer-sh/safer): multi-sig via Safe diff --git a/arcadia-finance/scripts/arcadia.mjs b/arcadia-finance/scripts/arcadia.mjs new file mode 100644 index 00000000..766380c2 --- /dev/null +++ b/arcadia-finance/scripts/arcadia.mjs @@ -0,0 +1,49 @@ +#!/usr/bin/env node + +/** + * CLI wrapper for Arcadia Finance MCP server. + * Connects to the remote endpoint and calls tools by name. + * + * Usage: + * node arcadia.mjs '' + * node arcadia.mjs --list + * + * Requires: npm install @modelcontextprotocol/sdk + */ + +import { Client } from "@modelcontextprotocol/sdk/client/index.js"; +import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; + +const ENDPOINT = process.env.ARCADIA_MCP_URL || "https://mcp.arcadia.finance/mcp"; +const [toolName, argsJson] = process.argv.slice(2); + +if (!toolName) { + console.error("Usage: node arcadia.mjs ''"); + console.error(" node arcadia.mjs --list"); + process.exit(1); +} + +const client = new Client({ name: "arcadia-openclaw", version: "1.0.0" }); +const transport = new StreamableHTTPClientTransport(new URL(ENDPOINT)); +await client.connect(transport); + +try { + if (toolName === "--list") { + const { tools } = await client.listTools(); + for (const t of tools.sort((a, b) => a.name.localeCompare(b.name))) { + console.log(`${t.name}: ${t.description?.substring(0, 120)}`); + } + } else { + const args = argsJson ? JSON.parse(argsJson) : {}; + const result = await client.callTool({ name: toolName, arguments: args }); + const text = result.content?.[0]?.text ?? ""; + if (result.isError) { + console.error(`ERROR: ${text}`); + process.exitCode = 1; + } else { + console.log(text); + } + } +} finally { + await client.close(); +} From 516ea72f4a0a334c33980d5f72206b16b1a94373 Mon Sep 17 00:00:00 2001 From: Thomas Smets Date: Fri, 20 Mar 2026 11:04:39 +0100 Subject: [PATCH 2/5] Use Bankr for transaction signing --- arcadia-finance/SKILL.md | 34 +++++++++++--------- arcadia-finance/references/wallet-signing.md | 33 ++++++++++++++----- 2 files changed, 44 insertions(+), 23 deletions(-) diff --git a/arcadia-finance/SKILL.md b/arcadia-finance/SKILL.md index 6132d1cb..5885db62 100644 --- a/arcadia-finance/SKILL.md +++ b/arcadia-finance/SKILL.md @@ -1,13 +1,13 @@ --- name: arcadia-finance -description: Manage concentrated liquidity positions on Uniswap and Aerodrome via Arcadia Finance. Use when the user wants to deploy LP positions, add or remove liquidity, rebalance positions, set up automated compounding, borrow against LP collateral, manage yield optimization, or use leverage on Base or Unichain. Returns unsigned transactions for safe wallet signing. +description: Manage concentrated liquidity positions on Uniswap and Aerodrome via Arcadia Finance. Use when the user wants to deploy LP positions, add or remove liquidity, rebalance positions, set up automated compounding, borrow against LP collateral, manage yield optimization, or use leverage on Base or Unichain. Returns unsigned transactions for Bankr to sign and submit. metadata: { "clawdbot": { "emoji": "🏛️", "homepage": "https://arcadia.finance", - "requires": { "bins": ["node"] }, + "requires": { "bins": ["node", "bankr"] }, }, } --- @@ -21,7 +21,7 @@ Manage concentrated liquidity positions on Uniswap and Aerodrome with automated ### Check Your Positions ``` -What are my Arcadia accounts for 0x...? +What are my Arcadia accounts? ``` ### Deploy a New LP Position @@ -63,7 +63,7 @@ node scripts/arcadia.mjs '' node scripts/arcadia.mjs --list ``` -The `@modelcontextprotocol/sdk` dependency is required: +Install dependency: ```bash npm install @modelcontextprotocol/sdk @@ -93,18 +93,22 @@ node scripts/arcadia.mjs read_guides '{"topic":"overview"}' ## Write Operations -All write tools return unsigned transactions `{ to, data, value, chainId }`. See `references/wallet-signing.md` for how to sign and broadcast. +All write tools return unsigned transactions `{ to, data, value, chainId }`. Use Bankr to sign and submit. See `references/wallet-signing.md`. ```bash -# Open LP position (deposits + swaps + mints LP atomically) -node scripts/arcadia.mjs write_account_add_liquidity '{"account_address":"0x...","wallet_address":"0x...","positions":[{"strategy_id":123}],"deposits":[{"asset":"0x...","amount":"1000000","decimals":6}]}' +# Get unsigned tx, then submit via Bankr +TX=$(node scripts/arcadia.mjs write_account_deposit '{"account_address":"0x...","assets":[{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","id":0,"amount":"1000000"}]}') +bankr prompt "Submit this transaction: $TX" +``` -# Close position (burn LP + swap + repay in one tx) -node scripts/arcadia.mjs write_account_close '{"account_address":"0x...","assets":[...],"receive_assets":[...]}' +```bash +# Open LP position (deposits + swaps + mints LP atomically) +TX=$(node scripts/arcadia.mjs write_account_add_liquidity '{"account_address":"0x...","wallet_address":"0x...","positions":[{"strategy_id":123}],"deposits":[{"asset":"0x...","amount":"1000000","decimals":6}]}') +bankr prompt "Submit this transaction: $TX" # Enable automation -node scripts/arcadia.mjs write_asset_manager_rebalancer '{"dex_protocol":"slipstream"}' -node scripts/arcadia.mjs write_account_set_asset_managers '{"account_address":"0x...","asset_managers":[...],"statuses":[...],"datas":[...]}' +TX=$(node scripts/arcadia.mjs write_asset_manager_rebalancer '{"dex_protocol":"slipstream"}') +bankr prompt "Submit this transaction: $TX" ``` ## Common Workflows @@ -112,7 +116,7 @@ node scripts/arcadia.mjs write_account_set_asset_managers '{"account_address":"0 ### First-Time User 1. **Browse strategies**: "Show me Arcadia strategies on Base" -2. **Create account**: "Create an Arcadia account on Base" +2. **Create account**: "Create an Arcadia account on Base" (submit via Bankr) 3. **Deposit and LP**: "Open an LP position using 1000 USDC on the WETH/USDC strategy" 4. **Enable automation**: "Enable the rebalancer on my account" @@ -132,8 +136,8 @@ node scripts/arcadia.mjs write_account_set_asset_managers '{"account_address":"0 ## Safety -- Write tools return unsigned transactions only. Never auto-sign. -- Always confirm transaction details with the user before signing. +- Write tools return unsigned transactions only. Bankr handles signing. +- Always confirm transaction details with the user before submitting. - Check account health factor with `read_account_info` before risky operations (borrow, deleverage). - Do not pass private keys or secrets as tool arguments. Only public addresses and amounts are needed. @@ -144,7 +148,7 @@ The CLI connects to `https://mcp.arcadia.finance/mcp` by default. Set `ARCADIA_M ## References - **[Contract Addresses](references/contracts.md)**: Protocol contracts, lending pools, key tokens -- **[Wallet Signing](references/wallet-signing.md)**: How to sign unsigned transactions +- **[Wallet Signing](references/wallet-signing.md)**: How to submit transactions via Bankr - **Full tool docs**: https://mcp.arcadia.finance/llms-full.txt - **Website**: https://arcadia.finance - **Docs**: https://docs.arcadia.finance diff --git a/arcadia-finance/references/wallet-signing.md b/arcadia-finance/references/wallet-signing.md index 109107a9..44ca260a 100644 --- a/arcadia-finance/references/wallet-signing.md +++ b/arcadia-finance/references/wallet-signing.md @@ -1,11 +1,28 @@ -# Signing Unsigned Transactions +# Signing Transactions via Bankr -All Arcadia write tools return unsigned transactions as `{ to, data, value, chainId }`. You need a separate wallet to sign and broadcast. Never expose private keys to the agent. +All Arcadia write tools return unsigned transactions as `{ to, data, value, chainId }`. Use Bankr to sign and broadcast. -## Wallet MCP Servers (recommended) +## Single Transaction -- MCP Wallet Signer (github.com/nikicat/mcp-wallet-signer): routes to browser wallet (MetaMask, Rabby), non-custodial -- Phantom MCP (@phantom/mcp-server): for Phantom wallet users -- Privy MCP (github.com/incentivai-io/privy-mcp-server): wallet infrastructure -- Coinbase AgentKit (github.com/coinbase/agentkit): wallet-agnostic signing -- Safe MCP (github.com/safer-sh/safer): multi-sig via Safe +```bash +TX='{"to":"0x...","data":"0x...","value":"0","chainId":8453}' +bankr prompt "Submit this transaction: $TX" +``` + +## Multi-Step Example (Approve + Deposit) + +```bash +# Step 1: Approve token spend +APPROVE_TX=$(node scripts/arcadia.mjs write_wallet_approve '{"token_address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","spender_address":"0x...","amount":"1000000"}') +bankr prompt "Submit this transaction: $APPROVE_TX" + +# Step 2: Deposit into account +DEPOSIT_TX=$(node scripts/arcadia.mjs write_account_deposit '{"account_address":"0x...","assets":[{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","id":0,"amount":"1000000"}]}') +bankr prompt "Submit this transaction: $DEPOSIT_TX" +``` + +## Safety + +- Always confirm transaction details with the user before submitting +- Check account health factor with `read_account_info` before risky operations +- Never pass private keys as tool arguments From d6e568977a36970c7d791a76ff80e0bc9fb5f89a Mon Sep 17 00:00:00 2001 From: Thomas Smets Date: Fri, 20 Mar 2026 11:15:41 +0100 Subject: [PATCH 3/5] Replace node MCP wrapper with curl/jq, enrich description --- arcadia-finance/SKILL.md | 116 +++++++++++-------- arcadia-finance/references/wallet-signing.md | 16 +-- arcadia-finance/scripts/arcadia.mjs | 49 -------- arcadia-finance/scripts/arcadia.sh | 87 ++++++++++++++ 4 files changed, 164 insertions(+), 104 deletions(-) delete mode 100644 arcadia-finance/scripts/arcadia.mjs create mode 100755 arcadia-finance/scripts/arcadia.sh diff --git a/arcadia-finance/SKILL.md b/arcadia-finance/SKILL.md index 5885db62..11a20dad 100644 --- a/arcadia-finance/SKILL.md +++ b/arcadia-finance/SKILL.md @@ -1,33 +1,41 @@ --- name: arcadia-finance -description: Manage concentrated liquidity positions on Uniswap and Aerodrome via Arcadia Finance. Use when the user wants to deploy LP positions, add or remove liquidity, rebalance positions, set up automated compounding, borrow against LP collateral, manage yield optimization, or use leverage on Base or Unichain. Returns unsigned transactions for Bankr to sign and submit. +description: DeFi liquidity management via Arcadia Finance. Use when the user wants to provide liquidity on Uniswap V3 or Aerodrome Slipstream, deploy concentrated LP positions, add or remove liquidity, set up automated rebalancing or compounding, borrow against LP collateral, manage yield farming, check PnL, use leverage, or optimize DeFi yields on Base or Unichain. Returns unsigned transactions for Bankr to sign and submit. metadata: { "clawdbot": { "emoji": "🏛️", "homepage": "https://arcadia.finance", - "requires": { "bins": ["node", "bankr"] }, + "requires": { "bins": ["curl", "jq", "bankr"] }, }, } --- # Arcadia Finance -Manage concentrated liquidity positions on Uniswap and Aerodrome with automated rebalancing, compounding, yield optimization, and optional leverage. Supported chains: Base (8453), Unichain (130). +DeFi liquidity management on Uniswap V3 and Aerodrome Slipstream. Deploy concentrated LP positions with automated rebalancing, compounding, yield optimization, and optional leverage. Supported chains: Base (8453), Unichain (130). ## Quick Start -### Check Your Positions +### Check Wallet Positions + +First, discover the user's accounts from their wallet address: + +``` +What Arcadia accounts do I have? +``` + +Then inspect a specific account: ``` -What are my Arcadia accounts? +Show me the details of my Arcadia account 0x... ``` ### Deploy a New LP Position ``` -Show me the best Arcadia strategies for WETH/USDC on Base +What are the best Arcadia strategies for WETH/USDC on Base? ``` ``` @@ -44,70 +52,84 @@ Enable the rebalancer on my Arcadia account 0x... Set up compounding on my Arcadia account ``` -### Borrow Against LP Collateral +### Use Leverage ``` Borrow 500 USDC against my Arcadia account 0x... ``` +``` +What's the health factor on my Arcadia account? +``` + ### Close a Position ``` Close my Arcadia account 0x... and withdraw everything as USDC ``` -## CLI Usage +## Capabilities -```bash -node scripts/arcadia.mjs '' -node scripts/arcadia.mjs --list -``` +- **LP Management**: Create accounts, deposit collateral, open/close concentrated LP positions on Uniswap V3 and Aerodrome Slipstream +- **Automation**: Enable rebalancers, compounders, yield claimers, and CoW Swap-based yield harvesters per account +- **Leverage**: Borrow from lending pools against LP collateral, deleverage when needed +- **Monitoring**: Check health factor, PnL, collateral/debt breakdown, position history +- **Strategy Discovery**: Browse curated strategies with APY, get rebalancing recommendations +- **Lending Pools**: View TVL, utilization, borrow rates, available liquidity -Install dependency: +## CLI Usage ```bash -npm install @modelcontextprotocol/sdk +scripts/arcadia.sh '' +scripts/arcadia.sh --list ``` +Requires: `curl`, `jq`. No npm dependencies. + ## Read Operations ```bash -# List all accounts for a wallet -node scripts/arcadia.mjs read_wallet_accounts '{"wallet_address":"0x..."}' +# Discover accounts from wallet address +scripts/arcadia.sh read_wallet_accounts '{"wallet_address":"0x..."}' + +# Account details: health factor, collateral, debt, positions +scripts/arcadia.sh read_account_info '{"account_address":"0x..."}' -# Account details (health factor, collateral, debt, positions) -node scripts/arcadia.mjs read_account_info '{"account_address":"0x..."}' +# Account PnL and yield earned +scripts/arcadia.sh read_account_pnl '{"account_address":"0x..."}' -# Featured LP strategies with APY -node scripts/arcadia.mjs read_strategy_list '{"featured_only":true}' +# Featured LP strategies with APY (start here) +scripts/arcadia.sh read_strategy_list '{"featured_only":true}' -# Lending pools (TVL, APY, utilization) -node scripts/arcadia.mjs read_pool_list '{}' +# Lending pools: TVL, APY, utilization, borrow rates +scripts/arcadia.sh read_pool_list -# Available automations (rebalancer, compounder, yield claimer) -node scripts/arcadia.mjs read_asset_manager_intents '{}' +# Available automations and their parameters +scripts/arcadia.sh read_asset_manager_intents # Workflow guides -node scripts/arcadia.mjs read_guides '{"topic":"overview"}' +scripts/arcadia.sh read_guides '{"topic":"overview"}' ``` ## Write Operations -All write tools return unsigned transactions `{ to, data, value, chainId }`. Use Bankr to sign and submit. See `references/wallet-signing.md`. +All write tools return unsigned transactions `{ to, data, value, chainId }`. Submit via Bankr: ```bash -# Get unsigned tx, then submit via Bankr -TX=$(node scripts/arcadia.mjs write_account_deposit '{"account_address":"0x...","assets":[{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","id":0,"amount":"1000000"}]}') +# Get unsigned tx, then sign and submit +TX=$(scripts/arcadia.sh write_account_deposit '{"account_address":"0x...","assets":[{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","id":0,"amount":"1000000"}]}') bankr prompt "Submit this transaction: $TX" ``` ```bash -# Open LP position (deposits + swaps + mints LP atomically) -TX=$(node scripts/arcadia.mjs write_account_add_liquidity '{"account_address":"0x...","wallet_address":"0x...","positions":[{"strategy_id":123}],"deposits":[{"asset":"0x...","amount":"1000000","decimals":6}]}') +# Open LP position (deposit + swap + mint LP atomically) +TX=$(scripts/arcadia.sh write_account_add_liquidity '{"account_address":"0x...","wallet_address":"0x...","positions":[{"strategy_id":123}],"deposits":[{"asset":"0x...","amount":"1000000","decimals":6}]}') bankr prompt "Submit this transaction: $TX" +``` -# Enable automation -TX=$(node scripts/arcadia.mjs write_asset_manager_rebalancer '{"dex_protocol":"slipstream"}') +```bash +# Enable rebalancer automation +TX=$(scripts/arcadia.sh write_asset_manager_rebalancer '{"dex_protocol":"slipstream"}') bankr prompt "Submit this transaction: $TX" ``` @@ -115,31 +137,31 @@ bankr prompt "Submit this transaction: $TX" ### First-Time User -1. **Browse strategies**: "Show me Arcadia strategies on Base" -2. **Create account**: "Create an Arcadia account on Base" (submit via Bankr) -3. **Deposit and LP**: "Open an LP position using 1000 USDC on the WETH/USDC strategy" -4. **Enable automation**: "Enable the rebalancer on my account" +1. **Browse strategies**: `scripts/arcadia.sh read_strategy_list '{"featured_only":true}'` +2. **Create account**: get tx from `write_account_create`, submit via Bankr +3. **Deposit and LP**: get tx from `write_account_add_liquidity`, submit via Bankr +4. **Enable automation**: get tx from `write_asset_manager_rebalancer`, submit via Bankr ### Leverage Farming -1. **Open position**: "Open an LP position on Arcadia with 1000 USDC" -2. **Borrow**: "Borrow 500 USDC against my Arcadia account" -3. **Add more liquidity**: "Add the borrowed USDC as liquidity" -4. **Monitor health**: "What's the health factor on my account?" +1. **Open position** with `write_account_add_liquidity` +2. **Borrow** with `write_account_borrow` +3. **Add more liquidity** with the borrowed funds +4. **Monitor** health factor via `read_account_info` (1 = no debt, 0 = liquidation) ### Yield Optimization -1. **Check automations**: "What automations are available on Arcadia?" -2. **Enable compounder**: "Set up compounding on my account" -3. **Enable yield claimer**: "Enable the yield claimer on my account" -4. **Check PnL**: "Show my Arcadia account PnL" +1. **Check available automations** via `read_asset_manager_intents` +2. **Enable compounder** via `write_asset_manager_compounder` +3. **Enable yield claimer** via `write_asset_manager_yield_claimer` +4. **Track** earnings via `read_account_pnl` ## Safety - Write tools return unsigned transactions only. Bankr handles signing. - Always confirm transaction details with the user before submitting. -- Check account health factor with `read_account_info` before risky operations (borrow, deleverage). -- Do not pass private keys or secrets as tool arguments. Only public addresses and amounts are needed. +- Check account health factor before borrow/deleverage operations. Higher = safer (1 = no debt, 0 = liquidation). +- Never pass private keys as tool arguments. ## Configuration @@ -148,7 +170,7 @@ The CLI connects to `https://mcp.arcadia.finance/mcp` by default. Set `ARCADIA_M ## References - **[Contract Addresses](references/contracts.md)**: Protocol contracts, lending pools, key tokens -- **[Wallet Signing](references/wallet-signing.md)**: How to submit transactions via Bankr +- **[Wallet Signing](references/wallet-signing.md)**: Transaction submission via Bankr - **Full tool docs**: https://mcp.arcadia.finance/llms-full.txt - **Website**: https://arcadia.finance - **Docs**: https://docs.arcadia.finance diff --git a/arcadia-finance/references/wallet-signing.md b/arcadia-finance/references/wallet-signing.md index 44ca260a..739c89a9 100644 --- a/arcadia-finance/references/wallet-signing.md +++ b/arcadia-finance/references/wallet-signing.md @@ -5,24 +5,24 @@ All Arcadia write tools return unsigned transactions as `{ to, data, value, chai ## Single Transaction ```bash -TX='{"to":"0x...","data":"0x...","value":"0","chainId":8453}' +TX=$(scripts/arcadia.sh write_account_create '{"wallet_address":"0x...","chain_id":8453}') bankr prompt "Submit this transaction: $TX" ``` -## Multi-Step Example (Approve + Deposit) +## Multi-Step (Approve + Deposit) ```bash -# Step 1: Approve token spend -APPROVE_TX=$(node scripts/arcadia.mjs write_wallet_approve '{"token_address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","spender_address":"0x...","amount":"1000000"}') +# Step 1: Approve USDC spend +APPROVE_TX=$(scripts/arcadia.sh write_wallet_approve '{"token_address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","spender_address":"0x...","amount":"1000000"}') bankr prompt "Submit this transaction: $APPROVE_TX" # Step 2: Deposit into account -DEPOSIT_TX=$(node scripts/arcadia.mjs write_account_deposit '{"account_address":"0x...","assets":[{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","id":0,"amount":"1000000"}]}') +DEPOSIT_TX=$(scripts/arcadia.sh write_account_deposit '{"account_address":"0x...","assets":[{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","id":0,"amount":"1000000"}]}') bankr prompt "Submit this transaction: $DEPOSIT_TX" ``` ## Safety -- Always confirm transaction details with the user before submitting -- Check account health factor with `read_account_info` before risky operations -- Never pass private keys as tool arguments +- Always confirm transaction details with the user before submitting. +- Check account health factor with `read_account_info` before borrow/deleverage. +- Never pass private keys as tool arguments. diff --git a/arcadia-finance/scripts/arcadia.mjs b/arcadia-finance/scripts/arcadia.mjs deleted file mode 100644 index 766380c2..00000000 --- a/arcadia-finance/scripts/arcadia.mjs +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env node - -/** - * CLI wrapper for Arcadia Finance MCP server. - * Connects to the remote endpoint and calls tools by name. - * - * Usage: - * node arcadia.mjs '' - * node arcadia.mjs --list - * - * Requires: npm install @modelcontextprotocol/sdk - */ - -import { Client } from "@modelcontextprotocol/sdk/client/index.js"; -import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; - -const ENDPOINT = process.env.ARCADIA_MCP_URL || "https://mcp.arcadia.finance/mcp"; -const [toolName, argsJson] = process.argv.slice(2); - -if (!toolName) { - console.error("Usage: node arcadia.mjs ''"); - console.error(" node arcadia.mjs --list"); - process.exit(1); -} - -const client = new Client({ name: "arcadia-openclaw", version: "1.0.0" }); -const transport = new StreamableHTTPClientTransport(new URL(ENDPOINT)); -await client.connect(transport); - -try { - if (toolName === "--list") { - const { tools } = await client.listTools(); - for (const t of tools.sort((a, b) => a.name.localeCompare(b.name))) { - console.log(`${t.name}: ${t.description?.substring(0, 120)}`); - } - } else { - const args = argsJson ? JSON.parse(argsJson) : {}; - const result = await client.callTool({ name: toolName, arguments: args }); - const text = result.content?.[0]?.text ?? ""; - if (result.isError) { - console.error(`ERROR: ${text}`); - process.exitCode = 1; - } else { - console.log(text); - } - } -} finally { - await client.close(); -} diff --git a/arcadia-finance/scripts/arcadia.sh b/arcadia-finance/scripts/arcadia.sh new file mode 100755 index 00000000..c2bdf792 --- /dev/null +++ b/arcadia-finance/scripts/arcadia.sh @@ -0,0 +1,87 @@ +#!/bin/bash +# CLI wrapper for Arcadia Finance MCP server. +# Uses curl + jq to call tools over Streamable HTTP. +# +# Usage: +# ./arcadia.sh '' +# ./arcadia.sh --list +# +# Requires: curl, jq + +set -euo pipefail + +MCP_URL="${ARCADIA_MCP_URL:-https://mcp.arcadia.finance/mcp}" + +for bin in curl jq; do + if ! command -v "$bin" >/dev/null 2>&1; then + echo "Required: $bin" >&2 + exit 1 + fi +done + +TOOL_NAME="${1:-}" +ARGS_JSON="${2:-"{}"}" + +if [[ -z "$TOOL_NAME" ]]; then + echo "Usage: $0 ''" + echo " $0 --list" + exit 1 +fi + +HEADERS_FILE=$(mktemp) +trap 'rm -f "$HEADERS_FILE"' EXIT + +# Parse SSE response: extract the data: line and parse as JSON +parse_sse() { + grep '^data: ' | head -1 | sed 's/^data: //' +} + +# Initialize session +INIT_RESPONSE=$(curl -sf -X POST "$MCP_URL" \ + -H "Content-Type: application/json" \ + -H "Accept: application/json, text/event-stream" \ + -D "$HEADERS_FILE" \ + -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"arcadia-bankr","version":"1.0.0"}}}') + +SESSION_ID=$(grep -i 'mcp-session-id' "$HEADERS_FILE" | awk '{print $2}' | tr -d '\r') + +# Send initialized notification +curl -sf -X POST "$MCP_URL" \ + -H "Content-Type: application/json" \ + -H "Accept: application/json, text/event-stream" \ + -H "Mcp-Session-Id: $SESSION_ID" \ + -d '{"jsonrpc":"2.0","method":"notifications/initialized"}' \ + -o /dev/null 2>/dev/null || true + +if [[ "$TOOL_NAME" == "--list" ]]; then + RESPONSE=$(curl -sf -X POST "$MCP_URL" \ + -H "Content-Type: application/json" \ + -H "Accept: application/json, text/event-stream" \ + -H "Mcp-Session-Id: $SESSION_ID" \ + -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}') + + echo "$RESPONSE" | parse_sse | jq -r '.result.tools | sort_by(.name)[] | "\(.name): \(.description[0:120])"' +else + PAYLOAD=$(jq -nc --arg name "$TOOL_NAME" --argjson args "$ARGS_JSON" \ + '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":$name,"arguments":$args}}') + + RESPONSE=$(curl -sf -X POST "$MCP_URL" \ + -H "Content-Type: application/json" \ + -H "Accept: application/json, text/event-stream" \ + -H "Mcp-Session-Id: $SESSION_ID" \ + -d "$PAYLOAD") + + RESULT=$(echo "$RESPONSE" | parse_sse) + IS_ERROR=$(echo "$RESULT" | jq -r '.result.isError // false') + TEXT=$(echo "$RESULT" | jq -r '.result.content[0].text // empty') + + if [[ "$IS_ERROR" == "true" ]]; then + echo "ERROR: $TEXT" >&2 + exit 1 + else + echo "$TEXT" + fi +fi + +# Cleanup session +curl -sf -X DELETE "$MCP_URL" -H "Mcp-Session-Id: $SESSION_ID" -o /dev/null 2>/dev/null || true From cdf8e8a80302e32312e1d640c046279ded66dbfc Mon Sep 17 00:00:00 2001 From: Thomas Smets Date: Fri, 20 Mar 2026 11:24:23 +0100 Subject: [PATCH 4/5] Add connection error handling in CLI script --- arcadia-finance/scripts/arcadia.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arcadia-finance/scripts/arcadia.sh b/arcadia-finance/scripts/arcadia.sh index c2bdf792..9c0b3129 100755 --- a/arcadia-finance/scripts/arcadia.sh +++ b/arcadia-finance/scripts/arcadia.sh @@ -45,6 +45,11 @@ INIT_RESPONSE=$(curl -sf -X POST "$MCP_URL" \ SESSION_ID=$(grep -i 'mcp-session-id' "$HEADERS_FILE" | awk '{print $2}' | tr -d '\r') +if [[ -z "$SESSION_ID" ]]; then + echo "Failed to connect to $MCP_URL" >&2 + exit 1 +fi + # Send initialized notification curl -sf -X POST "$MCP_URL" \ -H "Content-Type: application/json" \ From 6ad29cd8035913b957c535aca52eb7d96807d596 Mon Sep 17 00:00:00 2001 From: Thomas Smets Date: Fri, 20 Mar 2026 11:26:02 +0100 Subject: [PATCH 5/5] Add version field and troubleshooting section --- arcadia-finance/SKILL.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arcadia-finance/SKILL.md b/arcadia-finance/SKILL.md index 11a20dad..b545821b 100644 --- a/arcadia-finance/SKILL.md +++ b/arcadia-finance/SKILL.md @@ -1,5 +1,6 @@ --- name: arcadia-finance +version: 1.0.0 description: DeFi liquidity management via Arcadia Finance. Use when the user wants to provide liquidity on Uniswap V3 or Aerodrome Slipstream, deploy concentrated LP positions, add or remove liquidity, set up automated rebalancing or compounding, borrow against LP collateral, manage yield farming, check PnL, use leverage, or optimize DeFi yields on Base or Unichain. Returns unsigned transactions for Bankr to sign and submit. metadata: { @@ -167,6 +168,19 @@ bankr prompt "Submit this transaction: $TX" The CLI connects to `https://mcp.arcadia.finance/mcp` by default. Set `ARCADIA_MCP_URL` to override. +## Troubleshooting + +**"Failed to connect"**: The MCP server at `mcp.arcadia.finance` is unreachable. Check your network or set `ARCADIA_MCP_URL` if using a local instance. + +**"ERROR: ..."**: The MCP server returned an error. Common causes: +- Invalid account/wallet address (must be valid hex `0x...`) +- Missing required parameters (run `scripts/arcadia.sh --list` to see tool descriptions) +- Chain not supported (only Base 8453 and Unichain 130) + +**Empty response from write tools**: The tool returned a transaction object. Pipe it to Bankr: `bankr prompt "Submit this transaction: $TX"` + +**Rate limiting**: The server allows 60 requests per minute per session. Space out batch operations. + ## References - **[Contract Addresses](references/contracts.md)**: Protocol contracts, lending pools, key tokens