PROJECT NAME: Sigma Finance - AI-Powered Rebalancing Protocol on Swell L2 🌊🤖
PITCH DECK LINK: Link to Pitch Deck
DESCRIPTION OF THE PROJECT:
🚀 Overview
Sigma Finance is a next-generation decentralized finance (DeFi) protocol that leverages real-time on-chain data, AI-driven insights, and smart contract automation to optimize liquidity positioning across Ambient Finance pools. It is composed of three core components that work together to enable data-informed and efficient fund reallocation for users.
System Architecture
1. Scraper Contract + APY Engine
Function: Periodically scrapes liquidity pool data from Ambient Finance.
Interval: Data is refreshed and updated every hour.
Storage: The scraped data is structured and stored in a DataStax Astra DB.
APY Calculation: The script calculates real-time Annual Percentage Yields (APY) using pool swap volumes, fee rates, and liquidity levels.
Goal: Maintain a constantly updated repository of pool performance metrics.
2. RAG + Embedding System
Embedding Model: Sigma Finance uses Cohere to convert pool data into vector embeddings.
Retrieval-Augmented Generation (RAG): These embeddings are used to feed a Large Language Model (LLM)with context-rich, real-time data.
Purpose: Empower the LLM to generate recommendations on the most optimal liquidity pools based on historical trends, performance metrics, and yield dynamics.
3. Rebalancer Smart Contract
Trigger: The rebalancing process is initiated when a user deposits into a custom Sigma Pool contract.
LLM Recommendation: The system consults the LLM’s most recent recommendation from the RAG pipeline.
Execution: The Rebalancer Contract reallocates the user’s funds into the suggested Ambient Finance pool(s), based on this recommendation.
User Experience: Fully automated, data-driven portfolio reallocation requiring minimal user input.
Workflow Summary
Data Ingestion→ Scraper Contract collects pool data hourly→ APY is calculated and stored in Astra DB
AI-Driven Analysis→ Data is embedded via Cohere→ LLM with RAG generates real-time pool recommendations
Smart Execution→ User deposits into Sigma Pool→ Rebalancer Contract routes funds to recommended pool(s)
Value Proposition
Automation: Removes guesswork and manual decision-making from liquidity provision.
AI Integration: Uses up-to-date performance data and AI reasoning to drive smarter investments.
User-Friendly: Users deposit once, and Sigma Finance handles the rest — backed by data and AI.
Use of AI - Project Note
During the development of this project for this hackathon, I explored the use of AI to enhance productivity in my workflow. This hackathon provided a valuable opportunity to properly test AI-powered tools designed to automate repetitive tasks. I particularly enjoyed using AI assistance for actions such as generating commit messages, improving code commenting consistency, and streamlining documentation workflows. However, recognising the sensitivity and security-critical nature of DeFi development, all core Solidity contracts were written manually, audited line-by-line, and rigorously tested without relying on AI for code generation. AI was utilized strictly for productivity enhancement — never for the generation of core smart contract logic, ensuring that the fundamental security of the project remains fully under manual developer control.
🛠 Tech Stack
- Solidity 0.8.25 — For Sigma Contracts. All diamond contract compliant
- Cohere — embeddings + fine-tuned RAG model
- AstraDB — vector + time-series storage
- Node.js scraper — pulls Ambient subgraph data
- Swell L2 — 2 s blocks, dirt-cheap gas
Deployment Addresses (Testnet) - Please see Github