DeFlow is an AI-driven DeFi automation platform that transforms natural language into executable blockchain workflows. Users describe what they want to do in plain English (e.g., "swap 0.01 ETH to USDC on Base"), and our AI agent system automatically plans, validates, and executes the multi-step transactions across 15+ EVM chains.
The platform features:
- Natural language workflow builder powered by ASI:One agents
- Multi-chain support (Ethereum, Base, Arbitrum, Optimism, Polygon, etc.)
- Automated swap execution via Uniswap V3
- WETH wrapping/unwrapping functionality
- Real-time transaction notifications via Blockscout
- Persistent workflow templates with MongoDB
- Account abstraction using Lit Protocol for secure key management
- Vincent SDK authentication for seamless user onboarding
- MeTTa RAG knowledge base for intelligent DeFi decision-making
Users can save workflows as templates, chain multiple operations together, and let the AI handle all the complexity of cross-chain DeFi interactions.
DeFlow uses a hybrid architecture combining traditional web2 components with cutting-edge AI and blockchain technology:
Frontend (React + Vite):
- Vincent SDK for passwordless OAuth authentication
- Blockscout SDK for real-time transaction notifications and explorer integration
- Visual workflow builder with node-based UI for planning multi-step operations
Backend Services (Node.js + Python on GCP):
- Node.js Express API handling Vincent auth, workflow CRUD operations, and blockchain interactions
- Python Flask service running ASI:One agents with MeTTa reasoning engine
- PM2 process management with Google Cloud Ops Agent for centralized logging
- MongoDB Atlas for workflow persistence and user data
Blockchain Integration:
- Lit Protocol PKPs (Programmable Key Pairs) for distributed key management and transaction signing
- Ethers.js for multi-chain RPC connections across 15+ networks via Alchemy
- Uniswap V3 SDK for optimal swap routing and price calculations
- Custom token transfer and WETH wrapping utilities
AI/Agent Layer:
- Fetch.ai's uAgents framework for autonomous agent orchestration
- ASI:One client for natural language understanding and workflow planning
- MeTTa (Meta Type Talk) reasoning engine for DeFi knowledge graphs
- Agentverse integration for agent deployment and mailbox communication
- Blockscout MCP agent for blockchain data querying
Hacky/Notable Solutions:
- Built custom MCP (Model Context Protocol) client to bridge ASI agents with blockchain tools
- Implemented BigInt serialization workarounds for handling wei amounts in JSON APIs
- Created dynamic amount inheritance system for chained swaps (output of swap1 → input of swap2)
- Used Vincent's delegatee pattern to avoid storing user private keys
- Integrated GitHub Actions for zero-downtime deployments to GCP's free tier (e2-micro VM)
- Engineered PM2 log collection with Ops Agent to get structured logs in GCP without containers
The most challenging part was getting ASI:One agents to reliably call blockchain functions with correct parameter types while maintaining natural language flexibility. We solved this with a hybrid approach: agents generate high-level plans, which get validated and typed by our Node.js backend before execution.