Kairos is a comprehensive autonomous cryptocurrency trading platform powered by advanced AI technology. The system combines Gemini AI's sophisticated decision-making capabilities with real-time market data to provide both autonomous trading and interactive market analysis features.
Kairos AI Trading System
├── Frontend (React/Next.js) # Web interface and user experience
│ ├── AI Agent Interface # Autonomous trading and assistant modes
│ ├── Manual Trading # Direct trading interface
│ └── Portfolio Dashboard # Real-time portfolio management
├── Backend (Python/FastAPI) # Core trading engine and AI integration
│ ├── Gemini AI Agent # Decision-making and market analysis
│ ├── Trading Engine # Multi-chain trade execution
│ ├── Portfolio Manager # Real-time balance and asset tracking
│ └── Analytics Engine # Performance tracking and reporting
└── External Integrations # Third-party services and APIs
├── Recall Trading API # Real trade execution
├── CoinGecko API # Live price data
├── Supabase Database # Data persistence
└── TradingView Charts # Technical analysis
- AI-Powered Decisions: Gemini AI analyzes market conditions, news sentiment, and portfolio data
- Multi-Chain Support: Trade across Ethereum, Polygon, Solana, and Base networks
- Risk Management: Intelligent position sizing and portfolio protection
- Learning System: AI improves strategies based on trade outcomes
- Real-Time Execution: Automated trade execution with comprehensive validation
- Market Analysis: Real-time crypto price data and trend analysis
- Portfolio Insights: Comprehensive holdings analysis and recommendations
- Educational Content: Crypto concepts and trading strategy explanations
- News Integration: Latest cryptocurrency news and sentiment analysis
- Performance Tracking: Real-time P&L, success rates, and trading metrics
- Strategy Analysis: AI decision pattern analysis and optimization
- Professional Reports: Automated PDF report generation
- Risk Assessment: Comprehensive risk scoring and management
- Dual Mode Operation: Switch between autonomous agent and interactive assistant
- Real-Time Updates: Live portfolio and session monitoring
- Responsive Design: Mobile-first responsive interface
- Integration Charts: TradingView integration for technical analysis
- Framework: Next.js 14 with TypeScript
- Styling: Tailwind CSS with Shadcn/UI components
- State Management: React hooks with custom state management
- Charts: TradingView widget integration
- Theme: Dark/light mode with system preference detection
- Framework: FastAPI with Python 3.8+
- AI Integration: Google Gemini 1.5 Pro
- Database: Supabase PostgreSQL
- Trading API: Recall Network trading infrastructure
- Market Data: CoinGecko API integration
- Reports: ReportLab PDF generation
- Development: Local development with hot reloading
- Production: Docker containerization ready
- Database: Supabase cloud PostgreSQL
- API Integration: RESTful APIs with comprehensive error handling
- Monitoring: Comprehensive logging and error tracking
- Node.js 18+ for frontend development
- Python 3.8+ for backend development
- API Keys: Gemini AI, Supabase, Recall Network
- Package Managers: npm/yarn for frontend, pip for backend
- Clone Repository
git clone <repository-url>
cd kairos-ai-trading- Backend Setup
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Configure environment variables
cp .env.example .env
# Edit .env with your API keys- Frontend Setup
cd frontend
npm install
# or yarn install
# Configure environment variables
cp .env.example .env.local
# Edit .env.local with your configuration- Start Services
Backend:
cd backend
source venv/bin/activate
python api_server.py
# Server starts on http://localhost:8000Frontend:
cd frontend
npm run dev
# Application starts on http://localhost:3000# AI Configuration
GEMINI_API_KEY=your_gemini_api_key_here
# Database Configuration
SUPABASE_URL=your_supabase_project_url
SUPABASE_ANON_KEY=your_supabase_anon_key
# Trading API Configuration
RECALL_API_KEY=your_recall_api_key_here
RECALL_SANDBOX_API_BASE=https://api.sandbox.competitions.recall.network# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_ENVIRONMENT=development- Access AI Agent: Navigate to the AI Agent section
- Select Agent Mode: Choose "Agent" from the mode selector
- Configure Session: Set trading duration (10 minutes to 24 hours)
- Start Trading: Click "Start Trading" to begin autonomous session
- Monitor Progress: View real-time updates and AI decision-making
- Download Reports: Access PDF reports when session completes
- Select Assistant Mode: Choose "Assistant" from the mode selector
- Ask Questions: Type queries about markets, portfolio, or crypto concepts
- Get Analysis: Receive real-time market analysis and insights
- Portfolio Review: Ask for portfolio optimization suggestions
- Market Updates: Get latest news and price information
- Navigate to Trading: Access the Manual Trading section
- Select Tokens: Choose from/to tokens for your trade
- Set Amount: Enter the amount to trade with balance validation
- Review Trade: Check estimated output and fee information
- Execute Trade: Confirm and execute the trade
- Track Results: Monitor trade execution and portfolio updates
| Endpoint | Method | Description |
|---|---|---|
/api/portfolio |
GET | Current portfolio data |
/api/trade |
POST | Execute manual trade |
/api/chat |
POST | Start autonomous trading session |
/api/chat/assistant |
POST | Interactive AI assistant |
/api/autonomous/status/{id} |
GET | Trading session status |
/api/session/report/{id} |
GET | Download session PDF report |
- Portfolio Updates: Live balance and value tracking
- Price Feeds: Real-time cryptocurrency prices
- Session Monitoring: Live autonomous trading progress
- Trade Notifications: Instant trade execution updates
- API Key Management: Secure storage of all API credentials
- Trade Validation: Comprehensive pre-trade validation
- Balance Verification: Real-time balance checking
- Position Limits: Maximum 50% of token balance per trade
- Portfolio Diversification: Multi-asset allocation management
- Chain Risk Management: Distributed across multiple networks
- AI Confidence Scoring: Trade execution based on AI confidence levels
- Stop-Loss Protection: Intelligent risk management through AI decisions
- Environment Variables: Secure credential management
- Database Security: Supabase row-level security
- API Rate Limiting: Protection against abuse
- Error Handling: Secure error messages without sensitive data exposure
- Trading Success Rate: Percentage of successful trades
- Portfolio Performance: Real-time P&L tracking
- AI Confidence Trends: Analysis of AI decision confidence
- Risk-Adjusted Returns: Performance relative to risk taken
- Session Reports: Comprehensive PDF reports for each trading session
- Strategy Analysis: AI decision pattern analysis
- Performance Tracking: Historical performance trends
- Risk Assessment: Detailed risk analysis and recommendations
kairos-ai-trading/
├── frontend/ # React/Next.js web application
│ ├── src/app/ # Next.js app directory pages
│ ├── src/components/ # Reusable React components
│