Fix Gamma and cap the number of simulations at 10M
This commit is contained in:
6
serve.go
6
serve.go
@@ -21,6 +21,12 @@ func index(w http.ResponseWriter, r *http.Request) {
|
||||
json.Unmarshal(body, &bsOpt)
|
||||
json.Unmarshal(body, &mcOpt)
|
||||
|
||||
// Cap the number of simulations at 10M
|
||||
if bsOpt.Sims > 1e7 || mcOpt.Sims > 1e7 {
|
||||
bsOpt.Sims = 1e7
|
||||
mcOpt.Sims = 1e7
|
||||
}
|
||||
|
||||
mcOpt.PriceMonteCarlo()
|
||||
bsOpt.PriceClosedForm()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user