An autonomous multi-agent DeFi system for yield optimization and portfolio management, built on Arbitrum. Powered by Bun, Hono, Vercel AI SDK, OpenAI, Brahma's ConsoleKit, Safe Smart Account, Supabase, Stakekit Viem, and more.
Necta Agents is an AI-powered DeFi automation system that:
- Monitors market conditions and wallet status
- Identifies optimal yield opportunities to maximize returns
- Executes transactions securely through Brahma accounts (powered by Safe Smart Account)
- Operates autonomously with no human intervention required
The system consists of three main AI agents working together:
-
Sentinel Agent: Market analysis and opportunity detection
- Monitors market conditions
- Tracks wallet status
- Generates intelligence reports
-
Curator Agent: Strategy formulation and task generation
- Analyzes Sentinel reports
- Determines optimal actions
- Curates executable tasks
-
Executor Agent: Secure transaction execution
- Processes tasks into transactions
- Executes via Brahma ConsoleKit
- Verifies transaction success
-
Infrastructure
- Event Bus: Inter-agent communication system
- Memory System: Supabase for persistent storage
-
Data Sources
- Market Data: Stakekit for Protocol yields and token prices
- Wallet Status: Account balances and positions
-
Onchain Execution: Brahma ConsoleKit
- Hono
- Bun
- Supabase account
- ConsoleKit API key
- OpenAI API key
- Vercel AI SDK
- Brahma ConsoleKit
- Safe Smart Account
- Stakekit API key
- Clone and install:
git clone https://github.com/NectaFi/necta-agents.git
cd necta-agents
bun install
- Configure environment:
cp .env.example .env
- Register Executor (Gasless)
ENABLE_AGENTS=true bun src/index.ts
-
Create Brahma Account
- Visit Console.fi
- Connect wallet (same as executor)
- Create Brahma account
- Create subscription with registered executor
- Fund account with USDC
-
Add Brahma Account
BRAHMA_ACCOUNT_ADDRESS="0x..."
- Non-custodial: All funds remain in Brahma account
- Secure execution: ConsoleKit handles transaction security
- Limited permissions: Executor only signs transaction data
- Transaction simulation: All transactions are simulated before execution
src/
├── agents/ # Agent implementations
│ ├── agent.ts # Base agent class
│ ├── index.ts # Agent system initialization
│ ├── curator/ # Curator agent
│ │ ├── index.ts
│ │ └── toolkit.ts
│ ├── executor/ # Executor agent
│ │ ├── index.ts
│ │ └── toolkit.ts
│ └── sentinel/ # Sentinel agent
│ ├── index.ts
│ └── toolkit.ts
├── services/ # External services integration
│ └── console-kit/ # ConsoleKit integration
│ ├── index.ts
│ ├── core-actions.ts
│ ├── deploy-automation-account.ts
│ ├── register-executor.ts
│ ├── types.ts
│ └── utils.ts
├── system-prompts/ # Agent behavior definitions
│ ├── index.ts
│ ├── curator-system-prompt.ts
│ ├── executor-system-prompt.ts
│ └── sentinel-system-prompt.ts
├── data/ # Data fetching and processing
│ ├── index.ts
│ ├── stakekit.ts
│ ├── stakekit.test.ts
│ └── types.ts
├── comms/ # Inter-agent communication
│ ├── index.ts
│ └── event-bus.ts
├── config/ # Chain and protocol configs
│ ├── index.ts
│ └── chains.ts
├── app.ts # Hono app setup
├── env.ts # Environment configuration
├── index.ts # Main entry point
└── setup.ts # System initialization
src/agents/index.ts
: Agent system initializationsrc/services/console-kit/
: ConsoleKit integrationsrc/system-prompts/
: Agent behavior definitionssrc/data/
: Market data and protocol integrations
-
Extend Agent Capabilities
- Add tools in agent's toolkit
- Update system prompts
- Register new event handlers
-
Add Protocol Support
- Add protocol addresses
- Implement data fetching
- Update transaction building
MIT License - See LICENSE for details
This code is provided as-is with no guarantees. Not audited. Use at your own risk. Not financial advice.