Making DeFi yield accessible to the next billion — starting with Africa.

Autonomous DeFi Co-Pilot for Leveraged Yield Farming on Arbitrum
Making DeFi yield accessible to the next billion — starting with Africa.
Built for the Arbitrum Open House NYC Online Buildathon.
Live on Arbitrum Sepolia: AgentConstitution | AgentExecutor
Over 400 million adults in Sub-Saharan Africa have no bank account. For those who do, savings accounts yield near-zero interest while inflation erodes purchasing power at 20-30% annually in countries like Nigeria, Ghana, and Kenya. Traditional finance has failed the continent — banks require documentation most people don't have, minimum balances that exclude the majority, and cross-border transfers that eat 8-12% in fees.
DeFi offers a way out. On-chain lending protocols like Aave V3 generate real yield — 3-8% APY on stablecoins — accessible to anyone with a wallet. But there's a catch: DeFi is too complex for most people. Managing leveraged positions, monitoring health factors, rebalancing LTV ratios, avoiding liquidation — this requires constant vigilance and deep technical knowledge that creates a new kind of exclusion.
The result: The people who need yield the most — African savers watching their money lose value every day — are locked out of the best opportunities in decentralized finance.
YieldPilot is an autonomous AI agent that manages leveraged yield farming so you don't have to.
You deposit collateral. The agent does the rest — borrowing, deploying to yield vaults, monitoring 24/7, rebalancing when needed, and protecting your funds with emergency repays. All governed by on-chain rules you control.
How it works:
User deposits WETH/wstETH/ARB
→ Agent borrows USDC via Aave V3
→ Deposits into ERC-4626 yield vaults
→ Monitors position every 5 minutes
→ Auto-rebalances when LTV drifts from target
→ Emergency repays if health factor drops
→ Optimizes yield when spread is positive and LTV is low
What makes it different:
No expertise required — the agent handles all DeFi complexity autonomously
On-chain governance — all rules (max LTV, min spread, kill switch) are stored in an immutable AgentConstitution smart contract, not a backend database
AI-powered transparency — chat with your agent in natural language to understand what it's doing and why
Cross-chain accessible — deposit from Ethereum, Optimism, or Base via LayerZero/Stargate bridging
Built on Arbitrum — low fees make autonomous rebalancing economically viable (pennies per transaction vs. dollars on L1)
┌────────────────────────────────────────────────────────────┐
│ Frontend (React + Vite) │
│ Landing · Dashboard · Create Agent · Agent Detail · Chat │
│ LTV Gauge · Terminal · Constitution Panel · Yield Metrics │
└──────────────────────────┬─────────────────────────────────┘
│ REST API
┌──────────────────────────▼─────────────────────────────────┐
│ Backend (FastAPI + Python) │
│ Autonomous Worker Loop · LTV Decision Engine │
│ Aave V3 Client · ERC-4626 Vault Client · Price Oracle │
│ LayerZero Bridge · AI Chat (Groq) · Telegram Notifications │
└─────────┬────────────────────────────────────┬─────────────┘
│ │
┌─────────▼──────────┐ ┌──────────▼──────────────┐
│ PostgreSQL │ │ Arbitrum Sepolia (L2) │
│ Agents, positions │ │ AgentConstitution.sol │
│ Actions, logs │ │ AgentExecutor.sol │
└────────────────────┘ │ Aave V3 Pool · Vaults │
└────────────────────────────┘
On-chain rule registry. Each agent has an owner who defines governance rules — max LTV, target LTV, minimum yield spread, pause/kill switches. The agent writes status updates on-chain for a full audit trail. Built with OpenZeppelin Ownable + Pausable.
Batched DeFi executor. Handles the full position lifecycle:
deployPosition() — Supply collateral → Borrow USDC → Deposit to vault (single tx)
autoRepay() — Withdraw from vault → Repay Aave debt
optimize() — Borrow more → Deposit to vault (with health factor check)
emergencyExit() — Withdraw all → Repay all → Return funds
Safety features: daily spend limits, vault whitelisting, collateral allowlisting, health factor floor (1.1), Pausable circuit breaker.
The autonomous worker evaluates every agent's position on a configurable cycle (default: 5 minutes):
Condition | Action | What Happens |
|---|---|---|
Health Factor < 1.1 OR LTV > 78.75% | EMERGENCY_REPAY | Withdraw from vault, repay debt to reach target LTV |
LTV > target (65%) | AUTO_REPAY | Partial repay to bring LTV back to target |
LTV < 50% AND spread > 2% | OPTIMIZE | Borrow more USDC, deposit to vault for higher yield |
Otherwise | HOLD | Log status, continue monitoring |
Every action is logged to the database and can be written on-chain via the AgentConstitution for full transparency.
Sponsor | Integration | Details |
|---|---|---|
Alchemy | RPC Provider | All on-chain reads/writes route through Alchemy. Account Kit (ERC-4337) upgrade path for gasless UX. |
LayerZero / Stargate | Cross-Chain Bridge | Users can deposit from Ethereum, Optimism, or Base — bridging to Arbitrum via Stargate. |
OpenZeppelin | Smart Contract Security | Both contracts use |
Dune Analytics | On-Chain Dashboard | Agent activity, TVL, and rebalancing history visualized via Dune queries on emitted events. |
Layer | Technology |
|---|---|
Smart Contracts | Solidity 0.8.20, Hardhat, OpenZeppelin 5.x, Aave V3 interfaces, ERC-4626 |
Backend | Python 3.9+, FastAPI, Web3.py, SQLAlchemy (async + asyncpg), Groq AI (LLaMA 3.1) |
Frontend | React 18, TypeScript, Vite, TailwindCSS, TanStack Query, RainbowKit, wagmi |
Infrastructure | PostgreSQL 16, Docker Compose, Arbitrum Sepolia testnet |
Oracles | Chainlink price feeds (mainnet), CoinGecko API (testnet fallback) |
Node.js v18+ — nodejs.org
Python 3.9+ — python.org
Docker — docker.com (for PostgreSQL)
Git — git-scm.com
git clone https://github.com/big14way/yieldpilot.git
cd yieldpilotService | URL | What You Need |
|---|---|---|
Alchemy | Create App → Arbitrum Sepolia → Copy API key | |
Groq | Get free API key for AI chat | |
Arbiscan | API key for contract verification |
cd contracts
npm install
cp .env.example .env
# Edit .env — add DEPLOYER_PRIVATE_KEY, ALCHEMY_API_KEY
npm run deploy:sepoliaSave the output CONSTITUTION_ADDRESS and EXECUTOR_ADDRESS.
cd ../api
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env — add ALCHEMY_API_KEY, GROQ_API_KEY, contract addresses
uvicorn main:app --reload --host 0.0.0.0 --port 8000cd ../app
npm install
cp .env.example .env
# Edit .env — add VITE_ALCHEMY_API_KEY
npm run devOpen http://localhost:3000
Click Launch App → New Agent
Choose collateral, name your agent, set constitution rules
Save the private key shown on the success page
Fund the agent wallet with testnet ETH
Watch the LTV gauge, terminal logs, and yield metrics update in real-time
Chat with your AI agent to understand its decisions
Method | Path | Description |
|---|---|---|
|
| System health check |
|
| Autonomous worker metrics |
|
| Create new agent |
|
| List all agents |
|
| Agent details + live position data |
|
| Update on-chain governance rules |
|
| Trigger LTV evaluation |
|
| Action history |
|
| AI chat with agent |
|
| LayerZero bridge quote |
|
| Current borrow APR, vault APY, spread |
|
| Live asset prices (Chainlink + CoinGecko) |
yieldpilot/
├── contracts/ # Solidity smart contracts
│ ├── contracts/
│ │ ├── AgentConstitution.sol # On-chain governance rules
│ │ └── AgentExecutor.sol # Batched DeFi operations
│ ├── deploy/deploy.ts
│ ├── test/YieldPilot.test.ts
│ └── hardhat.config.ts
├── api/ # Python FastAPI backend
│ ├── engine/
│ │ ├── aave_client.py # Aave V3 integration
│ │ ├── vault_client.py # ERC-4626 vault client
│ │ ├── ltv_manager.py # Autonomous decision engine
│ │ └── price_oracle.py # Chainlink + CoinGecko oracles
│ ├── agent/
│ │ ├── wallet.py # EOA wallet management
│ │ └── constitution.py # On-chain rule reader
│ ├── bridge/layerzero_client.py # LayerZero/Stargate bridge
│ ├── chat/ai_agent.py # Groq AI chat (LLaMA 3.1)
│ ├── notifications/telegram_bot.py # Telegram alerts
│ ├── worker.py # Autonomous agent loop
│ ├── main.py # FastAPI routes
│ ├── models.py # SQLAlchemy models
│ └── config.py # Environment config
├── app/ # React frontend
│ ├── src/
│ │ ├── pages/
│ │ │ ├── Landing.tsx
│ │ │ ├── Dashboard.tsx
│ │ │ ├── CreateAgent.tsx
│ │ │ └── AgentDetail.tsx
│ │ ├── components/
│ │ │ ├── LtvGauge.tsx # Circular LTV gauge
│ │ │ ├── AgentTerminal.tsx # Live log terminal
│ │ │ ├── ConstitutionPanel.tsx # On-chain rule editor
│ │ │ ├── YieldMetrics.tsx # APY/APR/spread cards
│ │ │ ├── ChatWidget.tsx # AI chat overlay
│ │ │ └── Navbar.tsx
│ │ └── lib/
│ │ ├── api.ts # API client
│ │ └── contracts.ts # Chain config + ABIs
│ └── tailwind.config.js
├── docker-compose.yml # PostgreSQL
└── README.md
cd contracts
npm test# Health check
curl http://localhost:8000/health
# Current rates
curl http://localhost:8000/rates
# Live ETH price
curl http://localhost:8000/prices/ETH
# Create an agent
curl -X POST http://localhost:8000/agents \
-H "Content-Type: application/json" \
-d '{"name": "TestPilot", "collateral_type": "WETH"}'
# Chat with AI
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{"message": "How is my position doing?"}'Private keys are never committed — all .env files are in .gitignore
Agent wallets are EOAs with isolated key management
Smart contracts use OpenZeppelin's audited SafeERC20, Ownable, and Pausable
AgentExecutor enforces daily spend limits, vault whitelisting, and health factor floors
Constitution rules are on-chain and immutable by anyone except the agent owner
Emergency pause() and emergencyExit() functions for instant fund protection
Environment | Config | Network |
|---|---|---|
Testnet (default) |
| Arbitrum Sepolia (421614) |
Mainnet |
| Arbitrum One (42161) |
Built by big14way for the Arbitrum Open House NYC Online Buildathon 2026.
MIT
Built and deployed a full-stack autonomous DeFi yield agent on Arbitrum Sepolia. Developed smart contracts (AgentConstitution + AgentExecutor) for on-chain governance, a FastAPI backend with Aave V3 integration for autonomous supply/borrow/repay/withdraw operations, pre-flight safety checks to prevent unsafe transactions, real-time Telegram notifications, and a React dashboard. Deployed frontend to Vercel and API to Render for a fully live demo requiring no local setup.
Not yet fundraising — focused on building a working product first. Open to grants and pre-seed conversations.