
OAO
An AI agent that leverages The Graph and LangGraph to optimize your portfolio.
Demo
About
This project automates the process of finding lending protocols, comparing markets and optimizing yield for the onchain assets in your portfolio. It leverages a LangGraph pipeline to orchestrate LLM discovery, The Graph onchain data and deterministic Python functions to analyze an Ethereum wallet and come up with a recommendation based on blockchain data.
How it's made
The project consists of a React frontend where the user can input their wallet address. This sends a request to the FastAPI backend which invokes the LangGraph graph (a pipeline of nodes with each their own functions in the process). The first step of the LangGraph graph is to analyze the wallet and its token holdings, it does so through The Token API from The Graph Protocol. Then it engages the LLM (Claude Sonnet 5) to discover relevant lending protocols for the assets in the wallet. Then the LangGraph graph engages the Subgraph MCP server to find subgraphs for the discovered protocols. The subgraphs are then queried to get real market data from the protocols, so that the optimizer node can use that data to make a decision based on yield and TVL. Finally the decision gets handed back to the LLM to create a human-readable recommendation. Each step of the process is being communicated back to the React frontend in real time through LangGraph streams and FastAPI Server-Sent Events.