Skip to main content
POST
/
quantlib
/
risk
/
sensitivities
/
key-rate-duration
Calculate Key Rate Durations
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/risk/sensitivities/key-rate-duration \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "cashflows": [
    50,
    50,
    50,
    50,
    1050
  ],
  "times": [
    1,
    2,
    3,
    4,
    5
  ],
  "curve_rates": [
    0.025,
    0.028,
    0.03,
    0.032,
    0.034
  ],
  "bump_size": 0.0001
}
'
{
  "success": true,
  "data": {
    "key_rate_durations": [
      0.95,
      1.82,
      2.68,
      3.45,
      4.15
    ]
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication. Get your key at https://finceptbackend.share.zrok.io/auth/register

Body

application/json
cashflows
number[]
required

Bond cashflows (coupon payments and principal)

Example:
[5, 5, 5, 105]
times
number[]
required

Time points (in years) when cashflows occur

Example:
[1, 2, 3, 4]
curve_rates
number[]
required

Current yield curve rates at each time point

Example:
[0.02, 0.025, 0.03, 0.035]
bump_size
number
default:0.0001

Rate bump size for sensitivity calculation

Example:

0.0001

Response

Key rate durations

success
boolean
Example:

true

data
object