project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

LuciBot

LuciBot simplifies DeFi by providing intelligent recommendations, real-time data, and easy transaction execution, making decentralized finance accessible and efficient 🚀

LuciBot

Created At

Superhack 2024

Winner of

Tenderly - Build a dapp with Virtual TestNets

Project Description

  1. What is LuciBot? LuciBot is an AI-powered chatbot designed to simplify discovery and interactions within the decentralized finance (DeFi) ecosystem. By integrating with Lucidity Finance APIs, LuciBot offers users intelligent recommendations, real-time data, and seamless transaction execution across various DeFi protocols. The bot leverages OpenAI's GPT-4 to interpret natural language queries, making DeFi accessible to both novice and experienced users.

  2. Why LuciBot? Navigating the DeFi landscape can be overwhelming due to its complexity and the vast array of protocols available. LuciBot addresses three critical challenges in DeFi: Discovery and Risk Assessment: LuciBot provides intelligent recommendations based on real-time data, helping users find optimal protocols while assessing associated risks. Access to Actionable Real-Time Data: It delivers crucial, up-to-date information about DeFi protocols, empowering users to make informed decisions efficiently. Efficient Position Management: LuciBot enables seamless execution of transactions, allowing users to manage their DeFi positions quickly and effectively. We believe the future of DeFi x AI is bright. With DeFi getting increasingly complex and fragmented, AI agents are the way towards onboarding the next wave of DeFi users by making the interactions intuitive and increasing onchain economic activity.

  3. How Does LuciBot Work? LuciBot is built on a robust tech stack that includes NestJS for backend logic, Next.js for frontend interfaces, and Redis for caching and thread management. The bot interacts with the Lucidity Finance API to perform operations such as protocol recommendations, data retrieval, and transaction execution. User queries are processed by GPT-4, which translates them into actionable requests, ensuring that even complex DeFi operations are executed smoothly and accurately.

  4. Features AI-Powered Recommendations: Uses GPT-4 to provide intelligent protocol suggestions based on user queries. Real-Time Data Access: Fetches and delivers real-time DeFi protocol data to users. Seamless Transaction Execution: Automates complex DeFi transactions like supplying, borrowing, and repaying assets. Thread Management: Maintains conversation context using Redis, allowing personalized interactions. Natural Language Processing: Interprets user queries in natural language and converts them into actionable requests. Data Formatting: Formats raw data into user-friendly tables or summaries via GPT-4. User-Friendly Interface: Provides an intuitive chat interface for easy user interaction. Modular Architecture: Built with a modular structure for easy scalability and updates. Cross-Platform Compatibility: Compatible across devices and platforms with a responsive web interface.

  5. How to Use LuciBot Start a Conversation: Users interact with LuciBot through a chat interface. Simply type your query, such as "What is the best protocol to supply 10 USDC?" Receive Recommendations: LuciBot processes the query and provides a recommendation based on real-time data. Execute Transactions: If a transaction is required, LuciBot can execute it directly, providing users with the necessary transaction details. Access Data: Users can request specific data about protocols or their positions, which LuciBot retrieves and presents in an easy-to-understand format.

  6. Next Steps / Future Scope As LuciBot evolves, the focus will be on enhancing its technical capabilities and expanding its feature set. Future developments include: Advanced Risk Modeling: Incorporating more sophisticated risk assessment models to provide deeper insights into DeFi protocols. Cross-Chain Functionality: Expanding LuciBot’s capabilities to support cross-chain operations, allowing users to manage assets across multiple blockchains seamlessly. Machine Learning model improvements: Evolving machine learning models to predict market trends and optimize protocol recommendations. Scalability Improvements: Optimizing LuciBot’s infrastructure to handle a growing number of users and transactions, ensuring fast and reliable service.

  7. Technical Architecture Backend (NestJS): Handles API requests, thread management, and interaction with Lucidity Finance APIs. Frontend (Next.js): Provides a responsive and intuitive user interface for interacting with LuciBot. AI Processing (GPT-4): Interprets natural language queries and generates actionable requests. Data Management (Redis): Caches user sessions and manages conversation threads to maintain context.

  8. User Scenarios New to DeFi: A user new to DeFi can ask LuciBot for recommendations on where to start, and LuciBot will guide them through the process, from choosing a protocol to executing their first transaction. Advanced Users: An experienced user might use LuciBot to manage multiple DeFi positions across different protocols, leveraging LuciBot’s real-time data access and transaction execution features.

How it's Made

LuciBot was built using a combination of modern web development technologies and AI-driven services to create a seamless and intelligent DeFi chatbot.

NestJS: The backend is powered by NestJS, a robust framework for building scalable and maintainable server-side applications. It handles API requests, thread management, and interactions with the Lucidity Finance API.

Next.js: The frontend is developed with Next.js, providing a responsive and dynamic user interface that allows users to interact with LuciBot in real time.

OpenAI GPT-4: At the heart of LuciBot’s intelligence is GPT-4, which processes user queries, interprets natural language, and generates actionable requests. This integration allows LuciBot to understand complex user commands and provide accurate responses.

Lucidity Finance API: LuciBot integrates deeply with the Lucidity Finance API to fetch real-time data, perform transactions, and retrieve protocol-specific information. This connection enables LuciBot to offer precise and relevant DeFi recommendations and actions.

Redis: Redis is used for caching and managing user conversation threads. This ensures that each user's session is maintained across multiple interactions, allowing LuciBot to provide a continuous and personalized experience.

Thread Management: LuciBot utilizes a thread-based approach to maintain the context of user interactions. For each user, a unique thread is created to store the conversation history, which is then used to provide contextual responses in subsequent interactions.

APIs and Schema Validation: LuciBot uses a set of defined APIs for various operations like recommendations, data retrieval, and transaction execution. The requests generated by GPT-4 are validated against a predefined schema using Joi, ensuring that all operations are performed with the correct parameters.

Partner Technologies Used:

Base: LuciBot supports the Base network for fetching the data and executing the transactions.

Tenderly: We have used, Tenderly Testnets - for simulation network, a mainnet fork that is needed so that users can test the capabilities of the bot without having to spend real money.

Thirdweb: Frontend uses ThirdWeb SDK for handling the user onboarding, wallet conenctions, network management and sending transactions.

Alchemy: Uses RPC by Alchemy for fetching real time data.

Optimism: indirectly since Base is an OP chain.

Notable Details Dynamic Threading: A particularly clever aspect of LuciBot is its use of dynamic threading. By creating and managing threads on the fly based on user interactions, LuciBot can handle complex conversational flows without losing context, which is critical for accurate DeFi operations.

Real-Time Data Formatting: Another notable feature is the real-time formatting of data. When LuciBot retrieves raw data from Lucidity APIs, it sends this data back to GPT-4 to be formatted into a user-friendly table or summary. This step ensures that even complex data sets are easily understood by users.

Modular Architecture: The entire system is built with a modular architecture, making it easy to extend or modify. Each service (e.g., GPT-4 interaction, Lucidity API, Redis caching) operates independently, which not only simplifies development but also makes the system highly scalable and maintainable.

background image mobile

Join the mailing list

Get the latest news and updates