Created on 17th May 2025
•
Most DeFi platforms offer limited automation, fragmented interfaces, and lack smart execution. Mantua Protocol solves this by combining AI agents, real-time research, and Uniswap v4 hooks into a unified onchain experience. Users can swap, deploy, and interact with liquidity pools intelligently, while AI agents assist with tasks like bridging, token deployment, and market analysis. By enabling hook-based swaps and liquidity provisioning, Mantua enhances LP profitability and trade execution. Built on Base, it brings speed, modularity, and AI-native infrastructure to DeFi.
Uniswap v4 Hook Integration: Integrating dynamic fee hooks into both swap and liquidity flows required deep understanding of Uniswap v4’s architecture. We overcame this by carefully reviewing the v4 router documentation, encoding pool keys manually, and simulating transactions on Base Sepolia.
Real Wallet Connectivity: Ensuring seamless wallet connection across OnchainKit, AgentKit, and Nebula was difficult. Wallet connection state needed to persist across chat, swap, and liquidity modals. We resolved this by standardizing wallet access across components using Wagmi context and OnchainKit’s smart wallet utilities.
Executing Real Transactions via AI Chat: Connecting Nebula and later AgentKit to execute real onchain swaps — not just simulate them — required rewriting the agent execution logic and integrating it with our Uniswap v4 hook-based backend.
Token Metadata and Icon Issues: Displaying live token icons across swaps, liquidity, and portfolios was unreliable at first due to inconsistent API responses from Moralis. We solved this by implementing fallback token maps, batching API requests, and eventually introducing Thirdweb’s token API for stability.
React Render Loops & Modal Bugs: During the liquidity modal buildout, we hit several “too many re-renders” errors due to React state updates in render cycles. We addressed this with precise useEffect hooks and improved conditional rendering logic.
**Onchainkit & Agentkit: ** During development, we faced significant challenges integrating OnchainKit and AgentKit. The wallet system initially caused issues where transactions were executed using the wrong address, breaking user trust. We resolved this by restructuring wallet state management and tying all actions explicitly to the connected wallet. AgentKit presented another hurdle—its intent-based architecture conflicted with wallet execution flow, so we redesigned the experience so agents prepare transactions, but users must confirm execution via their wallet. We also implemented dynamic syncing between agent memory and wallet changes to prevent context mismatches. These fixes ensured secure, reliable, and intuitive user interactions.
Despite the complexity, each obstacle helped us refine the architecture into a scalable, modular DeFi+AI stack.
Tracks Applied (2)
Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.