Inspiration

Looking across the different challenges available to us, we decided that it would be best to go for a specific challenge as opposed to the overall challenge. This was our first-ever hackathon so the brainstorming period was erratic, messy, but most importantly, exciting. We had endless ideas but we eventually narrowed it down to the Goldman Sachs challenge, as we really liked that the problem statement gave us lots of information while remaining very open-ended. We thought it would be best to not only give advice based on economic indicators but also personal indicators (how risky of an investment the person themself wants to make). Throughout the hackathon, we enjoyed finding a balance between mathematically determining risk via quantitative factors and sentimentally determining risk via the user's personality.

What it does

After a very insightful Goldman Sachs panel, we realized that there are ultimately two qualities we want to judge the user on: how they want to invest and how they want to be told how to invest. For the first quality, for example, we decided to make users choose between wanting to make safer or riskier investments. For the second quality, some users are more mathematically aligned, where they would want to be told as much data as possible to make their decisions. Other users are less dependent on hard data and lean towards prefer more of a qualitative approach towards diversifying their portfolio. We took all four combinations of users into account by providing personalized advice in a personalized way.

How we built it

We used python for just about all of our data analysis. Using APIs to pull data from stocks and using that data to determine several quantitative measures for how risky they are: the Beta value and the Sharpe and Sortino ratios. For treasury bonds, we quickly realized that the risk is very external, to the point that the only way to really define it is geopolitical stability. As such, we found the yield to maturity to be the best quantitative metric to use for making decisions on bonds.

We then decided to give the user the option at the very beginning as to whether they want riskier or safer advice, and provided the user with educated advice given their choice. The initial advice is given on a more qualitative approach, approximating risk with interest and inflation rates, unemployment, index funds, etc. But upon the user asking us to "tell them more," we would provide them with all of our data and math. We found that this was the best way to cater to as many users as possible.

Challenges we ran into

We developed a fully generalized equation that when solved for x would give the yield to maturity, but the equation is very complex (pun intended). We initially tried using Wolfram Alpha's API to give an exact solution but we found that integrating it into our website in a streamlined way wasn't really doable, since Wolfram Alpha had never intended their language to be used that way. Instead Wolfram Alpha allows users to build their own "widgets," specifically designed to be easy to embed. Unfortunately, building widgets requires Adobe Flash player which has been discontinued for quite some time now. That is when we realized we could use a numerical approximation method to find the answer we want, essentially just doing a binary search until we are close enough to the solution (within a set tolerance).

We also had endless issues with streamlining our python code with react. We tried using the flask backend but unfortunately ran into problems all the way to the end of the competition and had to make a compromise of just including our raw data in a table instead of the streamlined equations.

Accomplishments that we're proud of

We are very proud of the mathematical methods we determined for calculating risk for both stocks and bonds and especially our procedure for adjusting those investments based on both user and world data. Normalizing the Beta and Sharp values for stocks as well as the yield to maturity for bonds and multiplying those by the percentage of the portfolio invested in specific stocks and bonds to adjust given their potential risk and return is something we are very proud of.

What we learned

The biggest lesson we learned was to build our back end with more consideration toward integrating with the front end, as it was ultimately the greatest struggle we faced.

What's next for Financial Risk Mitigator

Integration and streamlining. We are very proud of both the quantitative and qualitative conclusions we made and would love to be able to show them to the world with the research we spend on it. We also plan to add more dynamic figures to give a more symbolic representation of the portfolio adjustments.

Built With

Share this project:

Updates