{"data":{"slug":"discovered-cd174e9225a2bdcfb1c13de8e0adff1cf8f4e11647a760a5","title":"Hedge Fund Blueprint","summary":"Build, plan, review, or extend a systematic hedge fund or trading operation, including data storage, backtesting, risk modeling, signal generation, portfolio optimization, execution, and operations. The skill provides a structured approach to assembling the full trading loop from data to results.","url":"https:\/\/skillshunter.net\/skills\/discovered-cd174e9225a2bdcfb1c13de8e0adff1cf8f4e11647a760a5","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-cd174e9225a2bdcfb1c13de8e0adff1cf8f4e11647a760a5","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-cd174e9225a2bdcfb1c13de8e0adff1cf8f4e11647a760a5.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-cd174e9225a2bdcfb1c13de8e0adff1cf8f4e11647a760a5\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before starting, ensure that the data store (Build 01) can rebuild any past day exactly, including the universe. This is a prerequisite for all subsequent builds. Additionally, use the 'start with' column until a limit is measured (e.g., data size or processing speed), then move to the 'at scale' column.","instructions":"---\nname: hedge-fund-blueprint\ndescription: Use when building, planning, reviewing or extending the platform of a systematic (quant) hedge fund or trading operation as a whole - point-in-time data store, backtester, factor risk model, signals, portfolio optimizer, execution and order management, reconciliation, P&L attribution - or when deciding what to build first, which stack to start with, or whether one of those pieces is finished. Triggers - \"build a hedge fund \/ quant fund \/ trading system from scratch\", \"what should I build next\", research-to-production pipeline, alpha platform architecture, \"is my backtester \/ risk model \/ optimizer good enough\", trade lifecycle from decision to settlement, how the parts of a fund fit together. Use it even when only one piece is named but the user is clearly assembling the full loop.\n---\n\n# Hedge Fund Blueprint\n\nA quant fund is one loop: data feeds research, research approves signals,\nproduction trades them, operations measures what happened, and those results\nchoose the next idea. The loop makes money; no single layer does.\n\n**Build the loop first, thin, one layer at a time, in the order of the build\nsheet. A build is done when its gate passes on real data. Then run the loop\nevery day and let the results choose the next idea.**\n\n## The map\n\n```\nDATA         market data -> fundamentals -> alt data -> point-in-time store\nwhat was known                                            | as-of data\n                                                          v\nRESEARCH     idea queue -> feature pipeline -> backtester -> signal library\nwhat works       ^                                        | approved signals\n                 |                                        v\nPRODUCTION       |   signal blend -> risk model -> optimizer -> risk checks -> execution <-> markets\nwhat to trade    |                                        | every order and fill\n                 |                                        v\nOPERATIONS       +-- attribution <- event log <- reconciliation <- fund admin\nwhat happened    results pick the next idea\n```\n\n## How to work with this skill\n\n1. **Locate the project on the build sheet.** Find out which builds exist and\n   whether each gate would pass today, by reading the repo or asking. A later\n   build that exists says nothing about an earlier one: a backtester running on\n   data that is not point-in-time produces confident fiction.\n2. **Work on the earliest build whose gate fails.** If the request is for\n   something later (deep learning signals with no cost-aware backtester, live\n   trading with no reconciliation), say what is missing and what it puts at\n   risk, offer the thin version of the prerequisite, then follow the user's\n   decision. They may have a reason; make sure it is an informed one.\n   One planned exception: Build 04 can stay red for a long time, because most\n   signals fail. Builds 05, 06 and operations test machinery, not edge, so close\n   the loop on paper with a placeholder signal marked \"not approved\" and keep\n   reporting 04 as failing. A thin loop that runs daily beats a perfect layer\n   with nothing downstream of it.\n3. **Use the \"start with\" column** until a limit is measured: data too large,\n   solve too slow, researchers blocked. The \"at scale\" column is where funds\n   end up after years, and reaching for it early is the most common way a fund\n   project never trades.\n4. **Wire the gate to their data and report its output.** The functions in\n   `scripts\/` take plain pandas and numpy objects. Show the PASS\/FAIL lines as\n   the evidence. Never call a build done because the code looks right.\n5. **Read the reference for the layer in hand** before designing it (table below).\n\n## Build sheet\n\n| # | Build | What it does | Start with | At scale | Done when |\n|---|---|---|---|---|---|\n| 01 | Data store | Every price, filing and alt dataset stored with the date it became known | Parquet files, DuckDB | kdb+, ClickHouse | Any past day rebuilds exactly, universe included |\n| 02 | Backtester | Event-driven simulator with real costs, delays and partial fills | Python, Polars | Custom C++ engines | Raw data in, the same result out, every time |\n| 03 | Risk model | Factor exposures, factor covariance and stock-specific risk | PCA or style factors | MSCI Barra, Axioma | Predicted volatility tracks realized volatility |\n| 04 | Signals | Forecasts of return per asset over one fixed horizon | Ridge, gradient boosting | Deep learning on GPU clusters | Edge survives costs on data the model never saw |\n| 05 | Optimizer | Forecasts into target weights under risk limits and costs | cvxpy | MOSEK, Gurobi | Risk and turnover stay inside their limits |\n| 06 | Execution | Order system, broker connection and pre-trade risk checks | Broker API, paper account | In-house OMS, FIX to many brokers | Paper fills match the backtest's cost estimate |\n\nThe order is a dependency chain. The backtester needs as-of data. Signals can\nonly be judged in a backtester that charges costs. The optimizer needs a risk\nmodel and forecasts. Execution closes the loop by checking the cost assumptions\nthat every earlier step relied on.\n\nGate for each build, all in `scripts\/`:\n\n| Build | Gate function | What it checks |\n|---|---|---|\n| 01 | `pit.gate_data_store` | two clocks on every fact, no overwrites, restatements leave old snapshots unchanged, stored digests match, delisted names kept |\n| 02 | `backtest.gate_backtester` | two runs identical; scrambling the future leaves the past unchanged; costs charged; oversized orders partly filled |\n| 03 | `risk_model.gate_risk_model` | out-of-sample bias statistic near 1 across test portfolios |\n| 04 | `signals.gate_signal` | positive out-of-sample IC, positive edge after costs, deflated Sharpe for the number of variants tried |\n| 05 | `optimizer.gate_optimizer` | predicted volatility and turnover inside limits; no trade when the forecast does not pay its cost |\n| 06 | `execution.gate_execution` | log replays to the live book; oversized order rejected; kill switch works; paper cost within tolerance of the backtest |\n| Ops | `operations.gate_operations` | book matches broker; planted break caught; attribution sums to the day's return |\n\n`python scripts\/run_gates.py`, run from this skill's folder, executes all of them\non a synthetic market in about 20 seconds. It needs numpy, pandas and cvxpy. Use it to see how each gate is called,\nthen copy the modules into the project and point the gates at real data. The demo\npassing proves the reference code works, nothing about the user's fund.\n\n## Contracts between the layers\n\nEach arrow on the map is a contract. Most broken funds broke one of these.\n\n| Contract | Rule | What breaks without it |\n|---|---|---|\n| As-of data | research and production read only through as-of queries | backtests trade on numbers nobody had yet |\n| Same code as live | a feature is one function of an as-of snapshot, used by both | live behavior drifts from what was tested |\n| One forecast | signals are return forecasts over one fixed horizon, blended into one number per asset | the optimizer cannot weigh forecast against cost |\n| One risk model | optimizer, risk checks and attribution share the same `B`, `F`, `D` | three risk numbers for one book |\n| Pre-trade limits | every order passes independent risk checks | one bad forecast or price becomes a large position |\n| Append only | every order and fill goes to a replayable event log | no audit trail, no recovery, no honest attribution |\n| Results pick ideas | attribution re-ranks the idea queue | research follows taste instead of evidence |\n\n## One trade, start to finish\n\n| | Step | What happens |\n|---|---|---|\n| Trade date | 1 Decide | optimizer sets the target, the OMS builds the orders |\n| | 2 Check | risk and compliance approve each order |\n| | 3 Execute | algos work it into fills |\n| | 4 Allocate | fills split by fund, confirmed with the broker |\n| | 5 Clear | a clearinghouse nets and guarantees the trades |\n| Settlement | 6 Settle | cash and securities change hands |\n| | 7 Reconcile | books matched to broker and administrator |\n\nSteps 1 to 3 are the system you build; 4 to 7 are where it meets counterparties,\nand where money is lost quietly. Details and settlement cycles in\n`references\/operations.md`.\n\n## The three equations that run it\n\n**Optimizer**\n\n```\nw* = argmax_w   mu'w  -  (lambda\/2) w' Sigma w  -  kappa' |w - w0|\n```\n\n`mu` is the blended forecast, `Sigma` the risk model, `lambda` the risk appetite,\n`kappa` the cost per unit traded, `w0` the current book. A trade happens only\nwhen its forecast pays for its cost. Keep all three terms in the same units over\nthe same horizon, or the book either never trades or never stops.\n\n**Risk model**\n\n```\nSigma = B F B' + D\n```\n\nExposures `B`, factor covariance `F`, stock-specific risk `D`. For 3,000 stocks\nand 60 factors that is 184,830 numbers to estimate instead of 4,501,500. Use it\nin factor form; never build the dense matrix in production.\n\n**Position scale**\n\n```\nk = sigma_target \/ sigma_predicted\n```\n\nScale the whole book to a risk target. Aim for 10% volatility with a forecast of\n8% and every position grows by k = 1.25. Cap `k`, and check that position and\nturnover limits still hold after scaling.\n\n## What goes wrong\n\n| Symptom | Usual cause | Fix |\n|---|---|---|\n| Backtest Sharpe above 3 on daily equity data | look-ahead, survivorship or missing costs | run gates 01 and 02 before believing anything |\n| Great in research, flat live | research and live features are two implementations | one feature function, parity test in CI |\n| Dozens of signals, none holds up | many variants tried, the best one reported | log every trial, apply the deflated Sharpe |\n| Optimizer piles into a few names | noisy covariance matrix or forecasts in the wrong units | factor model, forecasts as `IC x vol x score`, position limits |\n| Book churns every day | cost term missing, quadratic, or on a different horizon from the forecast | L1 cost in the objective, matched horizons |\n| Live costs far above backtest | cost model never calibrated on real fills | Build 06 gate, then recalibrate |\n| P&L nobody can explain | no attribution, or a different risk model in each place | one risk model, daily attribution |\n| Months of infrastructure, no trades | building the \"at scale\" column first | thin loop first, deepen the layer that measurements say is weakest |\n\n## References\n\n| Read | When |\n|---|---|\n| `references\/data.md` | point-in-time schema, `known_at` per data type, universe, corporate actions, DuckDB queries |\n| `references\/research.md` | idea queue, feature pipeline, backtester design, validation protocol, signal library |\n| `references\/production.md` | signal blend, risk model estimation, optimizer details, risk checks, execution |\n| `references\/operations.md` | trade lifecycle, event log, reconciliation, attribution, fund administrator, daily schedule |\n\n## Scope\n\nThis is an engineering blueprint. Trade on paper until every gate passes on real\ndata. Running money for others also needs a legal structure, registration, an\nadministrator, an auditor, a prime broker and a compliance program; those need\nqualified professionals in the fund's jurisdiction. Nothing here is investment\nadvice or a promise that a strategy is profitable.\n","use_cases":["Building a hedge fund or trading system from scratch","Deciding what to build next in a trading stack","Reviewing or extending an existing hedge fund platform","Validating whether a backtester, risk model, or optimizer is sufficient","Mapping the trade lifecycle from decision to settlement","Understanding how the components of a fund fit together"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/Ricko12vPL\/claude-code-skills\/blob\/4bc1ba2d54dcd4ac48cef1689efd4ccb48de9c75\/skills\/hedge-fund-blueprint\/SKILL.md","source_commit":"4bc1ba2d54dcd4ac48cef1689efd4ccb48de9c75","license":null,"version":null,"listing_approved_at":"2026-11-29","created_at":"2026-11-28T18:52:25.000000Z","updated_at":"2026-11-29T10:53:39.000000Z","seo_title":"Hedge Fund Blueprint - Systematic Trading Architecture","seo_description":"A structured approach to building, planning, and extending a systematic hedge fund or trading operation, including data storage, backtesting, risk modeling, and execution","seo_keywords":["hedge fund architecture","quantitative trading system","systematic trading","risk model","portfolio optimization","backtesting framework","execution system","trading platform design"]}}