Arbitrum DeFi Strategist Agent

AI agent for multi-protocol DeFi analysis and execution on Arbitrum One

ERC-8004 Registered 14 Tools Agent ID: 165 A2A Compatible
14
Agent Tools
5
Protocols
100
GMX Markets
165
Agent ID

Protocol Integrations

GMX V2 Perpetuals

Market listing, open interest analysis, long/short imbalance detection, funding rate signals, position monitoring, borrowing factor tracking via DataStore direct reads.

Aave V3 Lending

Health factor monitoring, liquidation risk assessment (5-level: SAFE to LIQUIDATABLE), per-asset position breakdown, reserve APY comparison with proper RAY math.

Uniswap V3 DEX

Multi-fee-tier quoting (500/3000/10000 bps), swap execution with slippage protection via SwapRouter02.

Camelot DEX

Arbitrum-native DEX swap quoting for cross-DEX price comparison. Algebra-style concentrated liquidity.

Strategy Engine

Cross-protocol yield optimization, portfolio risk assessment (wallet + Aave HF + GMX leverage), personalized DeFi recommendations.

ERC-8004 Identity

On-chain agent identity registration on Arbitrum Identity Registry. Mints Agent NFT with metadata URI.

All 14 Tools

ToolDescriptionCategory
get_portfolioWallet balance overview (ETH + all ERC-20)Wallet
get_best_swap_quoteMulti-DEX quote comparison (Uniswap V3 + Camelot)DEX
execute_swapExecute swap with approval handlingDEX
gmx_list_marketsAll GMX V2 perpetual/spot marketsGMX
gmx_analyze_marketDeep market analysis: OI, funding signals, borrowingGMX
gmx_get_positionsAccount perpetual positionsGMX
aave_account_healthHealth factor + risk assessmentAave
aave_detailed_positionsPer-asset supply/borrow breakdownAave
aave_reserve_overviewAll reserve APYs and utilizationAave
find_yield_opportunitiesCross-protocol yield scannerStrategy
analyze_portfolio_riskMulti-protocol risk assessmentStrategy
get_strategy_recommendationPersonalized DeFi strategyStrategy
register_agentERC-8004 identity registrationRegistry
get_agent_infoQuery agent registryRegistry

Live Demo Output

Real data fetched live from Arbitrum One mainnet:

══════════════════════════════════════════════════════ 1. WALLET PORTFOLIO (GMX Treasury) ══════════════════════════════════════════════════════ Address: 0x489ee077994B6658eAfA855C308275EAd8097C4A WETH: 6.575 · USDC: 21,772.22 · USDT: 2,716.62 DAI: 5,183.41 · WBTC: 6.742 ══════════════════════════════════════════════════════ 2. MULTI-DEX SWAP QUOTE (1 WETH → USDC) ══════════════════════════════════════════════════════ Uniswap V3 (500bps): 2,054.99 USDC ← Best Camelot: 2,053.41 USDC Uniswap V3 (3000bps): 2,052.78 USDC Uniswap V3 (10000): 2,026.77 USDC Price spread: 1.39% ══════════════════════════════════════════════════════ 3. GMX V2 PERPETUAL MARKETS (100 total) ══════════════════════════════════════════════════════ BTC/USD [WBTC-USDC] · WETH/USD [WETH-USDC] SOL/USD [SOL-USDC] · LINK/USD [LINK-USDC] Deep Analysis — OI imbalance + funding signals ══════════════════════════════════════════════════════ 4. AAVE V3 RESERVES (Top by Supply APY) ══════════════════════════════════════════════════════ DAI Supply: 1.92% Borrow: 3.83% Util: 67.6% USDC Supply: 1.81% Borrow: 6.52% Util: 56.8% WETH Supply: 1.66% Borrow: 2.32% Util: 84.4% USDT Supply: 1.53% Borrow: 2.78% Util: 61.6% ══════════════════════════════════════════════════════ 5. CROSS-PROTOCOL YIELD OPPORTUNITIES ══════════════════════════════════════════════════════ [LOW] Aave V3 — DAI: 1.92% APY [LOW] Aave V3 — USDC: 1.81% APY [LOW] Aave V3 — WETH: 1.66% APY ══════════════════════════════════════════════════════ 6. PORTFOLIO RISK ASSESSMENT ══════════════════════════════════════════════════════ Overall Risk: LOW · Total Value: ~$21,772 "No significant risk factors detected."

ERC-8004 Registration

Agent ID: 165

Registry: 0x8004A818BFB912233c491871b3d84c89A494BD9e (Arbitrum Sepolia)

Registration TX: 0xcd92b197...d85e86

Owner: 0xd2D120eB7cEd38551cCeFb48021067d41D6542d3

API Examples

Multi-DEX Swap Quote

curl -X POST /execute \
  -H "Content-Type: application/json" \
  -d '{"tool": "get_best_swap_quote", "params": {"tokenIn": "WETH", "tokenOut": "USDC", "amountIn": "1"}}'

GMX Market Analysis

curl -X POST /execute \
  -H "Content-Type: application/json" \
  -d '{"tool": "gmx_analyze_market", "params": {"marketToken": "0x70d95587d40A2caf56bd97485aB3Eec10Bee6336"}}'

Portfolio Risk Assessment

curl -X POST /execute \
  -H "Content-Type: application/json" \
  -d '{"tool": "analyze_portfolio_risk", "params": {"address": "0x489ee077994B6658eAfA855C308275EAd8097C4A"}}'

Architecture

┌──────────────────────────────────────────────────┐
│             Agent HTTP Endpoint                   │
│          (Express.js — A2A compatible)           │
├──────────────────────────────────────────────────┤
│               Tool Layer (14 tools)               │
│        JSON Schema parameter definitions          │
├───────────┬──────────┬──────────┬────────────────┤
│  Wallet   │   DEX    │  GMX V2  │   Aave V3      │
│  Service  │ Service  │ Service  │   Service      │
│           │(Uni+Cam) │          │                │
├───────────┴──────────┴──────────┴────────────────┤
│             Strategy Engine                       │
│  Yield optimization · Risk assessment            │
│  Cross-protocol analysis · Recommendations       │
├──────────────────────────────────────────────────┤
│             viem (Arbitrum One)                    │
└──────────────────────────────────────────────────┘

Quick Start

git clone https://github.com/0xCaptain888/arbitrum-defi-agent-skill.git
cd arbitrum-defi-agent-skill
npm install

# Run demo (no private key needed)
npx tsx scripts/demo.ts

# Start agent server
npm run dev
# Server at http://localhost:3000

# Or run compiled version directly
node dist/index.js