Inspiration
We were tired of finding out about bad news after the fact. You open your portfolio and you find out something is down 10% and you have no clue why. So you spend the next 20 minutes bouncing between news sites trying to piece it together, and get absolutely nowhere. Heimdall is our attempt to fix the headache.
What it does
You put in your stock holdings and Heimdall pulls together the news, price data, risk metrics, and an AI-generated brief that tells you what is important across your portfolio. There's also a correlation map that shows how your holdings move relative to each other, so you can see whether you're diversified or just holding a bunch of autocorrelated assets.
How we built it
We used HTML/CSS to build our web application. For our morning brief, we used yfinance as our go-to for relevant and high quality stock data and news headlines, and fed this information to Llama AI to generate high-impact, relevant summaries. To wrap it all up, we used a 252 day pairwise correlation to find correlations between all possible stocks. We then used a physics simulation with the stocks as nodes connected to each other with springs, with the strength of each spring directly proportional to the strength of the correlation. This simulation allowed us to generate our correlation map and portfolio analysis.
Challenges we ran into
Two things nearly broke us. The first one was getting Llama-3-8B to return clean JSON every single time was way harder than expected. It would work fine, then randomly go off format and crash the brief. It took lots of prompt iteration and defensive parsing to get it stable. The other one was the correlation analysis. Computing real-time cross-stock relationships and rendering them in a physics simulation that didn't feel like a slideshow took way more back and forth than we budgeted for. Both were broken at the same time at some point around 1am.
Accomplishments that we're proud of
The correlation web came out better than we expected. It's a live physics-based graph that actually moves and responds and it looks nothing like what you normally see in finance apps. The morning brief also works in a way we're happy with, and it produces summaries that are relevant and high-impact. It turns out taking the live news and portfolio numbers and getting the LLM to synthesize something readable was harder than it sounds.
What's next for Heimdall
Making the correlation web dynamic so the user can see how stock relationships shift during different market conditions and regimes, and turning the morning brief into proactive alerts so Heimdall reaches out when something happens instead of waiting for you to open the app.
Built With
- auth0
- css3
- fastapi
- html5
- javascript
- openai
- python
- snaptrade
- yfinance
Log in or sign up for Devpost to join the conversation.