Deffi is DeFi portfolio manager that makes DeFi accessible to everyone.
Deffi consists of two main agents:
- Onboarding agent. Which personalizes the user experience based on their risk tolerance and investment goals.
- Portfolio Manager agent. Which helps the user manage their portfolio and make investment decisions.
Portfolio Manager has its own tools and can help the user itself:
- Wallet management tools - ask address, balance, send and receive native token, send and receive ERC20 tokens
- Defi protocols interaction tools - e.g swap, deposit USDC to Morpho vault, etc.
Also he can hire other agents from pre-built set of agents or in future from agents App Store:
Pre-built agents which are currently available:
- Defi strategies explanation agent - explain how a particular DeFi strategy works, a brief information about protocols involved (TVL, audits, twitter), risks and rewards
- Defi strategies monitoring agent
- 📱 Automated daily reports aggregating insights from DeFi-focused Telegram channels and on-chain data
- 🔔 Configurable alerts for important DeFi events and opportunities
2 and 3 implemented in a companion bot:
Companion bot link:
Companion bot repo:
Test channel
Main app
Repo link:
Technical Stack:
- Coinbase AgentKit for AI agent orchestration and DeFi interactions, customized for using on the frontend. Tools: walletActionProvider, customized Morpho actions provider, Aave actions Provider started
- Coinbase Smart wallet for secure wallet management on the frontend, transactions batching and paying gas in USDC
- Base network (mainnet + Sepolia testnet) as primary blockchain
- LangChain for natural language processing
- React/TypeScript+Vite frontend
- Coinbase offramp for wallet top up using fiat and paying for LLM requests in the future.
Companion bot with DEFI Strategies explanation and monitoring agents:
repo link:
how it works
We've been using AWS Bedrock as our core AI infrastructure for it, leveraging several key AWS technologies and integrations:
Core Architecture:
- Amazon Bedrock for LLM orchestration and RAG (Retrieval Augmented Generation)
- Custom Knowledge Base built on AWS to store DeFi protocols data and historical strategies
- AWS Lambda for serverless compute
- DynamoDB for real-time data storage
- Amazon SNS for notifications
Key Technical Components:
- LLM Integration:
- Used Bedrock's Claude model for strategy analysis and risk assessment
- Implemented custom prompt engineering for DeFi-specific analysis
- Built RAG system to provide context from historical data
- Data Processing Pipeline:
- Created custom Knowledge Base using Bedrock KB to store:
- Protocol TVL data
- Historical strategies
- Risk metrics
- Audit reports
- Implemented real-time updates using DynamoDB streams
- Multi-Language Support:
- Leveraged Bedrock's multilingual capabilities for translation
- Built custom tokenizers for DeFi-specific terminology
- Integration Layer:
- Built custom connectors for:
- Telegram API
- DeFi Llama API
- Protocol APIs
Notable Technical Achievements:
- Developed a custom RAG implementation that combines real-time DeFi data with historical analysis
- Created an efficient caching system for frequently accessed protocol data
- Built a flexible plugin architecture for easy integration of new protocols
The most "hacky" but effective solution was our custom prompt engineering system that dynamically generates context-aware prompts based on the type of DeFi strategy being analyzed, significantly improving the accuracy of the analysis.