Expand description
Portfolio of options on a single underlying: aggregated Greeks and risk-based PnL attribution.
Positions are quantity-weighted (negative quantity = short). All Greeks are additive, so the book’s risk is the weighted sum of per-position Greeks — each computed by that position’s own pricing engine, so a book can mix analytic vanillas, FD Americans and MC barriers.
PnL attribution explains the book’s change in value over a market move
(d_spot, d_vol, d_rate, d_time) with a second-order Taylor expansion:
dV = delta dS + 1/2 gamma dS^2 (spot)
+ vega dv + 1/2 volga dv^2 (implied vol)
+ vanna dS dv (cross)
+ theta dt + rho dr (time, rate)
+ unexplainedThe actual PnL is a full reprice of every position under the shifted
market (EquityOption::price_with), so unexplained is a true
residual — third-order terms and any cross terms not in the expansion.
Structs§
- Equity
Portfolio - A book of option positions on the same underlying.
- Market
Move - A market move to attribute PnL over. All fields default to zero, so a
scenario can set only what moves, e.g.
MarketMove { d_spot: 2.0, d_time: 1.0 / 365.0, ..Default::default() }. - PnlAttribution
- Risk-based PnL explain for one market move.
- Portfolio
Greeks - Quantity-weighted sums of the per-position Greeks.
- Position
- A signed position in one option:
quantitycontracts (negative = short).