/**
 * greeks.ts — Option pricing and Greeks using Black-Scholes and binomial tree models.
 * Implements European option pricing (Black-Scholes closed-form) and
 * American option pricing (Cox-Ross-Rubinstein binomial tree with early exercise).
 * Also includes implied volatility solver via Newton-Raphson.
 * Pure functions, zero external dependencies.
 */
/** Option type: call or put */
export type OptionType = 'call' | 'put';
/** Parameters for Black-Scholes pricing */
export interface BSParams {
    /** Current price of the underlying asset */
    spot: number;
    /** Strike price of the option */
    strike: number;
    /** Time to expiration in years (e.g. 0.25 for 3 months) */
    timeToExpiry: number;
    /** Annualized risk-free interest rate (e.g. 0.05 for 5%) */
    riskFreeRate: number;
    /** Annualized volatility of the underlying (e.g. 0.20 for 20%) */
    volatility: number;
    /** Option type: 'call' or 'put' */
    optionType: OptionType;
    /** Continuous dividend yield (annualized). Default 0. */
    dividendYield?: number;
}
/** Full set of option Greeks */
export interface GreeksResult {
    /** Theoretical option price */
    price: number;
    /** Delta: rate of change of price w.r.t. underlying price */
    delta: number;
    /** Gamma: rate of change of delta w.r.t. underlying price */
    gamma: number;
    /** Theta: rate of change of price w.r.t. time (per calendar day) */
    theta: number;
    /** Vega: rate of change of price w.r.t. 1% change in volatility */
    vega: number;
    /** Rho: rate of change of price w.r.t. 1% change in interest rate */
    rho: number;
}
/** Parameters for binomial tree pricing */
export interface BinomialParams {
    /** Current price of the underlying asset */
    spot: number;
    /** Strike price */
    strike: number;
    /** Time to expiration in years */
    timeToExpiry: number;
    /** Annualized risk-free rate */
    riskFreeRate: number;
    /** Annualized volatility */
    volatility: number;
    /** Option type: 'call' or 'put' */
    optionType: OptionType;
    /** Number of time steps in the tree. Default 100. */
    steps?: number;
    /** Continuous dividend yield. Default 0. */
    dividendYield?: number;
}
/**
 * Black-Scholes option price for European calls and puts.
 *
 * Call: S * e^(-qT) * N(d1) - K * e^(-rT) * N(d2)
 * Put:  K * e^(-rT) * N(-d2) - S * e^(-qT) * N(-d1)
 *
 * @param params - Black-Scholes parameters
 * @returns The theoretical option price
 */
export declare function blackScholesPrice(params: BSParams): number;
/**
 * Black-Scholes Delta — sensitivity of option price to underlying price.
 * Call delta is in [0, 1], put delta is in [-1, 0].
 *
 * @param params - Black-Scholes parameters
 * @returns Delta value
 */
export declare function blackScholesDelta(params: BSParams): number;
/**
 * Black-Scholes Gamma — rate of change of delta w.r.t. underlying price.
 * Gamma is the same for calls and puts.
 *
 * @param params - Black-Scholes parameters
 * @returns Gamma value (always non-negative)
 */
export declare function blackScholesGamma(params: BSParams): number;
/**
 * Black-Scholes Theta — rate of change of option price w.r.t. time.
 * Returned as the daily rate of decay (negative for long options).
 *
 * @param params - Black-Scholes parameters
 * @returns Theta per calendar day (typically negative)
 */
export declare function blackScholesTheta(params: BSParams): number;
/**
 * Black-Scholes Vega — sensitivity of option price to a 1% change in volatility.
 * Vega is the same for calls and puts.
 *
 * @param params - Black-Scholes parameters
 * @returns Vega (price change per 0.01 increase in volatility)
 */
export declare function blackScholesVega(params: BSParams): number;
/**
 * Black-Scholes Rho — sensitivity of option price to a 1% change in interest rate.
 *
 * @param params - Black-Scholes parameters
 * @returns Rho (price change per 0.01 increase in risk-free rate)
 */
export declare function blackScholesRho(params: BSParams): number;
/**
 * Compute implied volatility from a market price using Newton-Raphson iteration.
 * Finds the volatility sigma such that BS(sigma) = marketPrice.
 *
 * @param marketPrice - Observed market price of the option
 * @param spot - Current underlying price
 * @param strike - Strike price
 * @param timeToExpiry - Time to expiration in years
 * @param riskFreeRate - Risk-free rate
 * @param optionType - 'call' or 'put'
 * @param dividendYield - Continuous dividend yield. Default 0.
 * @param maxIter - Maximum Newton-Raphson iterations. Default 100.
 * @param tol - Convergence tolerance. Default 1e-8.
 * @returns The implied volatility (annualized)
 * @throws Error if the solver does not converge
 */
export declare function impliedVolatility(marketPrice: number, spot: number, strike: number, timeToExpiry: number, riskFreeRate: number, optionType: OptionType, dividendYield?: number, maxIter?: number, tol?: number): number;
/**
 * Price an option using the Cox-Ross-Rubinstein (CRR) binomial tree.
 * Supports early exercise for American-style options.
 *
 * At each node, the option value is max(exercise_value, continuation_value).
 * For European style, early exercise is not checked (but this function still works).
 *
 * @param params - Binomial tree parameters
 * @param american - Whether to allow early exercise. Default true.
 * @returns The option price at time 0
 */
export declare function binomialTreePrice(params: BinomialParams, american?: boolean): number;
//# sourceMappingURL=greeks.d.ts.map