Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Avhz RustQuant Analytic Option Pricing Engine

From Leeroopedia


Knowledge Sources
Domains Derivatives, Option_Pricing, Software_Architecture
Last Updated 2026-02-07 20:00 GMT

Overview

A generic pricing engine pattern that combines an option contract with a pricing model to compute option prices and sensitivities via closed-form analytic formulas.

Description

The Analytic Option Pricing Engine is a design pattern that decouples option specification from model selection. Rather than embedding pricing logic in the option struct or the model struct, a separate engine object binds the two together and delegates pricing calls.

This pattern enables:

  • Any option type to be priced with any compatible model
  • Clean separation of concerns (contract definition vs. pricing logic)
  • Easy model comparison by swapping the model parameter while keeping the option fixed

The engine holds references to both the option and the model, then dispatches calls like price(), delta(), and report() by extracting option parameters (strike, expiry, type flag) and forwarding them to the model's pricing methods.

Usage

Use this principle after defining both an option contract and a pricing model. The engine is the bridge that connects the two, enabling price and Greek computation.

Theoretical Basis

The analytic pricing engine applies the Strategy Pattern from software design:

Pseudo-code:

// Abstract algorithm (NOT real implementation)
engine = PricingEngine(option, model)
price = engine.price()  // delegates to model.price(option.strike, option.expiry, option.type)
delta = engine.delta()  // delegates to model.delta(option.strike, option.expiry, option.type)

The engine computes the time-to-expiry internally using the current date and the option's expiry date, converting to a year fraction. This encapsulates the time calculation so users do not need to manually compute it.

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment