Calculate Exposure Profile (EPE and PFE)
curl --request POST \
--url https://api.fincept.in/quantlib/risk/portfolio-risk/exposure-profile \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"paths": [
[
100000,
110000,
125000,
135000,
145000
],
[
100000,
95000,
105000,
115000,
130000
],
[
100000,
105000,
98000,
110000,
120000
],
[
100000,
92000,
88000,
95000,
105000
]
],
"confidence": 0.95
}
'import requests
url = "https://api.fincept.in/quantlib/risk/portfolio-risk/exposure-profile"
payload = {
"paths": [[100000, 110000, 125000, 135000, 145000], [100000, 95000, 105000, 115000, 130000], [100000, 105000, 98000, 110000, 120000], [100000, 92000, 88000, 95000, 105000]],
"confidence": 0.95
}
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({
paths: [
[100000, 110000, 125000, 135000, 145000],
[100000, 95000, 105000, 115000, 130000],
[100000, 105000, 98000, 110000, 120000],
[100000, 92000, 88000, 95000, 105000]
],
confidence: 0.95
})
};
fetch('https://api.fincept.in/quantlib/risk/portfolio-risk/exposure-profile', 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/risk/portfolio-risk/exposure-profile",
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([
'paths' => [
[
100000,
110000,
125000,
135000,
145000
],
[
100000,
95000,
105000,
115000,
130000
],
[
100000,
105000,
98000,
110000,
120000
],
[
100000,
92000,
88000,
95000,
105000
]
],
'confidence' => 0.95
]),
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/risk/portfolio-risk/exposure-profile"
payload := strings.NewReader("{\n \"paths\": [\n [\n 100000,\n 110000,\n 125000,\n 135000,\n 145000\n ],\n [\n 100000,\n 95000,\n 105000,\n 115000,\n 130000\n ],\n [\n 100000,\n 105000,\n 98000,\n 110000,\n 120000\n ],\n [\n 100000,\n 92000,\n 88000,\n 95000,\n 105000\n ]\n ],\n \"confidence\": 0.95\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/risk/portfolio-risk/exposure-profile")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"paths\": [\n [\n 100000,\n 110000,\n 125000,\n 135000,\n 145000\n ],\n [\n 100000,\n 95000,\n 105000,\n 115000,\n 130000\n ],\n [\n 100000,\n 105000,\n 98000,\n 110000,\n 120000\n ],\n [\n 100000,\n 92000,\n 88000,\n 95000,\n 105000\n ]\n ],\n \"confidence\": 0.95\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincept.in/quantlib/risk/portfolio-risk/exposure-profile")
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 \"paths\": [\n [\n 100000,\n 110000,\n 125000,\n 135000,\n 145000\n ],\n [\n 100000,\n 95000,\n 105000,\n 115000,\n 130000\n ],\n [\n 100000,\n 105000,\n 98000,\n 110000,\n 120000\n ],\n [\n 100000,\n 92000,\n 88000,\n 95000,\n 105000\n ]\n ],\n \"confidence\": 0.95\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"epe_profile": [
100000,
100500,
104000,
113750,
125000
],
"pfe_profile": [
100000,
109250,
123250,
133250,
143250
]
}
}{
"detail": "Invalid API key"
}{
"detail": "Insufficient credits. This endpoint requires 5 credits."
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}quantlib-risk
Calculate Exposure Profile (EPE and PFE)
Generates both Expected Positive Exposure (EPE) and Potential Future Exposure (PFE) profiles from simulated exposure paths. EPE is the average exposure at each time point, while PFE is the high quantile. Both are fundamental for counterparty credit risk management, capital allocation, and XVA calculations. [Tier: PRO, Credits: 5]
POST
/
quantlib
/
risk
/
portfolio-risk
/
exposure-profile
Calculate Exposure Profile (EPE and PFE)
curl --request POST \
--url https://api.fincept.in/quantlib/risk/portfolio-risk/exposure-profile \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"paths": [
[
100000,
110000,
125000,
135000,
145000
],
[
100000,
95000,
105000,
115000,
130000
],
[
100000,
105000,
98000,
110000,
120000
],
[
100000,
92000,
88000,
95000,
105000
]
],
"confidence": 0.95
}
'import requests
url = "https://api.fincept.in/quantlib/risk/portfolio-risk/exposure-profile"
payload = {
"paths": [[100000, 110000, 125000, 135000, 145000], [100000, 95000, 105000, 115000, 130000], [100000, 105000, 98000, 110000, 120000], [100000, 92000, 88000, 95000, 105000]],
"confidence": 0.95
}
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({
paths: [
[100000, 110000, 125000, 135000, 145000],
[100000, 95000, 105000, 115000, 130000],
[100000, 105000, 98000, 110000, 120000],
[100000, 92000, 88000, 95000, 105000]
],
confidence: 0.95
})
};
fetch('https://api.fincept.in/quantlib/risk/portfolio-risk/exposure-profile', 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/risk/portfolio-risk/exposure-profile",
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([
'paths' => [
[
100000,
110000,
125000,
135000,
145000
],
[
100000,
95000,
105000,
115000,
130000
],
[
100000,
105000,
98000,
110000,
120000
],
[
100000,
92000,
88000,
95000,
105000
]
],
'confidence' => 0.95
]),
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/risk/portfolio-risk/exposure-profile"
payload := strings.NewReader("{\n \"paths\": [\n [\n 100000,\n 110000,\n 125000,\n 135000,\n 145000\n ],\n [\n 100000,\n 95000,\n 105000,\n 115000,\n 130000\n ],\n [\n 100000,\n 105000,\n 98000,\n 110000,\n 120000\n ],\n [\n 100000,\n 92000,\n 88000,\n 95000,\n 105000\n ]\n ],\n \"confidence\": 0.95\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/risk/portfolio-risk/exposure-profile")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"paths\": [\n [\n 100000,\n 110000,\n 125000,\n 135000,\n 145000\n ],\n [\n 100000,\n 95000,\n 105000,\n 115000,\n 130000\n ],\n [\n 100000,\n 105000,\n 98000,\n 110000,\n 120000\n ],\n [\n 100000,\n 92000,\n 88000,\n 95000,\n 105000\n ]\n ],\n \"confidence\": 0.95\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincept.in/quantlib/risk/portfolio-risk/exposure-profile")
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 \"paths\": [\n [\n 100000,\n 110000,\n 125000,\n 135000,\n 145000\n ],\n [\n 100000,\n 95000,\n 105000,\n 115000,\n 130000\n ],\n [\n 100000,\n 105000,\n 98000,\n 110000,\n 120000\n ],\n [\n 100000,\n 92000,\n 88000,\n 95000,\n 105000\n ]\n ],\n \"confidence\": 0.95\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"epe_profile": [
100000,
100500,
104000,
113750,
125000
],
"pfe_profile": [
100000,
109250,
123250,
133250,
143250
]
}
}{
"detail": "Invalid API key"
}{
"detail": "Insufficient credits. This endpoint requires 5 credits."
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
API key for authentication. Get your key at https://api.fincept.in/auth/register
Body
application/json
⌘I
