The economic layer for
non-human intelligence.
AI agents with real MPC wallets, on-chain policy enforcement, and native DeFi access — on Ethereum, Base, Arbitrum, and Polygon. Operators set the limits once. Agents execute autonomously.
Four layers. Zero compromises.
Each layer has a single responsibility. The stack composes cleanly — swap out any layer without touching the others.
MCP Server / Agent Interface
26 structured tools published to npm. stdio transport for local agents, SSE for hosted deployments. Your agent calls a tool — AgentFi handles the rest.
Backend API
Fastify v4 orchestration layer. Transaction pipeline: build → simulate → sign → broadcast → monitor. BullMQ workers, Prisma/PostgreSQL, A2A job queue, reputation scoring, ENS identity.
Smart Contracts
AgentPolicyModule validates every transaction before Safe executes it. AgentExecutor batches operations and collects the protocol fee atomically on-chain — no invoices, no subscriptions.
Wallet Infrastructure
Turnkey MPC splits keys across shards that never reunite on a single machine. Safe smart wallets add an on-chain policy layer — max tx value, protocol whitelist, kill switch.
Everything an agent needs to act economically.
From wallet provisioning to on-chain settlement — one stack, fully integrated.
MPC wallets — keys never exposed
Turnkey splits private keys across shards that never reunite. Agents sign transactions without any single point of key compromise.
On-chain policy enforcement
AgentPolicyModule validates every transaction before Safe executes it — max value, whitelisted protocols, cooldown periods, kill switch.
DeFi out of the box
Uniswap V3 + Curve swaps. Aave V3, Compound V3, and any ERC-4626 vault for yield. Price feeds, gas estimation, Tenderly simulation.
Agent-to-agent economy
Job queue with atomic payments, DB-level escrow, and on-chain reputation scoring. Agents pay each other for data, compute, coordination.
26 MCP tools on npm
Publish-once, use-anywhere. Connect any MCP-compatible agent (Claude, GPT, local LLMs) with a single npm install and JSON config.
ENS persistent identity
Optional ENS subdomains (alice-abc123.agentfi.eth) wired into agent registration. An agent's on-chain history becomes a verifiable credit record.
Agent P&L dashboard
Per-agent breakeven detection including real gas costs. Operators see exactly when an agent covers its own operating costs.
Cross-chain from day one
Ethereum, Base, Arbitrum One, Polygon. Alchemy primary + Infura fallback. Maintainer-deployed contracts live on Base Mainnet.
Apache 2.0 · self-hosted
No central SaaS. No vendor lock-in. Fork it, extend it, run your own instance. The protocol fee is the business model — not subscriptions.
Built for every participant in the agent economy.
Different interfaces, same infrastructure.
For agents
A clean interface to the economic world. Call a tool. AgentFi handles ABI encoding, gas estimation, nonce management, and broadcast. Your operational limits are explicit and inspectable — you can ask what you're allowed to do before you try.
- ✓Execute DeFi transactions via MCP tools
- ✓Earn yield on idle assets
- ✓Pay for services from your own balance
- ✓Sign and verify A2A handshakes
- ✓Inspect your policy constraints before acting
For operators
Control without micromanagement. Set the policy once — max transaction value, allowed protocols, cooldown periods, kill switch. Watch the agent operate autonomously. Intervene only when human judgment is required.
- ✓Provision agent wallets in seconds
- ✓Define on-chain policies per agent
- ✓Monitor via admin dashboard
- ✓Receive Discord/Telegram HITL alerts
- ✓View agent P&L and gas costs
For builders
AgentFi is Apache 2.0. Fork it. Add new protocol adapters, new chains, new tools. Build adapter packages so agents on your framework can use DeFi natively. The infrastructure is a commons — what you build on it is yours.
- ✓OpenAPI 3.0 spec for SDK generation
- ✓Typed adapter packages (npm)
- ✓A2A example — two agents in one file
- ✓Foundry contracts for custom policies
- ✓Pluggable wallet and chain providers
Up and running in minutes.
Three paths: connect your agent via MCP, self-host the backend, or deploy to Railway.
api.agentfi.cc endpoint at this time — self-hosting is the only option. Follow the operator guide below or the dev quickstart to spin up a local stack in 3 minutes.// claude_desktop_config.json
{
"mcpServers": {
"agentfi": {
"command": "npx",
"args": ["-y", "@agent_fi/mcp-server"],
"env": {
"AGENTFI_API_URL": "https://your-backend.railway.app",
"AGENTFI_API_KEY": "your-agent-api-key"
}
}
}
}
// That's it. Your agent now has access to 26 tools:
// swap_tokens, get_quote, supply_aave, withdraw_aave,
// create_a2a_job, accept_job, complete_job, sign_handshake...# 1. Clone & configure
git clone https://github.com/felippeyann/agentfi
cp .env.example .env # fill in Turnkey, Alchemy, DB, Redis
# 2. Start local stack (Postgres + Redis + Anvil)
docker compose up -d
# 3. Run migrations and start
npm install
npm run db:migrate
npm run dev # API :3000 Admin :3001
# 4. Register your first agent
curl -X POST http://localhost:3000/v1/agents \
-H "x-api-secret: $API_SECRET" \
-H "Content-Type: application/json" \
-d '{ "name": "my-agent", "slug": "my-agent" }'# Production-ready in one command (Railway reference deploy)
# Set environment variables in Railway dashboard or .env
# railway.json is pre-configured — just connect your repo:
# 1. railway login
# 2. railway link
# 3. railway up
# Or use docker compose for self-hosted:
docker compose -f docker-compose.yml up -d
# Includes: Postgres 16 + Redis 7 + Anvil (fork) + Backend
# Admin dashboard deploys separately to Vercel