AI-powered platform to learn DeFi, fetch real prices, and execute on-chain swaps.
AgentFi is an AI-powered DeFi education and execution platform that lets users safely explore real DeFi flows on testnets. It combines a NestJS backend (auth, Pyth oracle endpoints, 1inch quotes and swap TX builder, logging) with a React/Vite frontend that includes a multilingual chatbot (English/Spanish), text + audio input, and JWT-gated access to tools. Smart contracts built with Hardhat integrate Pyth’s price feeds across multiple EVM test networks, while the backend calls Hermes to fetch VAAs and push on-chain updates.
On top of this, self-hosted n8n workflows act as AI agents: they receive user prompts via webhook, decide which tools to call (Pyth, 1inch, info), and return structured responses back to the chatbot. Users can ask about DeFi concepts, fetch live oracle prices, simulate swaps via 1inch, and inspect balances, all in one guided interface designed for learning, experimentation, and safe, testnet-based DeFi execution.
AgentFi was built as a modular, multi-agent DeFi education and execution platform. The backend is a NestJS API exposing secured modules for authentication, Pyth price-oracle updates, and 1inch swap quoting/transaction building. We integrated CDP embedded wallets for user onboarding and used the 1inch API to build executable swap transactions. For oracle data, our Hardhat contracts implement a PythPriceConsumer deployed on multiple testnets; prices are updated through Hermes VAAs via backend endpoints.
The AI layer is powered by self-hosted n8n workflows acting as reasoning agents. The React/Vite frontend communicates with n8n through webhook automation, enabling text + audio multimodal prompts and agent-triggered on-chain actions. JWT token gating, role guards, and session-based expiration ensure secure access to DeFi tools. We also built a custom audio recorder and a robust assistantMessage extractor to recover malformed AI responses—definitely hacky but effective during the hackathon. Overall, the system ties together CDP wallets, Pyth, 1inch, Hardhat, NestJS, React, and n8n into a unified DeFi learning environment.

