@volare.finance/volare.js
Version:
The SDK for Volare Protocol
19 lines (18 loc) • 933 B
TypeScript
/**
* @file greeks.ts
* @description Determine implied volatility of options based on their prices.
* @author astra <astra@volare.finance>
* @date 2022
*/
/**
* @description Calculate a close estimate of implied volatility given an option price. A binary search type approach is used to determine the implied volatility.
* @param {Number} expectedCost The market price of the option
* @param {Number} s Current price of the underlying
* @param {Number} k Strike price
* @param {Number} t Time to expatriation in years
* @param {Number} r Annual risk-free interest rate as a decimal
* @param {Boolean} isPut The type of option priced
* @param {Number} [estimate=.1] An initial estimate of implied volatility
* @returns {Number} The implied volatility estimate
*/
export declare function getImpliedVolatility(expectedCost: number, s: number, k: number, t: number, r: number, isPut: boolean, estimate?: number): number;