Skip to main content
POST
/
quantlib
/
risk
/
sensitivities
/
bucket-delta
Calculate Bucket Delta (DV01 by Tenor)
curl --request POST \
  --url https://api.fincept.in/quantlib/risk/sensitivities/bucket-delta \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "positions": [
    {
      "tenor": 1,
      "notional": 2000000,
      "duration": 0.98
    },
    {
      "tenor": 3,
      "notional": 1500000,
      "duration": 2.85
    },
    {
      "tenor": 5,
      "notional": 1000000,
      "duration": 4.52
    },
    {
      "tenor": 10,
      "notional": 800000,
      "duration": 8.75
    }
  ],
  "bump_size": 0.0001
}
'
import requests

url = "https://api.fincept.in/quantlib/risk/sensitivities/bucket-delta"

payload = {
"positions": [
{
"tenor": 1,
"notional": 2000000,
"duration": 0.98
},
{
"tenor": 3,
"notional": 1500000,
"duration": 2.85
},
{
"tenor": 5,
"notional": 1000000,
"duration": 4.52
},
{
"tenor": 10,
"notional": 800000,
"duration": 8.75
}
],
"bump_size": 0.0001
}
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({
positions: [
{tenor: 1, notional: 2000000, duration: 0.98},
{tenor: 3, notional: 1500000, duration: 2.85},
{tenor: 5, notional: 1000000, duration: 4.52},
{tenor: 10, notional: 800000, duration: 8.75}
],
bump_size: 0.0001
})
};

fetch('https://api.fincept.in/quantlib/risk/sensitivities/bucket-delta', 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/sensitivities/bucket-delta",
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([
'positions' => [
[
'tenor' => 1,
'notional' => 2000000,
'duration' => 0.98
],
[
'tenor' => 3,
'notional' => 1500000,
'duration' => 2.85
],
[
'tenor' => 5,
'notional' => 1000000,
'duration' => 4.52
],
[
'tenor' => 10,
'notional' => 800000,
'duration' => 8.75
]
],
'bump_size' => 0.0001
]),
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/sensitivities/bucket-delta"

payload := strings.NewReader("{\n \"positions\": [\n {\n \"tenor\": 1,\n \"notional\": 2000000,\n \"duration\": 0.98\n },\n {\n \"tenor\": 3,\n \"notional\": 1500000,\n \"duration\": 2.85\n },\n {\n \"tenor\": 5,\n \"notional\": 1000000,\n \"duration\": 4.52\n },\n {\n \"tenor\": 10,\n \"notional\": 800000,\n \"duration\": 8.75\n }\n ],\n \"bump_size\": 0.0001\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/sensitivities/bucket-delta")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"positions\": [\n {\n \"tenor\": 1,\n \"notional\": 2000000,\n \"duration\": 0.98\n },\n {\n \"tenor\": 3,\n \"notional\": 1500000,\n \"duration\": 2.85\n },\n {\n \"tenor\": 5,\n \"notional\": 1000000,\n \"duration\": 4.52\n },\n {\n \"tenor\": 10,\n \"notional\": 800000,\n \"duration\": 8.75\n }\n ],\n \"bump_size\": 0.0001\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.fincept.in/quantlib/risk/sensitivities/bucket-delta")

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 \"positions\": [\n {\n \"tenor\": 1,\n \"notional\": 2000000,\n \"duration\": 0.98\n },\n {\n \"tenor\": 3,\n \"notional\": 1500000,\n \"duration\": 2.85\n },\n {\n \"tenor\": 5,\n \"notional\": 1000000,\n \"duration\": 4.52\n },\n {\n \"tenor\": 10,\n \"notional\": 800000,\n \"duration\": 8.75\n }\n ],\n \"bump_size\": 0.0001\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": {
    "1Y": 1960,
    "3Y": 4275,
    "5Y": 4520,
    "10Y": 7000,
    "total": 17755
  }
}
{
"detail": "Invalid API key"
}
{
"detail": "Insufficient credits. This endpoint requires 5 credits."
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key at https://api.fincept.in/auth/register

Body

application/json
positions
object[]
required

List of fixed income positions with tenor information

Example:
[
{
"tenor": 2,
"notional": 1000000,
"duration": 1.9
},
{
"tenor": 5,
"notional": 500000,
"duration": 4.5
}
]
bump_size
number
default:0.0001

Rate bump size in decimal (e.g., 0.0001 for 1bp)

Example:

0.0001

Response

Bucket delta by tenor

success
boolean
Example:

true

data
object

DV01 by tenor bucket

Example:
{
"1Y": 1960,
"3Y": 4275,
"5Y": 4520,
"10Y": 7000
}