A multi-agent system that automates cross-chain DeFi strategies using LI.FI as the execution layer.
Chains and protocols shouldn’t block users. LI.FI Agents Orchestrator makes DeFi goal-driven: you say what you want, AI agents coordinate and execute it. An intent parser turns natural language into operations. Seven specialist agents handle arbitrage, yield, risk, rebalancing, and swaps. They work together in a pipeline: Paul coordinates, specialists analyze, Duncan validates, Stilgar executes via LI.FI. USDC cross-chain transfers use Arc (Circle CCTP) for native burn/mint. You can check balances, optimize yields, find arbitrage, rebalance, and bridge—all through chat. No forms, no jargon, no chain hunting. Just intent and execution.
We made cross-chain DeFi intent-driven right from the chat interface. Users describe what they want in plain English—"put my USDC where it earns the most" or "swap 100 USDC from Ethereum to Arbitrum"—and AI agents coordinate balance checks, yield scans, risk validation, and execution. We built an intent-driven agent orchestrator using React, Vite, wagmi/viem, and integrations with five partner technologies: LI.FI SDK, Arc (Circle CCTP), Google Gemini, DeFiLlama, and direct RPC fallbacks.
LI.FI SDK (Routing & Execution Layer) — The LI.FI SDK v2 (@lifi/sdk) powers all cross-chain routing and execution. Our integration (services/lifi.ts) implements the full flow: getQuote() for route discovery, executeRoute() for signing and execution, and getContractCallsQuote() for bridge-plus-deposit flows (e.g. bridge USDC and deposit into Aave in one transaction). LI.FI’s aggregator model lets us route through the best bridge—including CCTP for native USDC—without maintaining liquidity or bridge contracts. The SDK is initialized with an integrator name, RPC config, and optional API key for higher rate limits.
Arc / Circle CCTP (Native USDC Transfer) — Arc (Circle's liquidity hub) uses CCTP for native USDC burn-and-mint transfers. Our Arc integration (services/arcIntegration.ts) defines supported chains, CCTP domains, and native USDC addresses. When LI.FI returns a CCTP route for USDC→USDC, we detect it via getArcTransferInfo() and display the Arc badge in the UI. This gives users canonical USDC across chains instead of wrapped or bridged tokens. The burn-on-source, mint-on-destination flow is handled by LI.FI; we add UX and transparency around it.
Google Gemini (Intent & Agent Intelligence) — Gemini powers intent resolution and agent personality. For unclear or ambiguous user input, we use Gemini to interpret and refine the intent before routing. Each agent (Chani, Irulan, Liet-Kynes, Duncan Idaho, Thufir Hawat, Stilgar) can call Gemini for conversational summaries of data (e.g. arbitrage opportunities or portfolio status). The chat assistant (hooks/useAgentChat.ts) uses Gemini with tool calling for balance checks, swap quotes, yield searches, and agent orchestration. AI makes the system feel conversational while the core logic stays deterministic.
DeFiLlama (Yield Data) — DeFiLlama’s yields API (yields.llama.fi/pools) is the source of yield data. Our yield fetcher (services/yieldFetcher.ts) pulls pools, filters by chain and stablecoin, and ranks by APY and TVL. Yield rotation (services/yieldRotation.ts) uses this data to find the best cross-chain rotation and builds LI.FI routes for bridge-plus-deposit. OneClickYield and the agent pipeline both rely on this layer. DeFiLlama’s broad coverage lets us surface yields across many protocols and chains without per-protocol integrations.
Intent Parser & Agent Pipeline (Orchestration Layer) — Intent parsing (services/intentParser.ts) maps user text to intents and agent sequences using pattern matching. Keywords like "yield", "arbitrage", "rebalance", and "check my wallet" map to intent types and fixed requiredAgents lists (e.g. yield → a0, a3, a4, a6). The agent pipeline (App.tsx) runs each specialist in sequence: Chani for arbitrage, Irulan for portfolio, Liet-Kynes for yield, Duncan for risk, Thufir for rebalancing, and Stilgar for execution. Each agent calls its backend (price fetcher, portfolio tracker, yield fetcher, risk analyzer, LI.FI). This keeps the flow clear and predictable while still feeling like an AI-driven experience.
Viem / Wagmi (Wallet Integration) — We use wagmi and viem for wallet connection, but the LI.FI SDK expects an ethers-style signer. Our adapter in lifi.ts wraps the viem WalletClient and exposes getAddress(), getChainId(), signMessage(), and sendTransaction(). The adapter also implements switchChainHook so LI.FI can switch chains and re-wrap the signer for the new network. This lets us keep wagmi/viem as the wallet layer while satisfying LI.FI’s signer interface, so users can connect any compatible wallet and execute routes without extra setup.
Direct RPC & Rate Limiting (Resilience Layer) — Balance fetching uses direct RPC calls for balanceOf with fallback providers (drpc.org, 1rpc.io, cloudflare-eth.com, ankr) before falling back to the LI.FI SDK. This reduces SDK rate limits and improves reliability when RPCs are slow. For quotes, we use a global queue (acquireQuoteSlot()) so only one quote request runs at a time, with minimum intervals (5s with API key, 40s without) and exponential backoff on 429. LI.FI limits are about 200 req/2hr without a key and 200 req/min with one; our queue and retries keep the app usable under those limits.
As these protocols and integrations evolve, the agent orchestrator can stay the same: users state intent, and the system routes to the right tools and chains behind the scenes.

