Inspiration (Problem Statement)
Financial institutions manage billions of dollars in bond investments, but managing the risks associated with these portfolios isn't always straightforward. Some institutions operate under investment mandates or restrictions that prevent them from freely selling certain assets, leaving them exposed to potential losses during market downturns.
This is a significant problem in an enormous market. In July 2025, the U.S. high-yield bond market was estimated at approximately $1.4 trillion, while the broader U.S. corporate bond market had grown to $12.1 trillion in outstanding debt by Q2 2026. These figures illustrate the scale of the market exposed to credit risk, rather than the direct addressable market for our software.
We wanted to explore how institutions could manage downside risk without liquidating their underlying investments. More specifically, we were interested in comparing traditional short hedges against inverse exchange-traded funds (ETFs), whose daily rebalancing introduces different behaviors over longer investment periods.
This inspired HedgeLab, an interactive research platform that makes complex portfolio hedging strategies easier to simulate, visualize, and understand.
What it does (How does it solve the Problem)
HedgeLab is an interactive bond portfolio risk simulator that allows users to compare different approaches to protecting a high-yield corporate bond portfolio.
Using historical market data from HYG, a high-yield corporate bond ETF, and SJB, an inverse high-yield ETF, our application evaluates three strategies:
- An unhedged bond portfolio.
- A portfolio with a static short hedge.
- A portfolio with a funded, buy-and-hold inverse ETF hedge.
Users can explore historical market scenarios, adjust hedge ratios, modify financing and transaction-cost assumptions, and examine how each strategy affects portfolio value, profit and loss, drawdowns, and overall risk exposure.
We also integrated Google Gemini to provide an interactive financial assistant that explains simulation results, helps users understand financial terminology, and answers follow-up questions using calculations generated by our backend.
Rather than predicting market movements or automatically executing trades, HedgeLab provides an educational environment for understanding the financial trade-offs behind different hedging decisions.
How we built it
We developed HedgeLab as a full-stack web application using React, TypeScript, Vite, Python, and FastAPI.
Our React frontend provides an interactive dashboard where users can configure simulations, compare portfolio performance, and explore risk visualizations.
The FastAPI backend handles the financial calculations, including historical return analysis, hedge exposure, portfolio accounting, financing assumptions, drawdowns, and in-sample hedge-ratio optimization.
For our market data, we developed a Python data-processing pipeline using historical HYG and SJB prices, with validation, date alignment, and metadata tracking. Our bundled dataset contains 3,912 aligned trading observations spanning March 2011 through October 2026, with legacy data provenance limitations explicitly disclosed.
We incorporated Google's Gemini API through our backend to generate contextual explanations of the user's simulations. The assistant receives server-calculated results and assumptions rather than independently performing the authoritative financial calculations.
We also used Pytest and Playwright to test backend calculations, API behavior, and frontend interactions.
Challenges we ran into
One of our biggest challenges was understanding the financial mathematics behind leveraged and inverse ETFs, particularly daily rebalancing, compounding, and convexity.
Although a static short position and an inverse ETF may initially provide similar negative market exposure, their returns can differ significantly over multiple trading days. Translating these financial concepts into reliable Python calculations required us to distinguish between the strategies' mechanics and accounting assumptions.
Another challenge was handling historical financial data. We needed to align trading dates, account for adjusted prices, validate our datasets, and communicate limitations in the original data's provenance.
Connecting our financial backend to an interactive React dashboard also required careful coordination of API schemas, simulation inputs, and visualization outputs. Some rolling-window research calculations and API response validations remain areas we are actively improving.
Finally, integrating generative AI while ensuring that numerical results remained grounded in our backend calculations introduced an additional layer of complexity.
Accomplishments that we're proud of
Some of our biggest accomplishments include:
- Developing a configurable simulation engine for comparing unhedged portfolios, static short hedges, and inverse ETF hedges.
- Building interactive visualizations that help users understand portfolio returns, drawdowns, and exposure changes across historical market scenarios.
- Implementing an in-sample hedge-ratio search to explore how different hedge allocations affect historical performance.
- Integrating Gemini to make technical financial results more approachable through conversational explanations.
- Creating a modular React and FastAPI architecture with automated testing, API documentation, and a reproducible local demo.
What we learned
Throughout this project, we gained a much deeper understanding of portfolio risk management, bond markets, short selling, and inverse ETFs.
One of our biggest takeaways was learning that a hedge isn't necessarily better simply because it produces a higher return. Its effectiveness also depends on how well it protects against downside risk, its costs, and the market conditions in which it's used.
We also explored the mathematics of daily rebalancing and convexity, learning why inverse ETFs can outperform static hedges in certain market conditions while underperforming in others.
From a technical perspective, we gained experience developing financial calculation pipelines, designing REST APIs with FastAPI, integrating React with Python services, and incorporating generative AI into a data-driven application.
What's next for HedgeLab: Bond Portfolio Risk Simulator.
Our long-term goal is to expand HedgeLab from an educational historical simulator into a more comprehensive portfolio risk research platform.
Our next development priorities include:
Improving model validation: Resolve outstanding research calculation and API consistency issues, verify historical data provenance, and expand automated testing.
Expanding financial modeling: Support more realistic short-position accounting, financing costs, and portfolio-specific credit exposures.
Adding stronger strategy evaluation: Introduce out-of-sample testing to assess hedge-ratio selections beyond the historical periods used for optimization.
Expanding portfolio customization: Allow users to analyze different bond exposures rather than relying exclusively on HYG as a proxy.
Improving AI explanations: Enable Gemini to explain additional risk metrics and comparisons while remaining grounded in verified calculations.
Cloud deployment and accessibility: Deploy HedgeLab online and eventually support saved simulations and shareable research results.
Built With
- gemini
- python
- react
- tigerdata
- typescript
- vite


Log in or sign up for Devpost to join the conversation.