- ToteFlow is a decentralized digital product marketplace on Base chain with AI-powered yield farming
- Sellers list products encrypted via Lit Protocol and stored on IPFS for secure content delivery
- Buyers purchase using ERC20 tokens and decrypt content through Lit Protocol access control conditions
- All seller funds automatically farm yield via Vincent AI agents across Aave, Compound, and Yearn
- Hourly automated optimization: Vincent AI agents rebalance funds to the highest-yielding protocols
- Real-time yield tracking with automatic protocol switching when better rates are detected
- Farcaster mini dapp integration for social marketplace discovery and engagement
- Yield accumulates during escrow period between purchase and content delivery
- Smart contracts handle on-chain payments while Vincent AI manages off-chain DeFi operations
- Comprehensive security: encrypted storage, access control, and ReentrancyGuard protection
- Smart Contract: Solidity 0.8.28 on Base Sepolia using OpenZeppelin (Ownable, ReentrancyGuard, SafeERC20)
- Vincent AI: VincentYieldAgent class in Node.js/Express with per-user agents and multi-protocol optimization policies
- Lit Protocol: @lit-protocol/lit-client for encryption with programmable access control conditions as JSON
- IPFS Storage: Infura gateway for encrypted uploads with on-chain hash storage for immutable addressing
- Frontend: Next.js 13 + TypeScript + Wagmi + Tailwind CSS + Farcaster Frame integration
- Vincent API: REST endpoints calling Vincent agents for Aave V3, Compound, and Yearn transactions
- Automated Cron: Hourly job triggering yield analysis and rebalancing when improvements exceed 1% threshold
- Access Control: Lit Protocol EOA auth with signature-based conditions enabling wallet-based decryption
- Real-Time Rates: Vincent agents fetch APY from multiple protocols for compound yield calculations
- Database: MongoDB collections (users, deposits, products, purchases) tracking agent IDs and transaction hashes
┌─────────────────┐ ┌──────────────┐ ┌─────────────┐
│ Marketplace │────▶│ Smart │────▶│ Vincent │
│ (Frontend) │ │ Contract │ │ AI Agents │
└─────────────────┘ └──────────────┘ └─────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌──────────────┐ ┌─────────────┐
│ Lit Protocol │ │ IPFS │ │ Aave / │
│ Encryption │ │ Storage │ │ Compound │
└─────────────────┘ └──────────────┘ └─────────────┘
- 🔐 Lit Protocol Encryption: Automated content encryption with access control
- 🤖 Vincent AI Agents: Per-user agents with automated multi-protocol optimization
- 🌾 Real Yield Farming: Aave, Compound, and Yearn integration for actual DeFi yields
- ⏰ Hourly Optimization: Automatic rebalancing across protocols for maximum returns
- 📱 Farcaster Integration: Native mini dapp with Frame support
- 🌐 IPFS Storage: Decentralized content hosting with encryption
- 💰 ERC20 Payments: Multi-token support with automatic fee distribution
- 🔒 Secure Access Control: Signature-based content decryption
cd /Users/hemakarthick/tote/Tote
forge build
forge testcd vincent-app
npm install
cp env.example .env
# Configure VINCENT_API_KEY, VINCENT_AGENT_ID
npm startcd mini-dapp
npm install
cp env.example .env.local
# Configure environment variables
npm run dev- Auto-Protocol Selection: Chooses best yielding protocol (Aave/Compound/Yearn)
- Hourly Rebalancing: Monitors rates and moves funds when better yields available
- Slippage Protection: 0.5% max slippage for safe transactions
- Gas Optimization: 50 gwei max gas price limits
- Yield Threshold: 1% minimum improvement before rebalancing
MIT