Autonomous Telegram bot for crypto portfolio rebalancing using AI + on/off-chain signals.
AgentV is an autonomous, AI-powered crypto portfolio rebalancing agent designed to run on the Base L2 blockchain, integrated with Telegram as the user interface and powered by Coinbase AgentKit, LangChain, Nodit Elastic Node, and Nodit Web3 Data APIs.
It acts as an intelligent portfolio manager that analyzes both off-chain technical indicators (RSI, Z-score, for example) and on-chain risk signals (whale transactions, exchange flows, account activity, and latest block data) to provide insights and rebalance decisions. Users can interact with AgentV directly via Telegram via (t.me/AgentV_Smart_Bot):
AgentV leverages Coinbase AgentKit’s built-in wallet, native on-chain actions (swap, transfer, fund), and integrates Nodit’s Elastic RPC and Web3 data endpoints to extract insights from Base chain activity. The agent aims to start with a 50/50 BTC-ETH portfolio and rebalances autonomously based on the user’s selected frequency: hourly, daily, weekly, or monthly.
🔧 How AgentV is Built AgentV is a full-stack, agentic crypto trading bot that serves as a crypto trading portfolio rebalancing agent and is able to run strategy autonomously, along with other capabilities. It's built with the following tech stack:
⚙️ Core Technologies Coinbase AgentKit (reuse): Used to create an onchain-capable AI agent with built-in wallet and ERC-20/CDP toolkits. This powers AgentV’s ability to request funds, interact with smart contracts, and swap tokens directly on Base L2.
LangChain + OpenAI (reuse): Used to structure the autonomous agent logic, memory, and reasoning. All LLM interactions are routed through LangChain with GPT-4o-mini as the backend.
Nodit (new feature built this weekend):
Whale Alert AP (reuse + new feature)I: Paid API integration to track large token movements into/out of exchanges, giving AgentV real-time risk awareness and sentiment flags.
Open-source mean-reversion stack (reuse + new feature): Leveraged on open source public library to generate mean-reversion signals
💬 Frontend / User Interaction Telegram Bot (new feature built this weekend): A custom bot that serves as the primary user interface. Users can:
*Check wallet and token balances. *Get rebalancing advice. *Get wallet funded *Etc.
🧠 Risk & Signal Logic (reuse + new features) Designed a modular risk signal engine that combines: *Off-chain signals (RSI & Z-score etc from the open source mean_reversion module). *On-chain risk signals (Nodit + Whale Alert + Base RPC).
These are merged via a scoring model to determine if a portfolio rebalancing action is needed or if the user should hold.
🧪 Development & Deployment The project is structured using Poetry for package/version management and Flask as the backend server.
For now, I'm running the agent locally via localhost:5050, after spending a few hours trying to deploy on Render. Render was incompatible with certain AgentKit wallet functionalities due to its sandboxed file handling and network cert limitations. Once Coinbase AgentKit has more mature deployment documentation and wallet secrets integration, I'll migrate to a fully hosted version.
🧩 Hacky But Worth-It Bypassed a lot of native infra limitations by: *Injecting wallet secrets via .env + file fallback for compatibility. *Combining CDP tools with external APIs in a layered signal engine. *Building lightweight custom Flask endpoints to bridge LLM → signal engine → onchain execution.