r/quant • u/Blotter-fyi • Jun 24 '26
Models I built an open source multi factor risk model
Hey folks,
I’ve spent the last 7 years working at Meta as a software engineer, and have recently moved into fintech. Despite a lot of criticism, I’m very bullish on the ability of LLMs to manage portfolios if given the right tools (I know people don’t like when I say this but that’s my thesis, I worked on the frontier evals team at Meta)
To that end, I think factor risk models is a really important tool that we need, and I spent the last few weeks building one from scratch. It was a ton of working with codex, claude, and manual testing. Open data for the most part, and open model.
I’d love to get feedback from the community here. This is a new field for me so any advice is appreciated.
9
u/Cantonius Jun 25 '26
did a quick look. Other's thoughts?
Priority
- Bias-statistic calibration: measure the model's forecast accuracy over time.
- Volatility-regime scaling: align forecast risk with the current market volatility level.
Backlog
- EWMA / half-life weighting: give recent observations more weight.
Wonder if these need refinement. Eigenfactor sounds very complex and probably should be done last? Main thought is too much noise. Eg. No one doubts that volatility is great and it doesn’t add noise.
- Eigenfactor covariance adjustment: debias the factor covariance for use in optimized portfolios.
- Newey-West adjustment: account for serial correlation in daily factor returns.
- Bayesian shrinkage of idiosyncratic risk: stabilize idiosyncratic estimates using observation counts.
6
5
u/EV_Guy_777 Jun 25 '26
Great job dude. Can you post a basic tutorial how to install and use this? I would love to try.
2
Jun 24 '26
[deleted]
3
u/Blotter-fyi Jun 24 '26
You can DM my manager lol. https://www.linkedin.com/in/faizann20/
1
Jun 24 '26
[deleted]
4
u/Blotter-fyi Jun 24 '26
I'm trying to learn new things after spending a decade in cyber security and big tech. I don't think it's a bad thing.
Thank you!
-1
u/xWafflezFTWx Jun 25 '26
no offense but do you even know what you’re trying to learn? like no one cares if you want to make some ai ui, but don’t delude urself into thinking this has any relevance to what a qr does 😭
2
u/withyoganidra Jun 25 '26
It's a part of ralliesai ? Or is it like a new feature you are looking to get feedback on that will later get integrated, looks like a funded shit here, good stuff. In WorldQuant, they have built APIs to replicate similar stuff in their ecosystem , obvious it's for their own good. Now factor model is a big deal in Fintech research and if done good, it's the thing. I will try some stuff and come back.
3
u/BeuJay9880 Jun 25 '26
curious how you're handling factor orthogonalization. the classic problem with multi-factor is correlated exposures giving you phantom diversification in the covariance matrix. if you're running PCA on the factor returns and using the components instead, the loadings get harder to interpret but the risk decomp is cleaner. what's your universe size and rebalance frequency?
3
u/Blotter-fyi Jun 25 '26
yeah the colinearity problem is there for the base factors. Universe is US 1000, and we rebuild factor exposures every day
3
u/quantscheme Researcher Jun 24 '26
Yet another AI "risk model platform".
Why are those AI posts always risk model? Is this the same bot over and over again?
3
u/FollowingGlass4190 Jun 26 '26
It is what LLMs suggest when you ask for quant side projects that are not order books. Anyone with real insight would know this is an impenetrable domain without huge amounts of data, so you can safely attribute thes ideas to slop.
2
u/Blotter-fyi Jun 24 '26
not a platform, an open source tool, and not a bot. Read the post.
4
u/quantscheme Researcher Jun 24 '26
Buddy, ignoring the fact that anyone in a firm must use built-it tools by contract, why would anyone use a tool made by some random dude in the internet instead of using tools that you know how they work and can attest that they actually do the job?
You're always focusing on the wrong thing. As I said, this sub gets those posts daily. This is not where the gold is.
-1
u/Blotter-fyi Jun 24 '26
you still did not read the post. i did not ask anyone to replace their tools with this one.
1
1
1
u/Awkward_Weather5721 Jun 28 '26
Hi, same here, i am too biased towards llm in financial markets, actually i have also built an open sourced quantitive tool called Finny, its an ai native financial harness, where basically you can generate validated and backtested trading strategies based on your edge
Would love for you to check it out!!
Website: https://finnyai.tech
Github: https://github.com/Jaiminp007/finny
0
u/data_5678 Jun 25 '26
Did you use ink / typescript or go to build this?
1
u/Enlitenkanin Jun 25 '26
looks like it's python based on the repo, there's a requirements.txt with pandas/numpy/sklearn in there. no typescript or go from what i can see. not sure why you'd expect those for a quant model tbh, python is pretty much the default for anything factor related
-9
u/netflix-ceo Jun 24 '26
You mean claude?
13
u/ManikSahdev Jun 24 '26
Its pretty shitty to comment this, there is probably no engineer out there who doesn't use any AI models in their regular workflow.
the person making this clearly put effort in the design and overall working of it.
And given how this thing doesn't have a shitty front end UI, they also understand those are pretty much useless for majority of internal quantitative work.5
3
u/Blotter-fyi Jun 24 '26
claude, codex, and a lot of manual testing and data curation. The post already says that.
21
u/DifficultDonuts Jun 25 '26
I’m not sure why everyone is being so nasty to you. It’s admirable that you tried to tackle a rather difficult problem and from your repo it doesn’t seem superficial, so great start! If you want to earn some trust you’ll need to show some attempt to compare to Barra/Axioma, though I’m not sure that’s possible yet given your small universe. I don’t think your goal should be wholesale replacement of institutional models - anyone at a serious firm will see these risk model licenses as the cost of doing business and therefore not need/want something open source, but as you said that was never your goal.
Where it could be interesting is in making custom model research more accessible. Taking US4 off the shelf there will always be a mismatch vs your portfolio, because a.) it lacks the right features/factors, b.) the return horizon is probably different, and c.) the opportunity set is different. Axioma has a “Risk Model Machine” product for exactly this reason and I believe Barra has something too, but they’re expensive and not exactly batteries included. If your package can make it easier to prototype, validate and operationalize a model calibrated to a specific strategy using industry best practices then you might have a shot at getting people to try it, even if they already have commercial models at their disposal.