Amaranth Advisors collapse

# Amaranth Advisors collapse (2006-09-18)

**Summary:** Brian Hunter's natural gas trade — long winter / short shoulder — moves against him; Amaranth loses $6.6bn in a week (out of $9.2bn AUM), the largest single-fund loss to that date.

**Actors:** Brian Hunter, Nick Maounis

**Mechanism:** Concentrated long winter / short shoulder spread positions in NYMEX natty gas. Position size dwarfed the open interest in those contracts; when prices moved, Amaranth could not exit without crashing the curve.

**Magnitude:** $6.6bn loss

**Lessons:**
  • Position size relative to market depth is a hard constraint.
  • Concentrated commodity bets can blow up faster than equities ever could.


August 2007 Quant Quake

# August 2007 Quant Quake (2007-08-08)

**Summary:** Aug 6-10, 2007. Cross-firm deleveraging in equity statistical-arbitrage portfolios produces -10 sigma single-day moves in factor returns. Goldman's GEO and several others draw down 20-30% in days; many recover by month-end.

**Actors:** Goldman Sachs Global Equity Opportunities, Renaissance, AQR, DE Shaw, Highbridge

**Mechanism:** A fund caught in subprime had to liquidate; that liquidation pressured stat-arb factors; factor moves triggered VaR limits at other stat-arb funds; their selling propagated. The first cross-firm 'crowding cascade'.

**Lessons:**
  • Strategies that are uncorrelated to markets can be highly correlated to each other.
  • VaR-based risk limits are procyclical: they amplify deleveraging.
  • Khandani-Lo (2007) seminal paper on the event.


Lehman Brothers bankruptcy

# Lehman Brothers bankruptcy (2008-09-15)

**Summary:** Lehman files Ch.11 on Sep 15, 2008. Lehman Brothers International (Europe) — the prime broker for hundreds of hedge funds — falls into UK administration. Funds with assets at LBIE find them frozen for years under UK 'Rule 7' insolvency.

**Actors:** Lehman Brothers, PwC (UK administrator), hundreds of hedge funds

**Mechanism:** LBIE used unrestricted client asset rehypothecation under UK rules. When LBIE failed, rehypothecated assets were treated as part of the estate, not segregated client property. ~$70bn+ of hedge fund assets frozen.

**Magnitude:** $70bn+ frozen at LBIE

**Lessons:**
  • Single-PB risk is unacceptable.
  • Custody and rehypothecation rules vary materially by jurisdiction.
  • Multi-PB structure became universal post-2008.


Madoff Ponzi revealed

# Madoff Ponzi revealed (2008-12-11)

**Summary:** Bernard L. Madoff Investment Securities, ostensibly a $65bn 'split-strike conversion' fund, is exposed as a Ponzi scheme spanning at least 17 years. ~$17.5bn principal lost; $50bn paper losses.

**Actors:** Bernie Madoff

**Mechanism:** No actual trading; fabricated returns of ~10% with near-zero volatility for years. Self-administered (no independent admin); audited by a 3-person firm. Markopolos warnings ignored by SEC for years.

**Magnitude:** $65bn paper / $17.5bn principal

**Lessons:**
  • Independent fund administrator is non-negotiable.
  • Audit by a Big-4 (or recognized) firm is a baseline.
  • Returns too smooth to be real probably aren't.
  • Operational due diligence matters as much as investment due diligence.


Flash Crash

# Flash Crash (2010-05-06)

**Summary:** S&P 500 drops ~9% in 36 minutes and recovers most of it. Triggered by a single large E-mini sell program (Waddell & Reed) interacting with HFT liquidity withdrawal.

**Actors:** Waddell & Reed, HFT market makers, Navinder Sarao (later prosecuted for spoofing role)

**Mechanism:** VWAP-targeted sell algo aggressed liquidity faster than HFTs replenished; some HFTs withdrew (stub quotes); cascading hot-potato selling.

**Lessons:**
  • Algorithmic execution and HFT liquidity create new failure modes.
  • Limit-up/limit-down (LULD) circuit breakers introduced post-flash crash.


Knight Capital algorithm meltdown

# Knight Capital algorithm meltdown (2012-08-01)

**Summary:** A botched software deployment at Knight Capital Group causes a runaway algo to send millions of orders in 45 minutes, generating $440m in losses and effectively ending Knight as a standalone firm.

**Actors:** Knight Capital Group

**Mechanism:** Old test code (PowerPeg) inadvertently activated in production by a partial deployment. No effective kill switch.

**Magnitude:** $440m loss

**Lessons:**
  • Operational risk in algorithmic trading can wipe out a firm in minutes.
  • Pre-trade risk controls and kill switches are mandatory (SEC Rule 15c3-5).


SAC Capital insider trading settlement

# SAC Capital insider trading settlement (2013-11-04)

**Summary:** SAC Capital Advisors agrees to plead guilty to insider trading and pay $1.8bn in fines. The firm converts to family office (Point72) in 2014. Founder Steve Cohen later returns to managing outside capital in 2018.

**Actors:** Steve Cohen, DOJ (Preet Bharara), SEC

**Mechanism:** Multiple SAC PMs (Mathew Martoma, Michael Steinberg) convicted of trading on MNPI obtained from expert networks and corporate insiders.

**Magnitude:** $1.8bn fines

**Lessons:**
  • Pod platform model concentrates compliance risk at the platform level.
  • Expert network protocols significantly tightened post-SAC.
  • Newman/Salman/Blaszczak shaped tipper-tippee liability standards.


# Swiss National Bank removes EUR/CHF floor (2015-01-15)

**Summary:** SNB unexpectedly drops the 1.20 EUR/CHF floor it had defended since 2011. CHF jumps 30% in minutes. Multiple FX brokers (Alpari UK, FXCM) suffer near-fatal losses; Everest Capital's Global fund liquidates.

**Actors:** Swiss National Bank, FX brokers, Everest Capital

**Magnitude:** Multiple FX broker failures; $830m Everest Capital Global wind-down

**Lessons:**
  • Central bank guidance is not a guarantee.
  • Liquidity in 'managed' currencies can vanish instantly when policy shifts.


China devaluation flash crash

# China devaluation flash crash (2015-08-24)

**Summary:** The PBOC's Aug 11 devaluation triggers a 24-day global selloff culminating in 'Black Monday' Aug 24: -8.5% Shanghai Composite, -5.4% intraday on the SPX with extreme open dislocations on US ETFs.

**Actors:** PBOC

**Mechanism:** Surprise devaluation triggered EM and risk-asset selloff. ETF arbitrageurs widened spreads to 30-40% intraday on the open as APs paused.

**Lessons:**
  • EM macro shocks transmit to DM equities via cross-asset risk parity and CTA selling.
  • ETF microstructure breaks at open under stress.


Brexit referendum

# Brexit referendum (2016-06-23)

**Summary:** UK votes 52-48 to leave the EU. GBP crashes 8% overnight. Macro funds positioned long GBP/short Euro stocks (the consensus 'Remain' bet) take large losses.

**Actors:** UK electorate, global macro funds

**Lessons:**
  • Political-event probability pricing by markets had been wrong for 18 months.
  • Tail-risk hedging via OTM puts proved its value for the few who maintained it.


Volmageddon (XIV blowup)

# Volmageddon (XIV blowup) (2018-02-05)

**Summary:** VIX spikes from ~17 to 38 intraday; XIV (Credit Suisse short-VIX ETN) loses 96% in a day, triggering acceleration. ~$3bn of short-vol ETPs unwound; Credit Suisse retires XIV.

**Actors:** Credit Suisse, ProShares, XIV holders

**Mechanism:** Short-vol ETPs were end-of-day rebalancing — a vol spike forces buying VIX futures, which lifts the futures further, which forces more buying. Procyclical feedback.

**Magnitude:** $3bn+ short-vol ETP unwinds

**Lessons:**
  • Procyclical leveraged ETPs in vol products are uniquely fragile.
  • Short-vol carry strategies need explicit drawdown rules.


March 2020 'Dash for Cash'

# March 2020 'Dash for Cash' (2020-03-12)

**Summary:** COVID lockdown announcements trigger universal cross-asset selling. Treasuries — supposedly the safe haven — sell off as relative-value funds unwind basis trades. The Fed launches unlimited QE on Mar 23 to restore Treasury liquidity.

**Actors:** Federal Reserve, Treasury rates RV funds (Citadel, Millennium, ExodusPoint), global investors

**Mechanism:** Margin calls forced unwinds of leveraged Treasury basis trades; demand for cash collateral overwhelmed Treasury market liquidity; Fed had to backstop functioning of the most liquid market on earth.

**Magnitude:** $2.3tn+ Fed asset purchases

**Lessons:**
  • Even Treasuries can become illiquid in a true crisis.
  • Leveraged basis trades create systemic vulnerabilities flagged ever since.
  • SEC pursuing UST cash and repo central clearing in part because of this episode.


# Wirecard collapse — short squeeze validated (2020-06-18)

**Summary:** German payments processor Wirecard admits €1.9bn cash 'missing'. Short sellers (Fahmi Quadir, Muddy Waters, FT's Dan McCrum) vindicated after years of accusations. BaFin had banned shorts and investigated journalists rather than the company.

**Actors:** Wirecard, Fahmi Quadir (Safkhet), Muddy Waters, FT

**Lessons:**
  • Activist short sellers can identify fraud regulators miss.
  • Banning short selling protects bad actors, not investors.
  • BaFin restructured post-Wirecard.


GameStop short squeeze

# GameStop short squeeze (2021-01-28)

**Summary:** Retail-driven squeeze on GME (and AMC, BBBY, others) sends GME from $20 to $483. Melvin Capital loses ~$7bn (53% of fund) and ultimately closes in 2022. Citadel and Point72 inject $2.75bn into Melvin to stabilize; Robinhood restricts buying triggering Congressional hearings.

**Actors:** WSB / r/wallstreetbets, Melvin Capital, Citadel, Robinhood, Point72

**Mechanism:** Coordinated retail buying + heavy GME short interest (~140% of float) triggered short covering and gamma squeeze (dealer hedging of OTM call buying).

**Lessons:**
  • Crowded shorts in low-float names are a recurring vulnerability.
  • Retail aggregation via social platforms is a new and persistent market force.
  • Position-level transparency (13F lag) is a vulnerability for short positioning.


Archegos Capital Management collapse

# Archegos Capital Management collapse (2021-03-26)

**Summary:** Bill Hwang's family office Archegos defaults on margin calls. Forced unwinds of total return swap positions in ViacomCBS, Discovery, GSX, and others cause ~$30bn in dealer block trades. Credit Suisse loses $5.5bn, Nomura $2.9bn, Morgan Stanley $1bn.

**Actors:** Bill Hwang, Credit Suisse, Nomura, Goldman, Morgan Stanley, UBS

**Mechanism:** Highly concentrated long positions held via TRS at multiple PBs (each unaware of total exposure). Effective leverage ~5x. Position drawdowns triggered margin calls; Hwang refused to meet; PBs unwound.

**Magnitude:** $10bn+ dealer losses; ~$160bn notional unwound

**Lessons:**
  • Total return swaps escape 13D disclosure — the SEC has since proposed Rule 10B-1 to require beneficial ownership disclosure of large swaps.
  • Family offices are not exempt from systemic risk.
  • Credit Suisse's prime brokerage failed risk management — contributed to CS's eventual demise.
  • Hwang was convicted on multiple counts in 2024.


# Russia invades Ukraine — commodity supershock (2022-02-24)

**Summary:** Russian invasion of Ukraine triggers commodity supershock. Brent +35%, EU gas +400%, wheat +40%. LME nickel short squeeze (Mar 7-8) forces LME to cancel trades. CTAs and macro funds capture historic gains.

**Actors:** Russia, Ukraine, LME, Tsingshan (nickel short), JPMorgan (Tsingshan PB)

**Magnitude:** Multi-billion CTA gains; LME's reputational damage from canceling nickel trades

**Lessons:**
  • Commodity tail risk had been underpriced through 15 years of QE-suppressed vol.
  • Trend-following CTAs delivered crisis alpha (+27% SG Trend Index 2022).
  • Exchange intervention to cancel trades creates legal precedent and damages confidence.


# Deepest US yield curve inversion in 40 years (2022-07-05)

**Summary:** 2s10s inverts and reaches -108bp by mid-2023 — deepest since 1981. Recession does not arrive on cue. Macro funds positioned for recession underperform; soft landing playbook wins out 2023-2024.

**Actors:** Federal Reserve, global macro funds

**Lessons:**
  • Inversion has a ~12-24 month lead time but not an automatic recession trigger.
  • Fiscal dominance and post-pandemic balance sheet dynamics broke historical patterns.


UK gilt / LDI crisis

# UK gilt / LDI crisis (2022-09-28)

**Summary:** Truss-Kwarteng mini-budget triggers gilt selloff that nearly destroys UK pension LDI strategies. BoE intervenes with bond buying to break the doom loop. Margin calls on LDI swaps forced gilt sales which deepened the selloff.

**Actors:** UK Truss government, BoE, UK DB pension schemes, LDI managers (BlackRock, Insight, LGIM, Schroders)

**Magnitude:** £1trn+ LDI assets at risk; BoE £65bn purchase facility

**Lessons:**
  • Levered duration overlays in pensions create systemic transmission paths.
  • Procyclical margining can destabilize the asset central bankers thought safest.
  • Liability-driven investing requires liquidity planning that LDI managers had inadequately stress-tested.


FTX collapse

# FTX collapse (2022-11-11)

**Summary:** Crypto exchange FTX files Chapter 11. ~$8bn customer fund shortfall; Sam Bankman-Fried convicted on 7 counts in 2023, sentenced to 25 years. Multiple crypto hedge funds (Three Arrows, Voyager, Genesis Trading) directly or indirectly destroyed.

**Actors:** Sam Bankman-Fried, Alameda Research, FTX customers

**Mechanism:** Alameda misappropriation of FTX customer funds; CoinDesk reporting on Alameda balance sheet triggered Binance withdrawal threat → bank run → insolvency.

**Magnitude:** $8bn customer shortfall

**Lessons:**
  • Exchange counterparty risk in crypto is a first-order concern; segregated custody is non-negotiable.
  • Self-custody and proof-of-reserves became baseline asks post-FTX.
  • Adjacent failures: Three Arrows ($10bn), Voyager, Celsius, BlockFi, Genesis.


Three Arrows Capital liquidation

# Three Arrows Capital liquidation (2022-06-29)

**Summary:** Singapore-based 3AC enters liquidation after ~$10bn in losses tied to Luna/UST collapse, GBTC discount, and high leverage. Su Zhu and Kyle Davies disappear; subsequent contempt orders ensue.

**Actors:** Three Arrows Capital, Su Zhu, Kyle Davies, Voyager, Genesis, BlockFi

**Magnitude:** $10bn+

**Lessons:**
  • Crypto credit was uncollateralized and undisclosed — counterparties assumed others had checked.
  • Reputational lending without verifiable financials was a feature of late-cycle crypto credit.


Silicon Valley Bank failure

# Silicon Valley Bank failure (2023-03-10)

**Summary:** SVB closed by California regulators after a $42bn deposit run in 24 hours. Held to maturity Treasuries had ~$15bn in unrealized losses. Depositors made whole via systemic risk exception. Signature, First Republic follow.

**Actors:** SVB, FDIC, Federal Reserve, Treasury

**Mechanism:** Duration mismatch (long duration HTM) + concentrated tech depositor base + viral social-media-driven run.

**Magnitude:** $209bn SVB assets; ~$25bn FDIC fund cost across 2023 bank failures

**Lessons:**
  • AOCI on AFS securities was not in regulatory capital — masked losses.
  • Interest rate risk had been underweighted in bank stress testing.
  • Concentrated depositor bases and digital banking enable run velocities never seen before.
  • Hedge funds shorting regional banks materially benefited; some notable wins.


UBS forced to acquire Credit Suisse

# UBS forced to acquire Credit Suisse (2023-03-19)

**Summary:** Following Archegos, Greensill, and a deposit run, Credit Suisse is acquired by UBS in a Swiss government-orchestrated deal. AT1 bondholders wiped out (writedown ahead of equity), creating a notable AT1 market dislocation that hedge fund credit funds traded around.

**Actors:** Credit Suisse, UBS, Swiss FINMA, SNB, Swiss government

**Magnitude:** $17bn AT1 wipeout; CHF 9bn UBS purchase price

**Lessons:**
  • AT1 instruments behaved per their contracts — but global AT1 issuance briefly froze.
  • Bank failures can cascade across continents in days.
  • Prime brokerage market further consolidated; Goldman, Morgan Stanley, and JPM gained share.


August 2024 Yen carry unwind

# August 2024 Yen carry unwind (2024-08-05)

**Summary:** BoJ rate hike + weak US payrolls triggers violent yen carry unwind. Nikkei -12.4% (worst day since 1987). VIX spikes from 16 to 65 intraday. Multi-strat pods take outsize losses on cross-asset deleveraging.

**Actors:** Bank of Japan, yen carry traders, multi-strat platforms

**Lessons:**
  • Cross-asset crowding creates global transmission of single-country rate decisions.
  • Pod platform positions converged enough that several pods drew down 5-8% in a day.


# Fifth Circuit vacates SEC Private Fund Adviser Rules (2024-06-05)

**Summary:** US Fifth Circuit Court of Appeals vacates the SEC's August 2023 Private Fund Adviser Rules in entirety, ruling the SEC exceeded statutory authority. The decision unwinds quarterly statements, side-letter MFN restrictions, and fee/expense disclosure mandates that the industry had been preparing for.

**Actors:** SEC, MFA, AIMA, NVCA, MFA, plaintiffs, 5th Circuit

**Lessons:**
  • SEC regulatory expansion via the Advisers Act faces meaningful judicial limits post-Loper Bright.
  • Industry resources spent on compliance preparation were partly stranded.


# SEC US Treasury Clearing Mandate effective dates (2025-12-31)

**Summary:** Mandate phases in: cash UST clearing by Dec 31, 2025; UST repo clearing by Jun 30, 2026 (subsequently extended). Materially changes the economics of the Treasury basis trade by adding clearing margin on the repo leg.

**Actors:** SEC, FICC (DTCC), hedge funds running UST basis

**Lessons:**
  • Regulatory changes can compress strategy capacity by 20-40%.
  • The basis trade may bifurcate between bank-balance-sheet and hedge-fund-balance-sheet players.


# Renaissance Medallion turns 35 with 39% net annualized (2024-12-31)

**Summary:** Renaissance's Medallion Fund (closed to outside investors since 1993) reportedly compounds at ~39% net annualized over 35 years — the longest sustained outperformance in hedge fund history. Outside-investor funds (RIDA, RIEF, RIDGE) have lagged dramatically.

**Actors:** Renaissance Technologies, Jim Simons (1938-2024)

**Lessons:**
  • Capacity is the binding constraint on the highest-Sharpe strategies.
  • Edge identified, sized correctly, and never shared has produced the only true compounding machine in the industry.


Tiger Asia insider trading guilty plea

# Tiger Asia insider trading guilty plea (2012-12-12)

**Summary:** Bill Hwang's Tiger Asia pleads guilty to insider trading in Chinese bank stocks; pays $44m. Closes the fund and converts to family office Archegos — setting up the 2021 collapse.

**Actors:** Bill Hwang, Tiger Asia, DOJ

**Lessons:**
  • The SAC enforcement era saw multiple Tiger-lineage funds caught up in MNPI cases.
  • Conversion to family office was a regulatory escape hatch — Archegos showed why that escape had downsides.


Clearwire merger arb retrade

# Clearwire merger arb retrade (2013-06-25)

**Summary:** Sprint's bid for Clearwire faces a competing Dish offer. Sprint raises bid from $2.97 → $5.00. Merger arbs caught short-Sprint / long-Clearwire suffer the worst topping bid in years.

**Actors:** Sprint, Dish Network, Clearwire, merger arb funds

**Lessons:**
  • Hostile interloper risk is asymmetric — bumps cost shorts, breaks cost longs.


Accounting & Valuation

# Accounting & Valuation (Category)

How fund assets, liabilities, and performance are measured. NAV calculation, fair value hierarchy, side-pocket accounting, and Level 1/2/3 marks.

**Key terms:** nav, high-water-mark, level-3-asset, fair-value, side-pocket, crystallisation, accrual-fee


Alternative Investments

# Alternative Investments (Category)

Asset classes outside long-only equity and bonds: private equity, real assets, infrastructure, art, litigation finance, and other illiquid plays.

**Key terms:** private-equity, j-curve, co-investment, illiquidity-premium


Behavioral Finance

# Behavioral Finance (Category)

Cognitive and emotional biases that drive market inefficiencies and create both opportunities and traps for hedge funds.

**Key terms:** herding, anchoring, loss-aversion, overconfidence-bias, narrative-fallacy


Commodities & Futures

# Commodities & Futures (Category)

Physical and financial commodity markets, futures curves, basis, roll yield, and the mechanics of CTA trading.

**Key terms:** contango, backwardation, roll-yield, basis, term-structure


Crypto & Digital Assets

# Crypto & Digital Assets (Category)

Hedge fund engagement with crypto: spot, perps, basis trades, market-making, MEV, validator yield, and tokenized funds.

**Key terms:** basis-trade, perpetual-futures, funding-rate, mev, tokenized-fund


Derivatives & Options

# Derivatives & Options (Category)

Forwards, futures, swaps, and the option Greeks. Pricing models, vol surface dynamics, and structured products.

**Key terms:** delta, gamma, vega, theta, rho, implied-volatility, skew, black-scholes


ESG & Sustainable Investing

# ESG & Sustainable Investing (Category)

Environmental, social, and governance overlays in hedge fund mandates: SFDR Article 8/9, climate VaR, transition risk.

**Key terms:** sfdr, climate-var, transition-risk, scope-3-emissions


Equities & Analysis

# Equities & Analysis (Category)

Single-name equity analysis: financial statements, valuation multiples, quality screens, primary research.

**Key terms:** ev-ebitda, free-cash-flow-yield, roic, primary-research, channel-checks


Fixed Income & Credit

# Fixed Income & Credit (Category)

Government, corporate, and structured credit markets. Yield curves, duration, OAS, default modeling, distressed debt.

**Key terms:** duration, convexity, oas, credit-default-swap, distressed-debt


Fund Operations & Structure

# Fund Operations & Structure (Category)

Legal entity setup, investor docs, prime broker relationships, fund admin, and the full ops stack.

**Key terms:** master-feeder, side-pocket, gate, lock-up, high-water-mark, prime-broker, administrator


Global Markets

# Global Markets (Category)

Cross-border markets, FX, EM debt and equity, sovereign analysis, and global rates.

**Key terms:** carry-trade, covered-interest-parity, em-debt, sovereign-cds


Hedge Fund Strategies

# Hedge Fund Strategies (Category)

The strategy taxonomy: equity hedge, event-driven, global macro, relative value, managed futures, multi-strategy.

**Key terms:** long-short-equity, merger-arbitrage, global-macro, convertible-arbitrage, multi-strategy-pod


Insurance & Reinsurance

# Insurance & Reinsurance (Category)

Reinsurance sidecars, ILS, cat bonds, and the convergence of hedge fund capital with re/insurance balance sheets.

**Key terms:** cat-bond, ils, sidecar, reinsurer-collateralized


Macroeconomics

# Macroeconomics (Category)

The macro backdrop: monetary policy, fiscal cycles, trade balances, and how regimes shift.

**Key terms:** yield-curve-inversion, monetary-policy, neutral-rate, fiscal-dominance


Market Microstructure

# Market Microstructure (Category)

How orders meet at the exchange: order book dynamics, latency, adverse selection, market making, dark pools.

**Key terms:** bid-ask-spread, adverse-selection, kyle-lambda, vpin, iceberg-order


Portfolio Construction

# Portfolio Construction (Category)

Translating signals into positions: optimization, risk budgeting, factor exposures, and capital allocation.

**Key terms:** mean-variance-optimization, risk-parity, kelly-criterion, factor-tilt


Quantitative Methods

# Quantitative Methods (Category)

Stats, ML, time series, and the engineering of systematic alpha.

**Key terms:** alpha, beta, sharpe-ratio, sortino-ratio, information-ratio, cointegration, kalman-filter


Regulatory & Compliance

# Regulatory & Compliance (Category)

Form ADV, AIFMD, MiFID II, Dodd-Frank, side letters, MNPI, expert networks, and the compliance lifecycle.

**Key terms:** form-adv, aifmd, mifid-ii, regulation-d, expert-network, mnpi


Risk Management

# Risk Management (Category)

VaR families, expected shortfall, stress testing, scenario analysis, drawdown control, and counterparty risk.

**Key terms:** value-at-risk, expected-shortfall, max-drawdown, stress-test, counterparty-risk


Trading & Execution

# Trading & Execution (Category)

Implementation shortfall, TCA, algo wheels, smart order routing, dark vs lit, and the execution alpha frontier.

**Key terms:** implementation-shortfall, vwap, twap, algo-wheel, tca, dark-pool


Sharpe Ratio

# Sharpe Ratio (Calculator)

**Summary:** Annualized Sharpe from a return series.

**Formula reference:** sharpe-ratio

**Inputs:** returns(array<number>); rf_periodic(number); periods_per_year(integer)

**Outputs:** sharpe(number); mean_excess(number); std(number)

**Reference impl (javascript):**
```
function sharpeRatio(returns, rfPeriodic = 0, periodsPerYear = 252) {
  const ex = returns.map(r => r - rfPeriodic);
  const mean = ex.reduce((a, b) => a + b, 0) / ex.length;
  const variance = ex.reduce((s, r) => s + (r - mean) ** 2, 0) / (ex.length - 1);
  const std = Math.sqrt(variance);
  const sharpe = (mean / std) * Math.sqrt(periodsPerYear);
  return { sharpe, mean_excess: mean, std };
}
```


Sortino Ratio

# Sortino Ratio (Calculator)

**Summary:** Sortino Ratio

**Formula reference:** sortino-ratio

**Inputs:** returns(array<number>); target(number); periods_per_year(integer)

**Outputs:** sortino(number)

**Reference impl (javascript):**
```
function sortinoRatio(returns, target = 0, periodsPerYear = 252) {
  const ex = returns.map(r => r - target);
  const mean = ex.reduce((a,b) => a + b, 0) / ex.length;
  const downside = ex.filter(r => r < 0);
  const dd = Math.sqrt(downside.reduce((s, r) => s + r * r, 0) / ex.length);
  return { sortino: (mean / dd) * Math.sqrt(periodsPerYear) };
}
```


Maximum Drawdown

# Maximum Drawdown (Calculator)

**Summary:** Maximum Drawdown

**Formula reference:** max-drawdown

**Inputs:** nav_series(array<number>)

**Outputs:** mdd(number); peak_index(integer); trough_index(integer); duration(integer)

**Reference impl (javascript):**
```
function maxDrawdown(nav) {
  let peak = nav[0], peakIdx = 0, mdd = 0, troughIdx = 0;
  for (let i = 1; i < nav.length; i++) {
    if (nav[i] > peak) { peak = nav[i]; peakIdx = i; }
    const dd = (nav[i] - peak) / peak;
    if (dd < mdd) { mdd = dd; troughIdx = i; }
  }
  return { mdd, peak_index: peakIdx, trough_index: troughIdx, duration: troughIdx - peakIdx };
}
```


Calmar Ratio

# Calmar Ratio (Calculator)

**Summary:** Calmar Ratio

**Formula reference:** calmar-ratio

**Inputs:** annualized_return(number); max_drawdown(number)

**Outputs:** calmar(number)

**Reference impl (javascript):**
```
function calmar(annRet, mdd) { return { calmar: annRet / Math.abs(mdd) }; }
```


Parametric VaR

# Parametric VaR (Calculator)

**Summary:** Parametric VaR

**Formula reference:** parametric-var

**Inputs:** portfolio_value(currency); sigma_periodic(number); horizon_periods(number); confidence(number)

**Outputs:** var_usd(currency)

**Reference impl (javascript):**
```
function inverseNormal(p) {
  // Beasley-Springer-Moro approximation
  const a = [-3.969683028665376e+01, 2.209460984245205e+02, -2.759285104469687e+02, 1.383577518672690e+02, -3.066479806614716e+01, 2.506628277459239e+00];
  const b = [-5.447609879822406e+01, 1.615858368580409e+02, -1.556989798598866e+02, 6.680131188771972e+01, -1.328068155288572e+01];
  const c = [-7.784894002430293e-03, -3.223964580411365e-01, -2.400758277161838e+00, -2.549732539343734e+00, 4.374664141464968e+00, 2.938163982698783e+00];
  const d = [7.784695709041462e-03, 3.224671290700398e-01, 2.445134137142996e+00, 3.754408661907416e+00];
  const pl = 0.02425, ph = 1 - pl;
  let q, r;
  if (p < pl) { q = Math.sqrt(-2*Math.log(p)); return (((((c[0]*q+c[1])*q+c[2])*q+c[3])*q+c[4])*q+c[5]) / ((((d[0]*q+d[1])*q+d[2])*q+d[3])*q+1); }
  if (p <= ph) { q = p - 0.5; r = q*q; return (((((a[0]*r+a[1])*r+a[2])*r+a[3])*r+a[4])*r+a[5])*q / (((((b[0]*r+b[1])*r+b[2])*r+b[3])*r+b[4])*r+1); }
  q = Math.sqrt(-2*Math.log(1-p));
  return -(((((c[0]*q+c[1])*q+c[2])*q+c[3])*q+c[4])*q+c[5]) / ((((d[0]*q+d[1])*q+d[2])*q+d[3])*q+1);
}
function parametricVaR(value, sigma, horizon = 1, conf = 0.99) {
  const z = inverseNormal(conf);
  const v = value * sigma * Math.sqrt(horizon) * z;
  return { var_usd: v };
}
```


Kelly Fraction

# Kelly Fraction (Calculator)

**Summary:** Kelly Fraction

**Formula reference:** kelly-criterion

**Inputs:** expected_return(number); risk_free(number); variance(number); fraction(number)

**Outputs:** leverage(number)

**Reference impl (javascript):**
```
function kelly(mu, rf, variance, fraction = 1) { return { leverage: fraction * (mu - rf) / variance }; }
```


Performance Fee with HWM and Hurdle

# Performance Fee with HWM and Hurdle (Calculator)

**Summary:** Computes performance fee given prior HWM, current NAV, hurdle, and rate.

**Formula reference:** sharpe-ratio

**Inputs:** starting_nav(number); ending_nav_pre_fee(number); high_water_mark(number); hurdle_rate(percent); performance_fee_rate(percent); hurdle_type(string)

**Outputs:** performance_fee_per_share(number); ending_nav_post_fee(number); new_high_water_mark(number)

**Reference impl (javascript):**
```
function performanceFee(start, endPre, hwm, hurdle = 0, rate = 0.2, type = 'hard') {
  const hurdleNav = Math.max(hwm, start) * (1 + hurdle);
  const above = endPre - hurdleNav;
  if (above <= 0) return { performance_fee_per_share: 0, ending_nav_post_fee: endPre, new_high_water_mark: Math.max(endPre, hwm) };
  let fee;
  if (type === 'soft') {
    const totalProfit = endPre - Math.max(hwm, start);
    fee = rate * totalProfit;
  } else {
    fee = rate * above;
  }
  const post = endPre - fee;
  return { performance_fee_per_share: fee, ending_nav_post_fee: post, new_high_water_mark: Math.max(post, hwm) };
}
```


Annualize Return

# Annualize Return (Calculator)

**Summary:** Annualize Return

**Formula reference:** sharpe-ratio

**Inputs:** total_return(number); years(number)

**Outputs:** annualized(number)

**Reference impl (javascript):**
```
function annualize(totalReturn, years) { return { annualized: Math.pow(1 + totalReturn, 1 / years) - 1 }; }
```


Annualize Volatility

# Annualize Volatility (Calculator)

**Summary:** Annualize Volatility

**Formula reference:** sharpe-ratio

**Inputs:** periodic_vol(number); periods_per_year(integer)

**Outputs:** annualized_vol(number)

**Reference impl (javascript):**
```
function annVol(v, n) { return { annualized_vol: v * Math.sqrt(n) }; }
```


Black-Scholes Call Price + Greeks

# Black-Scholes Call Price + Greeks (Calculator)

**Summary:** Black-Scholes Call Price + Greeks

**Formula reference:** black-scholes

**Inputs:** S(number); K(number); T(number); r(number); sigma(number); q(number)

**Outputs:** call(number); delta(number); gamma(number); vega(number); theta(number); rho(number)

**Reference impl (javascript):**
```
function normCdf(x){const a1=0.254829592,a2=-0.284496736,a3=1.421413741,a4=-1.453152027,a5=1.061405429,p=0.3275911;const sign=x<0?-1:1;x=Math.abs(x)/Math.SQRT2;const t=1/(1+p*x);const y=1-(((((a5*t+a4)*t)+a3)*t+a2)*t+a1)*t*Math.exp(-x*x);return 0.5*(1+sign*y);}
function normPdf(x){return Math.exp(-x*x/2)/Math.sqrt(2*Math.PI);}
function bsCall(S,K,T,r,sigma,q=0){
  const d1=(Math.log(S/K)+(r-q+sigma*sigma/2)*T)/(sigma*Math.sqrt(T));
  const d2=d1-sigma*Math.sqrt(T);
  const Nd1=normCdf(d1),Nd2=normCdf(d2),nd1=normPdf(d1);
  const call=S*Math.exp(-q*T)*Nd1-K*Math.exp(-r*T)*Nd2;
  return {
    call,
    delta: Math.exp(-q*T)*Nd1,
    gamma: Math.exp(-q*T)*nd1/(S*sigma*Math.sqrt(T)),
    vega: S*Math.exp(-q*T)*nd1*Math.sqrt(T),
    theta: -(S*Math.exp(-q*T)*nd1*sigma)/(2*Math.sqrt(T)) - r*K*Math.exp(-r*T)*Nd2 + q*S*Math.exp(-q*T)*Nd1,
    rho: K*T*Math.exp(-r*T)*Nd2
  };
}
```


Implied Volatility (Newton-Raphson)

# Implied Volatility (Newton-Raphson) (Calculator)

**Summary:** Implied Volatility (Newton-Raphson)

**Formula reference:** black-scholes

**Inputs:** market_price(number); S(number); K(number); T(number); r(number); q(number)

**Outputs:** implied_vol(number)

**Reference impl (javascript):**
```
// Requires bsCall from black-scholes-call-calc
function impliedVol(price, S, K, T, r, q = 0) {
  let sigma = 0.30;
  for (let i = 0; i < 100; i++) {
    const o = bsCall(S, K, T, r, sigma, q);
    const diff = o.call - price;
    if (Math.abs(diff) < 1e-8) return { implied_vol: sigma };
    sigma -= diff / o.vega;
    if (sigma <= 0) sigma = 0.001;
  }
  return { implied_vol: sigma };
}
```


Modified Duration

# Modified Duration (Calculator)

**Summary:** Modified Duration

**Formula reference:** duration-modified

**Inputs:** cash_flows(array<number>); times(array<number>); ytm(number); compounding(integer)

**Outputs:** macaulay(number); modified(number); price(number)

**Reference impl (javascript):**
```
function durations(cfs, times, ytm, m = 2) {
  let pv = 0, weighted = 0;
  for (let i = 0; i < cfs.length; i++) {
    const df = Math.pow(1 + ytm/m, -times[i]*m);
    pv += cfs[i] * df;
    weighted += times[i] * cfs[i] * df;
  }
  const mac = weighted / pv;
  const mod = mac / (1 + ytm/m);
  return { macaulay: mac, modified: mod, price: pv };
}
```


CDS Spread (Simplified)

# CDS Spread (Simplified) (Calculator)

**Summary:** CDS Spread (Simplified)

**Formula reference:** cds-pricing

**Inputs:** default_probability(number); recovery_rate(number)

**Outputs:** spread_bps(number)

**Reference impl (javascript):**
```
function cdsSpread(p, R = 0.40) { return { spread_bps: p * (1 - R) * 10000 }; }
```


Merger Arb Annualized Spread

# Merger Arb Annualized Spread (Calculator)

**Summary:** Annualizes the deal spread given the days remaining to close.

**Formula reference:** irr-newton

**Inputs:** deal_price(number); current_price(number); days_to_close(number)

**Outputs:** raw_spread_pct(number); annualized_spread_pct(number)

**Reference impl (javascript):**
```
function mergerSpread(deal, current, days) {
  const raw = deal / current - 1;
  const ann = raw * (365 / Math.max(days, 1));
  return { raw_spread_pct: raw, annualized_spread_pct: ann };
}
```


# Perpetual Futures Funding-Rate Carry P&L (Calculator)

**Summary:** Annualized P&L from a cash-and-carry trade in crypto perps.

**Formula reference:** irr-newton

**Inputs:** funding_rate_per_period(number); periods_per_day(integer)

**Outputs:** annualized(number)

**Reference impl (javascript):**
```
function perpFundingAnn(rate, perDay = 3) { return { annualized: rate * perDay * 365 }; }
```


IRR (Newton)

# IRR (Newton) (Calculator)

**Summary:** IRR (Newton)

**Formula reference:** irr-newton

**Inputs:** cash_flows(array<number>); guess(number)

**Outputs:** irr(number)

**Reference impl (javascript):**
```
function irr(cfs, guess = 0.10) {
  let r = guess;
  for (let i = 0; i < 100; i++) {
    let f = 0, fp = 0;
    for (let t = 0; t < cfs.length; t++) {
      f += cfs[t] / Math.pow(1 + r, t);
      fp -= t * cfs[t] / Math.pow(1 + r, t + 1);
    }
    const next = r - f / fp;
    if (Math.abs(next - r) < 1e-9) return { irr: next };
    r = next;
  }
  return { irr: r };
}
```