Files
nexus-quant-terminal/backend
Claude 1eecc06bc2 feat: Hedge Lab — Monte Carlo delta-hedging / gamma-scalping P&L
- core/hedge_sim.py: vectorised Garman-Kohlhagen, self-financing delta hedge
  of the whole portfolio (legs settle at their own expiries) with domestic
  financing, foreign/lease carry and proportional costs; time-based or
  delta-band rebalancing.
- Path models: GBM, Merton jump-diffusion at equal total variance, and a
  stationary block bootstrap of the asset's own daily returns (Brownian-bridge
  intraday steps); Monday-open weekend gaps for 24/5 assets.
- Benchmarks: theoretical edge V(sigma_r)-V(sigma_i), Derman-Kamal
  discrete-hedging error, Leland cost; hedge-frequency sweep (risk vs cost).
- POST /api/hedge/simulate with work caps; bootstrap reuses cached history.
- Hedge Lab tab: scenario controls, 'use Vol Forecast' for realised vol,
  KPIs, P&L histogram, frequency sweep, attribution, sample paths.
- 7 tests: GK parity, unbiased fair-vol hedge with Derman-Kamal sd, mean
  P&L vs theoretical edge, sqrt(N) sweep, band/Leland costs, gaps/jumps
  tails, endpoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FpiqUMAyo4RL5DdQHMWbwE
2026-10-03 05:25:36 +00:00
..