Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
190 changes: 190 additions & 0 deletions arcadia-finance/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
---
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:
{
"clawdbot":
{
"emoji": "🏛️",
"homepage": "https://arcadia.finance",
"requires": { "bins": ["curl", "jq", "bankr"] },
},
}
---

# Arcadia Finance

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 Wallet Positions

First, discover the user's accounts from their wallet address:

```
What Arcadia accounts do I have?
```

Then inspect a specific account:

```
Show me the details of my Arcadia account 0x...
```

### Deploy a New LP Position

```
What are 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
```

### 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
```

## Capabilities

- **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

## CLI Usage

```bash
scripts/arcadia.sh <tool_name> '<json_args>'
scripts/arcadia.sh --list
```

Requires: `curl`, `jq`. No npm dependencies.

## Read Operations

```bash
# 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 PnL and yield earned
scripts/arcadia.sh read_account_pnl '{"account_address":"0x..."}'

# Featured LP strategies with APY (start here)
scripts/arcadia.sh read_strategy_list '{"featured_only":true}'

# Lending pools: TVL, APY, utilization, borrow rates
scripts/arcadia.sh read_pool_list

# Available automations and their parameters
scripts/arcadia.sh read_asset_manager_intents

# Workflow guides
scripts/arcadia.sh read_guides '{"topic":"overview"}'
```

## Write Operations

All write tools return unsigned transactions `{ to, data, value, chainId }`. Submit via Bankr:

```bash
# 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 (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"
```

```bash
# Enable rebalancer automation
TX=$(scripts/arcadia.sh write_asset_manager_rebalancer '{"dex_protocol":"slipstream"}')
bankr prompt "Submit this transaction: $TX"
```

## Common Workflows

### First-Time User

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** 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 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 before borrow/deleverage operations. Higher = safer (1 = no debt, 0 = liquidation).
- Never pass private keys as tool arguments.

## Configuration

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
- **[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
32 changes: 32 additions & 0 deletions arcadia-finance/references/contracts.md
Original file line number Diff line number Diff line change
@@ -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.
28 changes: 28 additions & 0 deletions arcadia-finance/references/wallet-signing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Signing Transactions via Bankr

All Arcadia write tools return unsigned transactions as `{ to, data, value, chainId }`. Use Bankr to sign and broadcast.

## Single Transaction

```bash
TX=$(scripts/arcadia.sh write_account_create '{"wallet_address":"0x...","chain_id":8453}')
bankr prompt "Submit this transaction: $TX"
```

## Multi-Step (Approve + Deposit)

```bash
# 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=$(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 borrow/deleverage.
- Never pass private keys as tool arguments.
92 changes: 92 additions & 0 deletions arcadia-finance/scripts/arcadia.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/bash
# CLI wrapper for Arcadia Finance MCP server.
# Uses curl + jq to call tools over Streamable HTTP.
#
# Usage:
# ./arcadia.sh <tool_name> '<json_args>'
# ./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 <tool_name> '<json_args>'"
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')

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" \
-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