AI-powered investment fund that allocates assets based on community sentiment analysis.
CeloAIFund is a decentralized investment platform on Celo blockchain that uses AI to make data-driven allocation decisions. The system analyzes Discord conversations for sentiment and protocol mentions, identifying trending projects within the community. The platform features a smart contract fund for deposits and withdrawals, a Discord bot that captures and analyzes messages, and a PostgreSQL database tracking all interactions. When fund assets reach a threshold, an AI agent automatically allocates portions to top-ranked protocols based on positive community sentiment. The architecture includes a FastAPI backend providing data endpoints and a React frontend visualizing fund performance and community sentiment. Docker containers ensure consistent deployment across environments. This creates a unique investment vehicle where allocation decisions are guided by collective intelligence rather than individual managers, democratizing investment while leveraging AI to process community signals into actionable insights.
The core is a Solidity smart contract deployed on Celo that manages deposits, withdrawals, and token allocations. We implemented ERC20 compatibility for the fund shares, allowing users to deposit tokens and receive proportional ownership. For backend services, we used FastAPI with PostgreSQL, creating models to track Discord messages, users, protocols, and sentiment data. The database schema efficiently indexes protocol mentions for quick retrieval during allocation decisions. The AI component uses OpenAI's API through LangGraph for sentiment analysis of Discord messages. We built a custom prompt that extracts protocol mentions and assigns sentiment scores, storing this structured data for later analysis. For blockchain interaction, we used Web3.py to connect our allocation agent to the Celo network, automating transactions when sentiment thresholds are met. The agent calculates weighted allocations based on mention frequency and sentiment scores. The frontend is built with React, using ethers.js for blockchain connectivity and Chart.js for visualizing sentiment trends and fund performance. The most innovative aspect is our sentiment-weighted allocation algorithm that prevents manipulation by considering both mention frequency and sentiment intensity, creating a truly community-driven investment vehicle.