Troubleshooting
Common Issues
Trading Bot Not Trading
Symptoms: No trades appearing in history
Solutions:
Check if background worker is running
Verify MongoDB connection
Check API logs for errors
Ensure sufficient cash is available
Verify market data is being fetched
Negative Cash Balance
Symptoms: Cash shows negative value
Solutions:
Reset trading state using DELETE endpoint
Check for bugs in trade execution logic
Verify cash validation is working
Review recent trades for errors
Dashboard Not Loading Data
Symptoms: Sections show "No data available"
Solutions:
Check external API status
Verify API rate limits aren't exceeded
Check network connectivity
Review browser console for errors
Clear browser cache
Chat Not Responding
Symptoms: No response from Naoko
Solutions:
Verify Anthropic API key is set
Check API quota/limits
Review API logs
Test API key validity
Check network connectivity
Database Connection Errors
Symptoms: 500 errors, data not persisting
Solutions:
Verify MongoDB URI is correct
Check network access settings
Verify database user permissions
Check connection pool limits
Review MongoDB Atlas status
Performance Optimization
Slow Dashboard Loading
Increase Cache TTL: Reduce API calls
Optimize Queries: Use indexes
Reduce Refresh Frequency: Adjust intervals
Enable CDN Caching: Use Vercel Edge
High API Usage
Increase Cache Duration: Reduce external calls
Batch Requests: Combine API calls
Use WebSockets: For real-time updates
Implement Rate Limiting: Prevent abuse
Database Performance
Add Indexes: On frequently queried fields
Limit Query Results: Use pagination
Optimize Aggregations: Use efficient queries
Monitor Slow Queries: Identify bottlenecks
Last updated

