project screenshot 1
project screenshot 2
project screenshot 3

DefiHedge

DeFi-Hedge: Quantitative Investment Strategy tool for Institutional Focused Investors

DefiHedge

Created At

ETHGlobal New York 2025

Project Description

DeFiGuard Risk is an enterprise-grade, production-ready platform that brings institutional-quality portfolio risk analysis to the DeFi ecosystem for the first time. The platform solves a critical problem in the gut-driven, high-risk DeFi market: the complete lack of sophisticated risk management tools available to the average investor.

Our system follows a powerful "Fetch, Analyze, Act" workflow:

Fetch: A user connects their wallet (or enters any public address), and our platform instantly aggregates their entire token portfolio across multiple major blockchains (including Ethereum, Polygon, and Base). This provides a unified, comprehensive view of all their holdings in a single interface.

Analyze: This is the core of our platform. We feed the user's portfolio data into a powerful backend engine built with battle-tested quantitative finance libraries (Riskfolio-Lib and PyPortfolioOpt). The engine performs a deep analysis based on Modern Portfolio Theory, calculating key institutional metrics like Sharpe Ratio, Sortino Ratio, Value at Risk (VaR), and Maximum Drawdown.

Act (Visualize & Understand): Instead of just showing numbers, we provide actionable, intuitive visualizations that help users understand their risk. Our key features include:

Risk Contribution Charts: See which assets are contributing the most (or least) to your overall portfolio risk.

Correlation Heatmaps: Understand how diversified your portfolio truly is by seeing which assets move together.

Efficient Frontier Plots: Visualize the optimal risk/return tradeoff for your specific assets and see how your current allocation compares to the mathematically ideal portfolio.

DeFiGuard Risk democratizes the tools used by Wall Street's top quantitative analysts, making them accessible, intuitive, and actionable for any DeFi investor.

How it's Made

DeFiGuard Risk is a full-stack application built with a professional-grade architecture designed for performance, scalability, and accuracy.

Backend: The backend is a Python FastAPI server that serves as the core analytics engine. We chose FastAPI for its high performance and native support for Pydantic, which allowed us to build robust data models for complex portfolio structures. The engine integrates two key quantitative finance libraries:

Riskfolio-Lib & PyPortfolioOpt: These libraries are the heart of our analysis. They power all the Modern Portfolio Theory calculations, from correlation matrices to efficient frontier optimization, allowing us to offer institutional-grade metrics.

Frontend: The frontend is a React/Next.js application built with TypeScript for type safety. We used a modern component library, shadcn/ui, with Tailwind CSS to rapidly build a polished, professional, and fully responsive "glassmorphism" UI. For the complex data visualizations, we used Recharts, a powerful library that allowed us to create the interactive donut charts, heatmaps, and scatter plots that make our analysis so intuitive.

Partner Technologies: Our "Fetch" capability is powered by the Coinbase CDP Data API. This was a crucial choice that benefited our project immensely. The CDP API allowed us to reliably and efficiently aggregate a user's token balances across multiple blockchains with a single, simple integration. This saved us an enormous amount of development time and enabled us to focus on our core competency: the risk analysis engine. Without the CDP API, building the foundational multi-chain aggregation feature would have been a hackathon in itself.

Integration & Workflow: The frontend and backend communicate via a RESTful API. The user inputs a wallet address, the frontend calls our backend, which then queries the Coinbase CDP API, gets the portfolio, runs it through the risk analysis engine, and returns the structured data and metrics to the frontend for visualization. We implemented comprehensive caching and debouncing to ensure the application is performant and doesn't hit API rate limits, even with real-time data.

background image mobile

Join the mailing list

Get the latest news and updates