Inspiration

We were inspired to build our portfolio risk manager after hearing insights from the Chief Risk Officer at Two Sigma about how effective risk management is the foundation of long-term performance, not just a defensive afterthought. The emphasis on understanding exposures, stress testing portfolios, and continuously monitoring risk as markets evolve reinforced our belief that managing uncertainty is as important as generating returns. That perspective drove us to create a tool that empowers investors to proactively measure, manage, and adapt to risk in real time.

What it does

Our AdvisorIQ system reallocated client portfolios that signal by computing the divergence between options-implied volatility and an ML-predicted realised vol forecast using an S5 state space model that uses High-order Polynomial Projection Operators, whose outputs are projected into a bilinear transform and an entire 252-step sequence is processed as an FFT-based convolution.

We then interpret the divergence through a regime-aware threshold system determined using a hidden Markov model. The system uses a Hidden Markov Model because the regime itself is unobservable. You can't directly measure whether we're in a stress environment as there isn’t a single statistic that tells you that. But we can observe the symptoms of stress. We use hidden states to generate observable macro regimes usingGaussian emission distributions, and the hidden states transition according to a learned Markov chain that is calibrated to 3 years of data.

It then translates the findings directly into per-client rebalancing recommendations using mean-variance optimisation computed via expected returns and a covariance matrix as inputs. We then utilise an LLM layer to translate these calculations into comprehensible insights that can be understood by both the client and the advisor.

How we built it

We first use a preprocessing pipeline ingests live equity and macro data, aswell as options chain data which we use to back out implied volatility using Black-Scholes. We then built two ML models run in parallel. Firstly a per-ticker S5 State Space Model forecasting 30-day realised volatility, and an HMM classifying the current market regime.

These outputs are then leveraged in a signal engine that computes the divergence between options-implied and ML-predicted vol, firing alerts when both the regime-adjusted implied volatility divergence threshold and a historical implied volatility percentile condition are simultaneously met.

Those signals feed into a mean-variance optimiser where we replace historical diagonal variances with implied volatility based implied variances, producing per-client rebalancing recommendations across five distinct risk profiles. We then leverage an LLM layer that takes the structured quantitative output and generates plain-English client summaries via a constrained system prompt, served through a FastAPI backend and React dashboard.

Challenges we ran into

Building and calibrating the models, in particular ensuring that the S5 State Space Model is stable and does not suffer from exploding gradients (which is a common issue with this specific model).

Also as rookie hackers adapting to the fast paced and high pressure environment of Hackathons was a challenge that we had to overcome

Accomplishments that we're proud of

Being able to apply combine implied volatility, ML signals and regime classification to inform our decisions. The complexity of our end-to-end system is something we believe really stands out about our project, and we are proud of being able to combine these signals

What we learned

We learnt how to work well as a team and collaborate in a faced paced environment with extreme time constraints. Another thing that we learnt was how to deploy a full scale end to end project from back-end development to end-to-end production MLops systems covering model architecture, training and deployment

What's next for AdvisorIQ

What's next for AdvisorIQ is an expansion across various financial instrument portfolios as opposed to strictly stock-based portfolios, making it able to support portfolios with derivatives.

Built With

Share this project:

Updates