curl --request POST \
--url https://api.fincept.in/quantlib/pricing/basket-levy \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"weights": [
0.4,
0.3,
0.3
],
"forwards": [
105,
98,
110
],
"sigmas": [
0.25,
0.3,
0.28
],
"correlations": [
1,
0.6,
0.5,
1,
0.55,
1
],
"strike": 100,
"risk_free_rate": 0.05,
"time_to_maturity": 1
}
'import requests
url = "https://api.fincept.in/quantlib/pricing/basket-levy"
payload = {
"weights": [0.4, 0.3, 0.3],
"forwards": [105, 98, 110],
"sigmas": [0.25, 0.3, 0.28],
"correlations": [1, 0.6, 0.5, 1, 0.55, 1],
"strike": 100,
"risk_free_rate": 0.05,
"time_to_maturity": 1
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
weights: [0.4, 0.3, 0.3],
forwards: [105, 98, 110],
sigmas: [0.25, 0.3, 0.28],
correlations: [1, 0.6, 0.5, 1, 0.55, 1],
strike: 100,
risk_free_rate: 0.05,
time_to_maturity: 1
})
};
fetch('https://api.fincept.in/quantlib/pricing/basket-levy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fincept.in/quantlib/pricing/basket-levy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'weights' => [
0.4,
0.3,
0.3
],
'forwards' => [
105,
98,
110
],
'sigmas' => [
0.25,
0.3,
0.28
],
'correlations' => [
1,
0.6,
0.5,
1,
0.55,
1
],
'strike' => 100,
'risk_free_rate' => 0.05,
'time_to_maturity' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fincept.in/quantlib/pricing/basket-levy"
payload := strings.NewReader("{\n \"weights\": [\n 0.4,\n 0.3,\n 0.3\n ],\n \"forwards\": [\n 105,\n 98,\n 110\n ],\n \"sigmas\": [\n 0.25,\n 0.3,\n 0.28\n ],\n \"correlations\": [\n 1,\n 0.6,\n 0.5,\n 1,\n 0.55,\n 1\n ],\n \"strike\": 100,\n \"risk_free_rate\": 0.05,\n \"time_to_maturity\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fincept.in/quantlib/pricing/basket-levy")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"weights\": [\n 0.4,\n 0.3,\n 0.3\n ],\n \"forwards\": [\n 105,\n 98,\n 110\n ],\n \"sigmas\": [\n 0.25,\n 0.3,\n 0.28\n ],\n \"correlations\": [\n 1,\n 0.6,\n 0.5,\n 1,\n 0.55,\n 1\n ],\n \"strike\": 100,\n \"risk_free_rate\": 0.05,\n \"time_to_maturity\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincept.in/quantlib/pricing/basket-levy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"weights\": [\n 0.4,\n 0.3,\n 0.3\n ],\n \"forwards\": [\n 105,\n 98,\n 110\n ],\n \"sigmas\": [\n 0.25,\n 0.3,\n 0.28\n ],\n \"correlations\": [\n 1,\n 0.6,\n 0.5,\n 1,\n 0.55,\n 1\n ],\n \"strike\": 100,\n \"risk_free_rate\": 0.05,\n \"time_to_maturity\": 1\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"basket_call_price": 9.876
}
}{
"detail": "Invalid API key"
}{
"detail": "Insufficient credits. This endpoint costs 2 credits per request."
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Basket Option Price (Levy Approximation)
Price a basket call option using Levy’s moment-matching approximation. A basket option has payoff based on a weighted sum of multiple assets.
Payoff: max(Σ w_i × F_i - K, 0)
Use Cases:
- Price index options (equity indices, commodity baskets)
- Value portfolio options
- Price multi-asset structured products
- Hedge basket exposures
- Price custom index derivatives
Method: Uses moment matching to approximate the basket distribution with a lognormal distribution.
Note: Accuracy depends on correlation structure and relative asset weights.
Tier: Standard (2 credits/request) [Tier: PRO, Credits: 5]
curl --request POST \
--url https://api.fincept.in/quantlib/pricing/basket-levy \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"weights": [
0.4,
0.3,
0.3
],
"forwards": [
105,
98,
110
],
"sigmas": [
0.25,
0.3,
0.28
],
"correlations": [
1,
0.6,
0.5,
1,
0.55,
1
],
"strike": 100,
"risk_free_rate": 0.05,
"time_to_maturity": 1
}
'import requests
url = "https://api.fincept.in/quantlib/pricing/basket-levy"
payload = {
"weights": [0.4, 0.3, 0.3],
"forwards": [105, 98, 110],
"sigmas": [0.25, 0.3, 0.28],
"correlations": [1, 0.6, 0.5, 1, 0.55, 1],
"strike": 100,
"risk_free_rate": 0.05,
"time_to_maturity": 1
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
weights: [0.4, 0.3, 0.3],
forwards: [105, 98, 110],
sigmas: [0.25, 0.3, 0.28],
correlations: [1, 0.6, 0.5, 1, 0.55, 1],
strike: 100,
risk_free_rate: 0.05,
time_to_maturity: 1
})
};
fetch('https://api.fincept.in/quantlib/pricing/basket-levy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fincept.in/quantlib/pricing/basket-levy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'weights' => [
0.4,
0.3,
0.3
],
'forwards' => [
105,
98,
110
],
'sigmas' => [
0.25,
0.3,
0.28
],
'correlations' => [
1,
0.6,
0.5,
1,
0.55,
1
],
'strike' => 100,
'risk_free_rate' => 0.05,
'time_to_maturity' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fincept.in/quantlib/pricing/basket-levy"
payload := strings.NewReader("{\n \"weights\": [\n 0.4,\n 0.3,\n 0.3\n ],\n \"forwards\": [\n 105,\n 98,\n 110\n ],\n \"sigmas\": [\n 0.25,\n 0.3,\n 0.28\n ],\n \"correlations\": [\n 1,\n 0.6,\n 0.5,\n 1,\n 0.55,\n 1\n ],\n \"strike\": 100,\n \"risk_free_rate\": 0.05,\n \"time_to_maturity\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fincept.in/quantlib/pricing/basket-levy")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"weights\": [\n 0.4,\n 0.3,\n 0.3\n ],\n \"forwards\": [\n 105,\n 98,\n 110\n ],\n \"sigmas\": [\n 0.25,\n 0.3,\n 0.28\n ],\n \"correlations\": [\n 1,\n 0.6,\n 0.5,\n 1,\n 0.55,\n 1\n ],\n \"strike\": 100,\n \"risk_free_rate\": 0.05,\n \"time_to_maturity\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincept.in/quantlib/pricing/basket-levy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"weights\": [\n 0.4,\n 0.3,\n 0.3\n ],\n \"forwards\": [\n 105,\n 98,\n 110\n ],\n \"sigmas\": [\n 0.25,\n 0.3,\n 0.28\n ],\n \"correlations\": [\n 1,\n 0.6,\n 0.5,\n 1,\n 0.55,\n 1\n ],\n \"strike\": 100,\n \"risk_free_rate\": 0.05,\n \"time_to_maturity\": 1\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"basket_call_price": 9.876
}
}{
"detail": "Invalid API key"
}{
"detail": "Insufficient credits. This endpoint costs 2 credits per request."
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
API key for authentication. Get your key at https://api.fincept.in/auth/register
Body
Weights of each asset in the basket
[0.4, 0.3, 0.3]
Forward prices of basket assets
[105, 98, 110]
Volatilities of basket assets (decimal format)
[0.25, 0.3, 0.28]
Flattened correlation matrix or upper triangle values
[1, 0.6, 0.5, 1, 0.55, 1]
Strike price of the basket option
100
Risk-free interest rate (annualized, decimal format)
0.05
Time to expiration in years
1
