feat: option lab

This commit is contained in:
OpenSquared
2026-07-28 11:14:31 +02:00
parent 568414ca0c
commit d2c393b8e5
11 changed files with 757 additions and 29 deletions

View File

@@ -248,3 +248,19 @@ def saxo_iv_snapshot(symbol: str):
def saxo_iv_history(symbol: str, days: int = Query(90, ge=1, le=730)):
from services.saxo_iv_engine import get_saxo_iv_history
return get_saxo_iv_history(symbol, days)
@router.get("/pricing-check")
def saxo_pricing_check(
ticker: str = Query(...),
date_a: str = Query(..., description="YYYY-MM-DD"),
date_b: str = Query(..., description="YYYY-MM-DD"),
target_dte: Optional[int] = Query(None, ge=1, le=365, description="Overrides the default (expiry closest to date_b)"),
):
"""Options Lab — was this option well priced between two dates? Picks the strike closest
to the underlying's actual outcome at date_b (hindsight), and by default the expiry
closest to date_b too (same hindsight principle, overridable via target_dte), reprices
it at both dates from real Saxo history, and decomposes the price move into
Delta/Theta/Vega contributions — see services.pricing_check.analyze_option_pricing."""
from services.pricing_check import analyze_option_pricing
return analyze_option_pricing(ticker, date_a, date_b, target_dte)