{"id":33956900,"url":"https://github.com/gauss314/back-scholes-model","last_synced_at":"2025-12-12T20:50:42.976Z","repository":{"id":57092588,"uuid":"231671135","full_name":"gauss314/back-scholes-model","owner":"gauss314","description":"Black Scholes and Merton option, greeks and implied volatility calc for PHP Laravel or Symfony package","archived":false,"fork":false,"pushed_at":"2022-01-30T17:48:09.000Z","size":24,"stargazers_count":9,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-14T13:07:30.804Z","etag":null,"topics":["black","finance","greeks","implied-volatility","laravel","option-valuation","options","php","quant","scholes"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gauss314.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-03T21:49:22.000Z","updated_at":"2024-07-04T17:13:47.000Z","dependencies_parsed_at":"2022-08-22T21:40:30.920Z","dependency_job_id":null,"html_url":"https://github.com/gauss314/back-scholes-model","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gauss314/back-scholes-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauss314%2Fback-scholes-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauss314%2Fback-scholes-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauss314%2Fback-scholes-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauss314%2Fback-scholes-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gauss314","download_url":"https://codeload.github.com/gauss314/back-scholes-model/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauss314%2Fback-scholes-model/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27691291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["black","finance","greeks","implied-volatility","laravel","option-valuation","options","php","quant","scholes"],"created_at":"2025-12-12T20:50:41.877Z","updated_at":"2025-12-12T20:50:42.965Z","avatar_url":"https://github.com/gauss314.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Black and Scholes and Merton forms\n\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://packagist.org/packages/gauss314/bsm\"\u003e\u003cimg src=\"https://poser.pugx.org/gauss314/bsm/v/stable.svg\" alt=\" Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/gauss314/bsm\"\u003e\u003cimg src=\"https://poser.pugx.org/gauss314/bsm/downloads\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/gauss314/bsm\"\u003e\u003cimg src=\"https://poser.pugx.org/gauss314/bsm/license\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003eA simple way to get options primes, greeks and implied volatility using Black\u0026Scholes valuation model.\u003c/p\u003e\n\n# Installation\n\n```shell\n$ composer require \"gauss314/bsm\"\n```\n\u003cbr\u003e\n\n# Usage\n\nFor Laravel 5, Symfony and any PHP project and framework with a composer.json file\n\n\n```php\n\u003c?php\n\n// Instance Object\n$bsm = new \\gauss314\\bsm\\Bsm();\n\n// Parameters\n$spot=100;\n$strike=100;\n$free_risk=0.018;     //free risk rate 1=100%\n$time=30/365;         //time year fraction 1=1yr\n$sigma=0.2;           //Annualized volatility 1=100%\n$mkt_value=2;         //Option market value, its only necessary for implied volatility calc\n$dividend_yield=0;    //not required, default value = 0\n\n/*\n**********************************************\n          GET Call prime, and greeks\n**********************************************\n*/\n$call = $bsm-\u003ebsCall($spot, $strike, $free_risk, $time, $sigma, $dividend_yield);\n/*\n    Array\n    (\n        [call] =\u003e 2.3601461764389\n        [delta] =\u003e 0.52172023548133\n        [gamma] =\u003e 0.069473882914289\n        [vega] =\u003e 0.11420364314678\n        [theta] =\u003e -0.040524357193283\n        [rho] =\u003e 0.040941269072625\n    )\n*/\n\n\n\n/*\n**********************************************\n          GET Put prime, and greeks\n**********************************************\n*/\n$put = $bsm-\u003ebsPut($spot, $strike, $free_risk, $time, $sigma, $dividend_yield);\n/*\n    Array\n    (\n      [put] =\u003e 2.2123103559286\n      [delta] =\u003e -0.47827976451867\n      [gamma] =\u003e 0.069473882914289\n      [vega] =\u003e 0.11420364314678\n      [theta] =\u003e -0.035600140877582\n      [rho] =\u003e -0.041129002855723\n    )\n*/\n\n/*\n**********************************************\n            GET Implied volatility\n**********************************************\n*/\n\n$iv = $bsm-\u003eivCall($spot, $strike, $free_risk, $tiempo, $mkt_value);  // 16.84647\n\n//Use ivPut() method to get implied volatility from put contract.\n\n```\n\n\u003cbr\u003e\n\n# Configuration\n\nIt doesnt need any configuration line\n\n\nEnjoy it! :heart:  \n\n\u003cbr\u003e\n\n# Reference\n\n- [Black \u0026 Scholes \u0026 Merton forms](https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model)\n\n\u003cbr\u003e\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauss314%2Fback-scholes-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgauss314%2Fback-scholes-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauss314%2Fback-scholes-model/lists"}