Skip to content

BootNodeDev/agentic-defi

Repository files navigation

Agentic DeFi

DeFi skills for AI agents — supply, borrow, stake, and manage positions across protocols using the Agentic Wallet.

What is this?

A collection of protocol-specific skills that teach AI agents (Claude, etc.) how to interact with DeFi protocols through the Agentic Wallet MCP. Each skill provides:

  • CLI scripts for encoding transactions and fetching on-chain data
  • ABI encoding patterns for the agent to construct calldata
  • Permission templates for scoped, time-limited access
  • Workflow guidance: discover opportunities → grant permissions → execute → verify

Available Skills

Protocol Status Skill
Aave V3 Available skills/aave-agentic-wallet/SKILL.md
SparkLend Available skills/spark-agentic-wallet/SKILL.md
Merkl Available skills/merkl-agentic-wallet/SKILL.md
Lido Coming soon
Morpho Coming soon

Aave V3

Supply, borrow, repay, and withdraw across Ethereum, Arbitrum, Optimism, Polygon, Base, and Avalanche. Includes APY ranking, health factor monitoring, and atomic approve+action batching.

# Fetch supply/borrow APYs across all networks
node dist/skills/aave-agentic-wallet/aave.js opportunities --network all

# Check position health
node dist/skills/aave-agentic-wallet/aave.js position --wallet 0x... --network arbitrum

SparkLend

Supply, borrow, repay, and withdraw on Ethereum and Gnosis. SparkLend is an Aave V3 fork focused on DAI/USDS and stablecoin lending from Sky's reserves.

# Fetch supply/borrow APYs
node dist/skills/spark-agentic-wallet/spark.js opportunities --network ethereum

# Check position health
node dist/skills/spark-agentic-wallet/spark.js position --wallet 0x... --network ethereum

Merkl

Browse incentivized DeFi opportunities, check unclaimed rewards, and claim Merkl rewards across 50+ chains. Merkl is a reward distribution layer — it incentivizes positions on other protocols like Aave, SparkLend, Morpho, and more.

# Browse top opportunities by APR
node dist/skills/merkl-agentic-wallet/merkl.js opportunities --chain-id 1

# Check unclaimed rewards
node dist/skills/merkl-agentic-wallet/merkl.js check-rewards --wallet 0x...

# Encode a claim transaction
node dist/skills/merkl-agentic-wallet/merkl.js claim-rewards --wallet 0x... --chain-id 1

MCP Server

This project is also available as a standalone MCP server, exposing all DeFi skills as MCP tools consumable by any MCP-compatible agent (Claude, Cursor, Windsurf, custom agents).

The server provides read-only and encoding operations — it does not sign or submit transactions. Your agent handles signing via its own wallet integration.

Install

npx @bootnodedev/defi-mcp-server

Configure in your MCP client

{
  "mcpServers": {
    "defi": {
      "type": "stdio",
      "command": "npx",
      "args": ["@bootnodedev/defi-mcp-server"]
    }
  }
}

HTTP mode

npx @bootnodedev/defi-mcp-server --http --port 3000

Available tools (10)

Tool Description
defi_guide Overview of all tools, workflows, and key rules — call before your first DeFi operation
aave_get_opportunities Aave V3 supply/borrow APY rates, top reserves ranked by supply APY
aave_check_position Wallet health factor, collateral, and debt on Aave V3
aave_get_permissions Permission params for Aave V3 — pass result to agentic-wallet grant_permissions
aave_encode Encode Aave V3 calldata (supply, borrow, repay, withdraw)
spark_get_opportunities SparkLend supply/borrow APY rates
spark_check_position Wallet health factor, collateral, and debt on SparkLend
spark_get_permissions Permission params for SparkLend
spark_encode Encode SparkLend calldata (supply, borrow, repay, withdraw)
merkl Merkl reward management — browse opportunities, check rewards, claim rewards

The *_get_opportunities tools return the top 10 reserves per network by default, with slim fields to minimize token usage. Optional parameters:

  • token — filter by token symbol (e.g. USDC) or contract address (case-insensitive)
  • limit — max reserves per network (default: 10)
  • detailed — include all fields like availableLiquidity, liquidationThreshold, canBeCollateral (default: false)

The merkl tool uses subcommands: get_opportunities, check_rewards, claim_rewards.

Claude Code Plugin

This project is packaged as a Claude Code plugin. Install it to get:

  • /agentic-defi:aave slash command — Run Aave operations directly (supply, borrow, repay, withdraw, position, opportunities, permissions)
  • /agentic-defi:spark slash command — Run SparkLend operations directly (supply, borrow, repay, withdraw, position, opportunities, permissions)
  • /agentic-defi:merkl slash command — Browse Merkl opportunities, check and claim rewards
  • SessionStart hook — Automatically checks that the agentic-wallet MCP server is configured when a session starts

Install as plugin

# Add the marketplace
/plugin marketplace add BootNodeDev/agentic-defi

# Install the plugin
/plugin install agentic-defi@agentic-defi

# Or for local development
claude --plugin-dir /path/to/agentic-defi

Usage

/agentic-defi:aave supply --network arbitrum --asset USDC --amount 100 --wallet 0x...
/agentic-defi:aave position --network arbitrum --wallet 0x...
/agentic-defi:aave opportunities --network all

/agentic-defi:spark supply --network ethereum --asset DAI --amount 1000 --wallet 0x...
/agentic-defi:spark opportunities --network ethereum

/agentic-defi:merkl opportunities --chain-id 1
/agentic-defi:merkl check-rewards --wallet 0x...
/agentic-defi:merkl claim-rewards --wallet 0x... --chain-id 1

Setup

npm install

Requires the Agentic Wallet MCP to be configured in your AI coding agent for transaction signing and submission.

How It Works

Agent receives user intent (e.g. "supply 100 USDC on Aave")
  ↓
Skill guides the agent through the workflow:
  1. Check wallet status and permissions
  2. Fetch opportunities / current position
  3. Encode calldata (viem)
  4. Send transaction via Agentic Wallet MCP
  5. Verify on-chain result

Skills are designed as agent-readable documentation — structured so that LLMs can follow them step-by-step without human intervention.

Adding a New Skill

Each skill lives in skills/<protocol>/ and must include a SKILL.md with:

  1. Overview of the protocol interaction model
  2. CLI scripts for common operations
  3. Contract addresses per network
  4. ABI encoding examples
  5. Permission setup templates
  6. Common mistakes and how to avoid them

Register the skill in CLAUDE.md under the Skills section.

License

ISC

About

DeFi for Agents

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors