ChainHopper Agent

AI agent that analyzes your crosschain assets and generates optimal rebalancing strategies via LI.FI

ChainHopper Agent

Created At

HackMoney 2026

Project Description

ChainHopper Agent is an AI-powered portfolio rebalancer that works across Ethereum, Arbitrum, Base, and Optimism. Enter an ENS name or wallet address, and the agent fetches your token balances across all chains, analyzes your current allocation, and uses GPT-4o to generate a personalized rebalancing strategy. It then fetches real LI.FI quotes for each recommended swap or bridge, ready to execute. The goal: make crosschain DeFi portfolio management as simple as chatting with an AI assistant.

How it's Made

Built with TypeScript and Next.js 16. ENS resolution uses viem to convert names like vitalik.eth to addresses. Portfolio fetching hits multiple RPC endpoints in parallel across 4 chains (ETH, ARB, BASE, OP) for native ETH plus USDC/USDT/WETH. The AI brain is OpenAI's GPT-4o with structured JSON output, we engineered a system prompt that outputs valid RebalanceAction objects with chain IDs. LI.FI's REST API provides real time crosschain quotes. Frontend uses RainbowKit for wallet connect. The hacky part: we lazy-load the OpenAI client to avoid API key errors in demo mode, and we parallelize all balance fetches to keep latency under 3 seconds despite hitting 16 RPC calls.

background image mobile

Join the mailing list

Get the latest news and updates

ChainHopper Agent | ETHGlobal