Back to Sample Apps
AI Powered DeFi Yield Optimizer
This app teaches you how to integrate the Aerodrome Swap API with an AI model to create a personalized DeFi yield optimizer and analytics dashboard for Aerodrome.
Frontend Framework/Library:
React
Language:
TypeScript
Build Tool/Development Server:
Next.js

Overview
This project is an AI-powered DeFi yield farming optimizer that helps users build personalized portfolio strategies across Aerodrome Finance pools on Base network.
This example app is provided for educational and demonstration purposes only. Use at your own risk.
tip
Learn how to build the AI Powered DeFi Yield Optimizer on Base in our technical guide here.
Prerequisitesβ
-
Anthropic Claude API:
- Sign up at console.anthropic.com
- Get API key
-
Quicknode Account:
- Sign up at quicknode.com
- Install the Aerodrome Swap API add-on
- Get endpoint URL
Quick Startβ
1. Clone the Repositoryβ
git clone https://github.com/quiknode-labs/qn-guide-examples.git
cd qn-guide-examples/sample-dapps/ai-powered-defi-yield-optimizer
2. Install Dependenciesβ
pnpm install
# or
npm install
3. Environment Configurationβ
cp .env.example .env
Edit .env:
# Required for AI optimization
ANTHROPIC_API_KEY=your_claude_api_key_here
# Required for live Aerodrome data
NEXT_PUBLIC_QUICKNODE_ENDPOINT=https://your-quicknode-endpoint.com/your-api-key/
4. Run Development Serverβ
pnpm dev
# or
npm run dev
Visit http://localhost:3000 to see the application.
Architectureβ
System Overviewβ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β User Input β β AI Processing β β Pool Data API β
β β β β β β
β β’ Risk Quiz βββββΆβ Claude AI API ββββββ Quicknode API β
β β’ Preferences β β β’ Analysis β β β’ Live Pools β
β β’ Investment $ β β β’ Optimization β β β’ Token Data β
βββββββββββββββββββ β β’ Reasoning β β β’ Verification β
ββββββββββββββββββββ βββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Optimized Strategy β
β β
β β’ Pool Selection β
β β’ Allocations β
β β’ Risk Scores β
β β’ Reasoning β
ββββββββββββββββββββββββ
Deploy on Vercel
Preview

Contributions & Feedback
We'd love to hear your feedback and welcome any contributions to this sample app!
To report issues or share feedback, open a GitHub issue in the qn-guide-examples repository.
To contribute, follow these steps:
- Fork the repository
- Create a feature branch:git checkout -b feature/amazing-feature
- Commit your changes:git commit -m "Add amazing feature"
- Push your branch:git push origin feature/amazing-feature
- Open a Pull Request.
Explore More Sample Apps