import logging
import numpy as np
from option_chain import validate_parameters, generate_option_chains_for_expiries

if __name__ == "__main__":
    # Parameters
    S = 22500  # Current stock price
    K_range = np.arange(22000, 23000, 50).tolist()  # Range of strike prices
    expiries = [1.0 / 365]  # List of expiry periods in years
    r = 0.01  # Risk-free interest rate
    base_sigma = 0.2  # Base volatility
    smile_params = {"a": 0.05}  # Parameters for the volatility smile
    noise_level = 0.02  # Noise level for simulating real-time prices
    generate_greeks = True  # Whether to generate Greeks or not

    # Seed for reproducibility
    np.random.seed(42)

    # Validate parameters
    validate_parameters(S, K_range, expiries, r, base_sigma, smile_params, noise_level)

    # Generate the option chains for multiple expiries
    option_chains = generate_option_chains_for_expiries(
        S, K_range, expiries, r, base_sigma, smile_params, noise_level, generate_greeks
    )

    # Display the option chains
    for expiry, chain in option_chains.items():
        logging.info(f"\nOption Chain for {expiry}:\n{chain}\n")
