Start Here — Price, Then Differentiate

Every Input You Record Becomes a Sensitivity

Theta was never coded into the vanilla option payoff. It falls out of the same Java adjoint sweep as delta and vega because maturity is a named input.

Market data
SimulationOptional
Java source
UnaskedGreek.java

This exact source runs in TeaVM. Form changes update its Java literals and reset manual edits.

import com.nablatensor.engine.Nabla;
import com.nablatensor.quant.EquityMarket;
import com.nablatensor.quant.MonteCarlo;
import com.nablatensor.quant.Products;

public final class UnaskedGreek {
  private UnaskedGreek() {}

  public static void main(String[] args) {
    EquityMarket market = EquityMarket.of()
        .spot(100)
        .strike(100)
        .vol(20 / 100.0)
        .rate(3 / 100.0)
        .maturity(1)
        .build();
    long scenarios = 20000L;
    long seed = 42L;
    double oneDay = 1.0 / 365.0;
    try (MonteCarlo<EquityMarket> pricer = MonteCarlo.of(Products.europeanCall())
        .market(market)
        .steps(1)
        .fp64()
        .greeks()
        .on("cpu")
        .build()) {
      Nabla.TypedValuation<EquityMarket> value = pricer.run(scenarios, seed);
      double theta = -value.greek(EquityMarket::maturity);
      double thetaPerDay = theta / 365.0;
      EquityMarket shorter = market.withMaturity(Math.max(1.0e-6, market.maturity() - oneDay));
      double thetaBump = pricer.run(shorter, scenarios, seed)
          .price() - value.price();
      System.out.println("RESULT|" + value.price() + "|" + value.greek(EquityMarket::spot) + "|"
          + value.greek(EquityMarket::vol) + "|" + thetaPerDay + "|" + thetaBump);
      System.out.println("INPUTS|" + scenarios + "|" + seed + "|" + pricer.nodes());
    }
  }
}
TeaVM compiles and runs the Java source above in this browser.
Implementation guide

Named inputs make sensitivities available

A reverse sweep returns the derivative for every recorded input, including an economically useful factor that was not the original reporting target.

Core mechanism

The output adjoint reaches every connected active input. Naming those inputs converts a raw gradient vector into a risk report such as timing risk, cross-risk or a model-parameter sensitivity.

Practical workflow

Define a deliberate risk-factor schema at recording time, retain labels and units with the input vector, and surface only sensitivities that have a clear economic interpretation and validation route.

Scope and review point

An available derivative is not automatically a hedgeable Greek. Liquidity, calibration stability, factor definition and reporting materiality still matter.