Skip to main content
POST
/
quantlib
/
models
/
short-rate
/
yield-curve
Short Rate Yield Curve
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/models/short-rate/yield-curve \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "model": "cir",
  "kappa": 0.2,
  "theta": 0.05,
  "sigma": 0.015,
  "r0": 0.025,
  "maturities": [
    0.5,
    1,
    2,
    3,
    5,
    7,
    10,
    20,
    30
  ]
}
'
{
  "success": true,
  "data": {
    "model": "cir",
    "yield_curve": [
      {
        "maturity": 0.5,
        "yield": 0.0275
      },
      {
        "maturity": 1,
        "yield": 0.0298
      },
      {
        "maturity": 2,
        "yield": 0.0335
      },
      {
        "maturity": 3,
        "yield": 0.0361
      },
      {
        "maturity": 5,
        "yield": 0.0399
      },
      {
        "maturity": 7,
        "yield": 0.0424
      },
      {
        "maturity": 10,
        "yield": 0.0453
      },
      {
        "maturity": 20,
        "yield": 0.0488
      },
      {
        "maturity": 30,
        "yield": 0.0495
      }
    ]
  }
}

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
maturities
number[]
required

Maturities in years where yields are calculated

model
enum<string>
default:vasicek

Short rate model to use for yield curve generation

Available options:
vasicek,
cir
kappa
number
default:0.1

Mean reversion speed (annualized). Controls how quickly rates revert to long-term mean

theta
number
default:0.05

Long-term mean rate (annualized). The equilibrium rate level

sigma
number
default:0.01

Rate volatility (annualized). Higher values produce steeper curves

r0
number
default:0.03

Initial short rate (annualized). Starting point of the curve

Response

Successfully generated yield curve

success
boolean
Example:

true

data
object
Example:
{
"model": "cir",
"yield_curve": [
{ "maturity": 0.5, "yield": 0.0275 },
{ "maturity": 1, "yield": 0.0298 },
{ "maturity": 2, "yield": 0.0335 },
{ "maturity": 3, "yield": 0.0361 },
{ "maturity": 5, "yield": 0.0399 },
{ "maturity": 7, "yield": 0.0424 },
{ "maturity": 10, "yield": 0.0453 },
{ "maturity": 20, "yield": 0.0488 },
{ "maturity": 30, "yield": 0.0495 }
]
}