AutoFi eliminates the complexity of DeFi by transforming user intents (e.g., "Maximize my profit" or "Grow safely") into optimized, multi-step on-chain strategies — all automated by an AI engine.
Key Features:
- Intent-Based Execution — Users pick a goal, not a protocol. The AI engine selects the optimal DeFi path.
- Live Performance Tracking — Continuously monitors deployed strategies with accuracy scoring and confidence metrics.
- Smart Rebalancing — Detects underperforming vaults and suggests optimal strategy swaps.
- On-Chain Vaults — Funds are secured via Anchor smart contracts on Solana Devnet.
- Full Wallet Session Protection — All app pages require an active wallet connection.
AutoFi/
├── frontend/ → Next.js 15 (App Router) — UI & wallet integration
│ ├── app/
│ │ ├── components/ → Reusable UI components (Navbar, Sidebar, WalletGuard, etc.)
│ │ ├── lib/ → Core logic (storage, API client, DeFi integrations)
│ │ │ └── defi/ → Protocol adapters (Jupiter, Lending, Staking)
│ │ ├── dashboard/ → Protected dashboard pages (Overview, Strategy, History)
│ │ ├── strategy/ → Goal selection page
│ │ ├── amount/ → Investment amount input
│ │ ├── preview/ → Strategy preview before execution
│ │ ├── execute/ → On-chain transaction execution
│ │ └── withdraw/ → Vault withdrawal flow
│ └── idl/ → Anchor IDL for smart contract interaction
│
├── backend/ → Express.js — AI Strategy Engine & Performance API
│ └── src/
│ ├── controllers/ → Route handlers (intent, performance, rebalance)
│ ├── services/ → Business logic (strategy scoring, backtest, confidence)
│ ├── config/ → Strategy configurations and pool definitions
│ └── utils/ → Shared helpers
│
└── autofi-smart-contract/ → Anchor/Rust — Solana Program
├── programs/ → Smart contract source (vault deposit/withdraw)
└── tests/ → Integration tests
┌─────────────┐ ┌──────────────┐ ┌────────────────┐ ┌──────────────┐
│ User picks │ ──→ │ AI Engine │ ──→ │ Strategy │ ──→ │ On-Chain │
│ a Goal │ │ scores & │ │ Preview & │ │ Execution │
│ (Intent) │ │ backtests │ │ Confirmation │ │ via Anchor │
└─────────────┘ └──────────────┘ └────────────────┘ └──────────────┘
│
┌─────────────────────────────────────────────┘
▼
┌──────────────┐ ┌──────────────┐
│ Performance │ ──→ │ Rebalance │
│ Monitoring │ │ Suggestions │
│ (Accuracy, │ │ (Auto-swap │
│ Confidence)│ │ strategy) │
└──────────────┘ └──────────────┘
- Intent — User selects a DeFi goal (e.g., Maximize Profit, Grow Safely).
- AI Scoring — Backend scores all available strategies using multi-window backtesting (7d/30d/90d returns) and selects the optimal one.
- Preview — User reviews the selected strategy, expected APY, risk level, and AI confidence score.
- Execution — Funds are deposited into an Anchor vault on Solana Devnet. DeFi steps (swap, lend, stake) are executed.
- Monitoring — The system continuously checks actual vs. expected profit, updating accuracy and confidence using a weighted moving average.
- Rebalancing — If a better strategy is detected, the system suggests an auto-rebalance.
- Node.js v18+
- Solana CLI (for smart contract deployment)
- Anchor (for smart contract development)
- A Solana wallet (e.g., Phantom) set to Devnet
https://github.com/antssugiarto/AutoFi.git
cd AutoFicd backend
npm install
npm start
# Server runs on http://localhost:3001cd frontend
npm install
npm run dev
# App runs on http://localhost:3000- Open
http://localhost:3000in your browser. - Switch your Phantom wallet to Devnet.
- Click "Connect Wallet" → start using AutoFi!
The smart contract is already deployed on Devnet. To redeploy:
cd autofi-smart-contract
anchor build
anchor deploy| Layer | Technology |
|---|---|
| Frontend | Next.js 15, TypeScript, Solana Wallet Adapter |
| Backend | Express.js, Node.js |
| Smart Contract | Anchor Framework, Rust |
| Blockchain | Solana (Devnet) |
| Styling | Custom CSS Design System (Material 3 inspired) |
| File | Purpose |
|---|---|
frontend/app/lib/storage.ts |
Client-side vault & transaction state management |
frontend/app/lib/performanceTracker.ts |
Frontend ↔ Backend performance reporting loop |
frontend/app/components/wallet-guard.tsx |
Route protection — redirects if wallet not connected |
backend/src/services/strategyService.js |
AI strategy scoring & multi-window backtesting |
backend/src/services/performanceService.js |
Accuracy tracking & confidence calculation |
backend/data/performance.json |
Persistent performance history storage |
ISC © AutoFi Team