Skip to content

Property specifications

Shoals includes finance properties that state relationships among its calculations. Some are evaluated at selected inputs; others are checked by a prover. A result applies only to its stated assumptions and method. Read the property's formula before applying it to a different model or input range.

Module: Shoals.Properties.Pricing.

  • put_call_parity_holds(s, k, r, sigma, t): the call minus the put equals s - k * exp(-r * t).
  • call_price_nonneg and put_price_nonneg: check non-negative prices.
  • call_bounded_by_spot(s, k, r, sigma, t): checks that the call price does not exceed spot at the supplied point.
  • matches_textbook_reference and matches_textbook_reference_put: the optimized scalars agree with the Shoals.References.BlackScholes oracles.
  • mc_matches_textbook_mc_reference(template, s0, k, r, sigma, t): under a shared seed the optimized Monte Carlo agrees with the scalar Monte Carlo reference to within five percent.

Module: Shoals.Properties.NoArbitrage.

  • bull_spread_nonneg(s, k_low, k_high, r, sigma, t): checks that a lower-strike call costs at least as much as a higher-strike call.
  • butterfly_nonneg(s, k, h, r, sigma, t): checks that c(k - h) - 2 c(k) + c(k + h) is non-negative within a small tolerance.

Module: Shoals.Properties.Greeks.

  • fd_delta_in_unit_range_for_call: the finite-difference call delta lies in [0, 1].
  • fd_delta_matches_analytic: the finite-difference call delta agrees with the analytic N(d1).
  • vega_nonneg: the finite-difference vega is non-negative.

Module: Shoals.Properties.MonteCarlo.

  • same_literal_seed_same_price(template, s, k, r, sigma, t): two Monte Carlo runs under the same literal seed return the identical price.
  • mc_within_5pct_of_analytic(template, s, k, r, sigma, t): the Monte Carlo price is within five percent of the closed form.

Module: Shoals.Properties.Curves.

  • parallel_shift_uniformly_lifts and parallel_shift_zero_is_identity: a parallel shift lifts the interpolated rate by exactly the shift, and a zero shift changes nothing.
  • twist_at_midpoint_is_average: a twist applies the average of the short and long shifts at the midpoint.
  • key_rate_shift_localized_at_unmoved_pillar: a key-rate shift does not move the rate at an untouched pillar.
  • scale_rates_linear: scaling multiplies the interpolated rate by the factor.

Module: Shoals.Properties.VolSurface.

  • vs_total_variance_nonneg_for_atm: the at-the-money total variance is non-negative.
  • vs_implied_vol_matches_sqrt_variance: the implied vol equals sqrt(max(w, 0) / t).
  • implied_vol_round_trip(spot, strike, r, t, sigma_true): pricing a call at a known volatility and inverting recovers that volatility.

Module: Shoals.Properties.Distributions.

  • lognormal_pdf_matches_textbook, lognormal_cdf_matches_textbook, student_t_pdf_matches_textbook, bvn_pdf_matches_textbook: each density or cumulative agrees with its Shoals.References.Distributions oracle.
  • lognormal_pdf_nonneg: the lognormal density is non-negative.
  • student_t_pdf_symmetric_at_zero: the Student-t density is symmetric.

Module: Shoals.Properties.Date.

Year fractions are exact rationals, so every date property is an equality, not a tolerance.

  • actual_matches_reference(start, end): ACT/360 and ACT/365 Fixed equal the reference day count over 360 and over 365.
  • isda_matches_reference(start, end): ACT/ACT ISDA equals the per-year reference sum.
  • icma_matches_reference(start, end, period_start, period_end, frequency): ACT/ACT ICMA equals the reference ratio.
  • whole_isda_year_is_exactly_one(year): a whole calendar year is exactly one ACT/ACT ISDA year, leap or not.
  • additive_under_isda(a, b, c): the ACT/ACT ISDA fraction over a..c is the exact sum of those over a..b and b..c.

These properties describe calendar and tenor relationships. They do not imply that make_bar validates market-data ordering; its input checks are described in Scope and limitations.

Module: Shoals.Properties.Tenor.

  • schedule_is_increasing_and_bounded(start, end, months): a short-final schedule of whole-month tenors starts at start, ends at end, and is strictly increasing, whatever the day of month.

Module: Shoals.Properties.MarketData.

  • quote_round_trip(side, value, d): a constructed quote reads back its value.
  • md_bar_high_gte_low, md_bar_close_in_high_low_range, md_bar_open_in_high_low_range: check a supplied bar's OHLC ordering. make_bar does not enforce that ordering.
  • snapshot_empty_has_no_quote(d, key): an empty snapshot returns no quote.

See Scope and limitations for a description of what these properties do and do not establish.