Socket
Socket
Sign inDemoInstall

bs-formula

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bs-formula

The Black-Scholes formula


Version published
Maintainers
1
Created

Readme

Source

black-scholes

NPM version build status license

The Black-Scholes formula

This is an implementation of the Black-Scholes model for pricing a European call option.

Assumptions:

  • The stock returns follow a geometric Brownian motion
  • The underlying asset does not pay a dividend
  • The rate of return on the risk-free asset is constant
  • There are no arbitrage opportunities on the market

Installation

$ npm install bs-formula

Usage

var bs = require('bs-formula');

var inputs = {
  currentPrice: 57,         // current price of the underlying asset
  strikePrice: 50,          // strike price of the option
  interestRate: 0.01,       // annual risk-free interest rate
  volatility: 0.50,         // volatility of the underlying asset
  timeToExpiration: 0.25    // time to expiration of the option in years
};

bs(inputs); // 9.70

License

MIT

FAQs

Last updated on 03 Jun 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc