Files
vault-dash/app/core/pricing/__init__.py
Bu5hm4nn 874b4a5a02 Fix linting issues: line length, import sorting, unused variables
- Set ruff/black line length to 120
- Reformatted code with black
- Fixed import ordering with ruff
- Disabled lint for UI component files with long CSS strings
- Updated pyproject.toml with proper tool configuration
2026-03-22 10:30:12 +01:00

63 lines
1.7 KiB
Python

"""Core options pricing utilities for the Vault dashboard.
This package provides pricing helpers for:
- European Black-Scholes valuation
- American option pricing via binomial trees when QuantLib is installed
- Implied volatility inversion when QuantLib is installed
Research defaults are based on the Vault hedging paper:
- Gold price: 4,600 USD/oz
- GLD price: 460 USD/share
- Risk-free rate: 4.5%
- Volatility: 16% annualized
- GLD dividend yield: 0%
"""
from .black_scholes import (
DEFAULT_GLD_PRICE,
DEFAULT_GOLD_PRICE_PER_OUNCE,
DEFAULT_RISK_FREE_RATE,
DEFAULT_VOLATILITY,
BlackScholesInputs,
HedgingCost,
PricingResult,
annual_hedging_cost,
black_scholes_price_and_greeks,
margin_call_threshold_price,
)
__all__ = [
"DEFAULT_GLD_PRICE",
"DEFAULT_GOLD_PRICE_PER_OUNCE",
"DEFAULT_RISK_FREE_RATE",
"DEFAULT_VOLATILITY",
"BlackScholesInputs",
"HedgingCost",
"PricingResult",
"annual_hedging_cost",
"black_scholes_price_and_greeks",
"margin_call_threshold_price",
]
try: # pragma: no cover - optional QuantLib modules
from .american_pricing import (
AmericanOptionInputs,
AmericanPricingResult,
american_option_price_and_greeks,
)
from .volatility import implied_volatility
except ImportError: # pragma: no cover - optional dependency
AmericanOptionInputs = None
AmericanPricingResult = None
american_option_price_and_greeks = None
implied_volatility = None
else:
__all__.extend(
[
"AmericanOptionInputs",
"AmericanPricingResult",
"american_option_price_and_greeks",
"implied_volatility",
]
)