Track Your Claude Agent's DeFi Portfolio: MCP Tools for Position Monitoring
DeFi portfolio tracking gets complicated fast when you're running AI agents across multiple protocols. Your Claude agent might be executing swaps on Jupiter, staking on Lido, and providing liquidity on Aave, but you have no visibility into the positions it's building or their performance over time.
Most developers end up writing custom scripts to query each protocol separately, then manually correlating addresses and calculating PnL. But there's a cleaner approach: MCP tools that give Claude native DeFi awareness.
Why Portfolio Visibility Matters for AI Agents
When Claude executes DeFi strategies autonomously, you need real-time insight into what it's doing with your capital. A lending position might be approaching liquidation. A staking reward might be ready to compound. Or a liquidity position might have drifted out of range.
Without portfolio monitoring, your agent is flying blind. It might keep depositing into a protocol that's no longer profitable, or miss opportunities to rebalance positions for better yields.
WAIaaS MCP Tools for DeFi Position Tracking
WAIaaS provides 45 MCP tools for AI agent integration, including dedicated tools for DeFi position monitoring across 15 integrated protocols. Once configured, Claude can query positions, track yields, and make informed decisions about rebalancing.
The get-defi-positions tool returns a unified view of all positions across protocols:
# Configure MCP server in Claude Desktop
{
"mcpServers": {
"waiaas": {
"command": "npx",
"args": ["-y", "@waiaas/mcp"],
"env": {
"WAIAAS_BASE_URL": "http://127.0.0.1:3100",
"WAIAAS_SESSION_TOKEN": "wai_sess_<your-token>",
"WAIAAS_DATA_DIR": "~/.waiaas"
}
}
}
}
Once configured, Claude can track positions with natural language:
User: "Show me my DeFi positions"
→ Claude calls get_defi_positions tool
→ Returns positions across Aave, Lido, Jupiter, etc.
User: "Which positions are most profitable?"
→ Claude analyzes APY and PnL data
→ Suggests rebalancing opportunities
Setting Up DeFi Portfolio Monitoring
Here's how to get Claude monitoring your agent's DeFi positions:
1. Start WAIaaS with Docker
git clone https://github.com/minhoyoo-iotrust/WAIaaS.git
cd WAIaaS
docker compose up -d
2. Create a wallet and session
# Install CLI
npm install -g @waiaas/cli
# Quick setup
waiaas quickset --mode mainnet
This creates wallets on multiple chains and generates MCP configuration automatically.
3. Configure Claude Desktop
The quickset command outputs the MCP configuration. Copy it to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Or auto-register all wallets:
waiaas mcp setup --all
4. Test portfolio monitoring
Restart Claude Desktop and try:
- "What DeFi positions do I have?"
- "Show me my yields across all protocols"
- "Which positions have the highest APY?"
Real-Time Position Monitoring
WAIaaS tracks positions across 15 DeFi protocols: aave-v3, across, dcent-swap, drift, erc8004, hyperliquid, jito-staking, jupiter-swap, kamino, lido-staking, lifi, pendle, polymarket, xrpl-dex, zerox-swap.
The get-defi-positions tool returns structured data for each position:
{
"positions": [
{
"protocol": "aave-v3",
"type": "lending",
"asset": "USDC",
"amount": "1000.50",
"apy": "4.2%",
"healthFactor": "2.15",
"value_usd": "1000.50"
},
{
"protocol": "lido-staking",
"type": "staking",
"asset": "stETH",
"amount": "0.5",
"apy": "3.8%",
"rewards_pending": "0.002",
"value_usd": "1250.00"
}
],
"total_value_usd": "2250.50"
}
Claude can then analyze this data and make recommendations about rebalancing, harvesting rewards, or adjusting risk exposure.
Health Factor Monitoring for Lending Positions
For lending protocols like Aave, WAIaaS provides the get-health-factor tool to monitor liquidation risk:
curl http://127.0.0.1:3100/v1/wallet/health-factor \
-H "Authorization: Bearer wai_sess_<token>"
Claude can monitor health factors and suggest actions:
- Health factor > 2.0: "Position is safe"
- Health factor 1.5-2.0: "Consider adding collateral"
- Health factor < 1.5: "Liquidation risk - reduce position size"
Automated Yield Optimization
With position visibility, Claude can optimize yields automatically. For example:
User: "Optimize my staking yields"
→ Claude checks current staking positions
→ Compares APY across Lido vs Jito staking
→ Suggests rebalancing: "Move 30% from Lido (3.8% APY) to Jito (4.2% APY)"
→ Executes rebalancing with user approval
The MCP integration includes tools for cross-chain bridging via LI.FI and Across protocols, so Claude can move assets between chains to access better yields.
Policy-Based Risk Management
WAIaaS includes 21 policy types with 4 security tiers (INSTANT, NOTIFY, DELAY, APPROVAL) to manage DeFi risk:
# Create lending policy
curl -X POST http://localhost:3100/v1/policies \
-H 'Content-Type: application/json' \
-H 'X-Master-Password: <password>' \
-d '{
"walletId": "<wallet-uuid>",
"type": "LENDING_LTV_LIMIT",
"rules": {
"max_ltv": 0.75,
"protocols": ["aave-v3", "kamino"]
}
}'
This prevents Claude from taking on excessive leverage even when chasing yields.
Performance Analytics
The Admin Web UI at /admin provides a dashboard for DeFi positions with historical performance, yield tracking, and risk metrics. Claude can reference this data when making strategic decisions about position sizing and protocol selection.
Quick Start Guide
- Deploy WAIaaS:
docker compose up -d - Create wallets:
waiaas quickset --mode mainnet - Configure Claude: Copy MCP config to
claude_desktop_config.json - Fund wallets: Transfer tokens to generated addresses
- Start trading: Tell Claude to execute DeFi strategies
Your agent now has full visibility into its DeFi portfolio and can make data-driven decisions about yield optimization, risk management, and capital allocation.
What's Next
WAIaaS provides the infrastructure layer for autonomous DeFi agents with built-in risk management and portfolio monitoring. Explore the full codebase at GitHub or learn more about MCP integration at waiaas.ai.