Yieldera is an AI-powered automated liquidity management protocol built for the Hedera network. It provides intelligent vault strategies using AI agents for SaucerSwap (Uniswap V3) liquidity positions and Bonzo lending protocols, automatically rebalancing positions to optimize yield and minimize impermanent loss.
The project consists of four main components:
- Liquidity Management Engine: Automated rebalancing logic for vault positions
- REST API: HTTP server with Swagger documentation for vault management
- AI Agent Integration: Gemini-powered AI agent with MCP (Model Context Protocol) tools
- Multi-Vault Support: Concurrent management of multiple liquidity vaults across SaucerSwap and Bonzo
- Real-time Monitoring: Continuous monitoring and adjustment of liquidity positions
- Modern Web Interface: React-based dashboard with cyberpunk-themed UI
- Wallet Integration: Support for HashPack, Blade, Kabila, and MetaMask wallets
- Real-time Chat: AI agent interaction through chat interface
- Vault Management: Deposit, withdraw, and monitor vault positions
- Token Balance Tracking: Real-time display of user token balances
- YielderaVault: Core vault contract for managing SaucerSwap positions
- Hedera Integration: Native support for HBAR and HTS tokens
- Position Management: Automated minting, burning, and rebalancing of liquidity positions
- AI Tool Server: Model Context Protocol server providing blockchain tools to AI agents
- Hedera Tools: Native HBAR balance checking, Bonzo lending operations
- Token Management: Support for USDC, SAUCE, and other Hedera tokens
- β AI-Powered Management: Gemini AI agent with blockchain-specific tools via MCP
- β Automated Rebalancing: Intelligent position management based on market conditions
- β Multi-Protocol Support: SaucerSwap liquidity pools and Bonzo lending integration
- β Multi-Token Support: Support for HBAR, USDC, SAUCE, and other HTS tokens
- β Fee Collection: Automatic collection and reinvestment of trading fees
- β Modern Web Interface: React/TypeScript frontend with cyberpunk UI
- β Multi-Wallet Support: HashPack, Blade, Kabila, and MetaMask integration
- β REST API: Complete API for vault management and monitoring
- β AI Chat Interface: Natural language interaction with AI agent
- β MCP Integration: Model Context Protocol for AI tool extensibility
- β Real-time Updates: Live token balances and vault status
- β Swagger Documentation: Interactive API documentation
- β Comprehensive Logging: Structured logging and monitoring
- β Testnet & Mainnet: Support for both Hedera testnet and mainnet
Before running the project, ensure you have the following installed:
- Rust (latest stable version)
- Node.js (v16 or higher)
- npm or yarn (for frontend dependencies)
- Foundry (for smart contract development)
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# Install Node.js (using nvm)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18
nvm use 18
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryupCreate .env files in backend/, contracts/, frontend/, and mcp/ directories:
# Copy from example
cp backend/.env.exemple backend/.env
# Edit the file with your values
PRIVATE_KEY="0x..." # Your private key (without 0x prefix)
NETWORK="testnet" # or "mainnet"
ADMIN_PASSWORD="your_secure_password"
GEMINI_API_KEY="your_gemini_api_key" # For AI agent functionality# Copy from example
cp contracts/.env.exemple contracts/.env
# Edit the file with your values
PRIVATE_KEY="0x..." # Your private key for deployment# Create frontend environment file
REACT_APP_API_BASE_URL="http://127.0.0.1:8090"
REACT_APP_NETWORK="testnet" # or "mainnet"# Create MCP environment file
PRIVATE_KEY="0x..." # Your private key for blockchain operations
GEMINI_API_KEY="your_gemini_api_key" # For AI agent functionalityThe project supports both testnet and mainnet configurations:
- Testnet: Uses Hedera testnet (Chain ID: 296)
- Mainnet: Uses Hedera mainnet (Chain ID: 295)
Network-specific configurations are stored in:
backend/src/config/testnet.tomlbackend/src/config/mainnet.toml
# Navigate to contracts directory
cd contracts
# Install dependencies
forge install
# Build contracts
forge build
# Run tests
forge test
# Deploy contracts (testnet)
forge script script/DeployYielderaVault.s.sol --rpc-url hedera_testnet --broadcast --verify --verifier sourcify --verifier-url https://server-verify.hashscan.io
# Deploy contracts (mainnet)
forge script script/DeployYielderaVault.s.sol --rpc-url https://mainnet.hashio.io/api --broadcast --verify --verifier sourcify --verifier-url https://server-verify.hashscan.io# Navigate to MCP directory
cd mcp
# Build the MCP server
cargo build --release
# Run MCP server (for AI agent tools)
cargo run --no-default-features --features server
# Or run MCP client (for testing)
cargo run --no-default-features --features client# Navigate to backend directory
cd backend
# Build the project
cargo build --release
# Run tests
cargo test
# Start the server (development) - This will automatically start MCP server
cargo run
# Start the server (production)
cargo run --release# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# or
yarn install
# Start development server
npm start
# or
yarn start
# Build for production
npm run build
# or
yarn buildOnce all components are running, you can access:
- Frontend: http://localhost:3000
- Backend API: http://127.0.0.1:8090
- Swagger UI: http://127.0.0.1:8090/swagger-ui/
- Health Check: http://127.0.0.1:8090/health
- MCP Server: http://127.0.0.1:3001 (internal use)
The project provides a comprehensive REST API with the following endpoints:
GET /- Index pageGET /health- Health checkGET /vaults- Get all managed vaultsPOST /admin/associate-vault-tokens- Associate tokens to vault (admin only)POST /chat- Chat with AI agent for liquidity management
/- Landing page with project information/app- Main application dashboard with AI chat/deposit/:vaultAddress- Deposit tokens into specific vault/withdraw/:vaultAddress- Withdraw tokens from specific vault
Admin endpoints require the ADMIN_PASSWORD to be provided in the request headers or body.
The AI agent supports natural language commands for:
- Checking token balances
- Managing liquidity positions
- Supplying tokens to Bonzo lending protocol
- Analyzing market conditions
- Providing yield optimization recommendations
Interactive API documentation is available at http://127.0.0.1:8090/swagger-ui/ when the server is running.
Yieldera/
βββ backend/ # Rust backend application
β βββ src/
β β βββ api/ # REST API endpoints
β β βββ config/ # Configuration management
β β βββ core/ # Core business logic & AI agent
β β βββ helpers/ # Utility functions
β β βββ state/ # Application state management
β β βββ strategies/ # Liquidity strategies
β β βββ types/ # Type definitions
β βββ logs/ # Application logs
β βββ Cargo.toml # Rust dependencies
βββ frontend/ # React/TypeScript frontend
β βββ public/ # Static assets
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ services/ # API services & wallet integration
β β βββ hooks/ # Custom React hooks
β β βββ contexts/ # React contexts
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Utility functions
β βββ package.json # Node.js dependencies
β βββ tailwind.config.js # Tailwind CSS configuration
βββ contracts/ # Solidity smart contracts
β βββ src/ # Contract source code
β βββ script/ # Deployment scripts
β βββ test/ # Contract tests
β βββ foundry.toml # Foundry configuration
βββ mcp/ # Model Context Protocol server
β βββ src/
β β βββ tools/ # AI agent tools (balance, bonzo, calculator)
β β βββ helpers.rs # Helper functions
β β βββ tokens.json # Token configuration
β β βββ main.rs # MCP server/client
β βββ Cargo.toml # Rust dependencies
βββ README.md
To add new vaults to the system:
- Deploy a new
YielderaVaultcontract - Add the contract address to the appropriate config file:
backend/src/config/testnet.toml(for testnet)backend/src/config/mainnet.toml(for mainnet)
- Restart the backend service
The project features a sophisticated AI agent powered by Google Gemini and Model Context Protocol (MCP):
- Natural Language Processing: Understands user queries about liquidity management
- Blockchain Operations: Can check balances, supply tokens, and analyze positions
- Market Analysis: Provides insights on yield optimization and risk management
- Real-time Interaction: Chat-based interface for seamless user experience
- Balance Checker: Get native HBAR balance for any account
- Bonzo Integration: Supply tokens to Bonzo lending protocol
- Calculator Tools: Mathematical operations for yield calculations
- Token Management: Support for USDC, SAUCE, and other Hedera tokens
# Chat with AI agent through frontend or API
"Check my HBAR balance"
"Supply 0.1 HBAR to Bonzo"
"What's the best yield strategy for my portfolio?"
"Analyze current market conditions"The application uses structured logging with different levels:
- Logs are written to both console and files
- Log files are stored in
backend/logs/ - Log level can be controlled via the
RUST_LOGenvironment variable - AI agent interactions are logged for debugging and analysis
cd backend
cargo testcd frontend
npm test
# or
yarn testcd contracts
forge testcd mcp
cargo test# Run specific backend test
cd backend
cargo test test_rebalance -- --nocapture
# Test AI agent functionality
cd mcp
cargo run --no-default-features --features client- Start all services (MCP, Backend, Frontend)
- Connect wallet in frontend
- Test AI chat functionality
- Test vault deposit/withdraw operations
-
Prepare Environment:
# Set production environment variables export NETWORK="mainnet" export PRIVATE_KEY="your_mainnet_private_key" export ADMIN_PASSWORD="secure_production_password"
-
Deploy Contracts:
cd contracts forge script script/DeployYielderaVault.s.sol --rpc-url https://mainnet.hashio.io/api --broadcast --verify -
Update Configuration:
- Update
backend/src/config/mainnet.tomlwith deployed contract addresses - Ensure all vault addresses are correct
- Update
-
Build and Run All Components:
# Build and run MCP server cd mcp cargo build --release cargo run --no-default-features --features server & # Build and run backend (will connect to MCP) cd ../backend cargo build --release ./target/release/yieldera & # Build and run frontend cd ../frontend npm run build npm install -g serve serve -s build -l 3000
- Private Keys: Never commit private keys to version control
- API Keys: Secure Gemini API keys for AI functionality
- Admin Password: Use strong passwords for admin endpoints
- Network Security: Consider using HTTPS in production
- Wallet Security: Frontend supports secure wallet connections
- Access Control: Implement proper access controls for admin functions
- MCP Security: MCP server runs locally and doesn't expose sensitive data
- Environment Variables: Use proper environment variable management
- Monitoring: Set up monitoring and alerting for production deployments
- Hedera Network
- SaucerSwap - Hedera's leading DEX
- Bonzo Finance - Hedera lending protocol