Skip to content

Add smileSection() to BlackVolTermStructure#2487

Open
quantales wants to merge 1 commit intolballabio:masterfrom
quantales:feature/blackvol-smilesection
Open

Add smileSection() to BlackVolTermStructure#2487
quantales wants to merge 1 commit intolballabio:masterfrom
quantales:feature/blackvol-smilesection

Conversation

@quantales
Copy link
Contributor

This PR proposes adding smileSection(Date/Time) to BlackVolTermStructure, making EQ/FX vol surfaces in line with the IR ones (OptionletVolatilityStructure, SwaptionVolatilityStructure).

  • Public non-virtual smileSection()
  • Protected virtual smileSectionImpl(Time) provides a default adapter that wraps blackVol() into a SmileSection
  • All existing derived classes would get a working smileSection() with no code changes

Unlike the IR vol structures where smileSectionImpl is pure virtual, the default adapter here means vol-native classes (BlackConstantVol, HestonBlackVolSurface, etc.) would work out of the box. Smile-native classes can override for efficiency: PiecewiseBlackVarianceSurface does so in this PR, returning its stored SmileSection directly at stored tenors. BlackVolatilitySurfaceDelta is another candidate: its existing blackVolSmile() methods are functionally equivalent to smileSection() and could be refactored to override smileSectionImpl() in a follow-up.

Motivation: From the discussions in #2443, #2478, and #2368, and increasing use of SmileSection for EQ/FX vol surfaces (PiecewiseBlackVarianceSurface and BlackVolatilitySurfaceDelta), the base class not returning them felt like a gap (there was no way to get a SmileSection from a PiecewiseBlackVarianceSurface and users needing one from any other BlackVolTermStructure would have to write their own adapter each time). Happy to adjust and would love to hear your thoughts on this.

Tests: default adapter (BlackConstantVol), override at stored tenor with pointer equality (PiecewiseBlackVarianceSurface), adapter fallback between tenors. Full suite passes.

@quantales quantales force-pushed the feature/blackvol-smilesection branch from ec3e810 to ea5987f Compare March 15, 2026 14:01
@coveralls
Copy link

coveralls commented Mar 15, 2026

Coverage Status

coverage: 74.351% (+0.002%) from 74.349%
when pulling 5886cf3 on quantales:feature/blackvol-smilesection
into 1c3d908 on lballabio:master.

@quantales quantales force-pushed the feature/blackvol-smilesection branch from ea5987f to 5886cf3 Compare March 15, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants