Skip to main content
POST
/
quantlib
/
solver
/
finance
/
z-spread
Calculate Z-Spread
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/solver/finance/z-spread \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "price": 98.5,
  "cashflows": [
    2.5,
    2.5,
    2.5,
    2.5,
    102.5
  ],
  "times": [
    0.5,
    1,
    1.5,
    2,
    2.5
  ],
  "base_rates": [
    0.03,
    0.032,
    0.034,
    0.036,
    0.038
  ]
}
'
{
  "success": true,
  "data": {
    "z_spread": 0.0125
  }
}

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
price
number
required

Current market price of the bond

Example:

98.5

cashflows
number[]
required

Array of bond cash flows (coupons and principal)

Example:
[2.5, 2.5, 2.5, 2.5, 102.5]
times
number[]
required

Array of payment times in years

Example:
[0.5, 1, 1.5, 2, 2.5]
base_rates
number[]
required

Array of zero rates (spot rates) at each payment time as decimals

Example:
[0.03, 0.032, 0.034, 0.036, 0.038]

Response

Successful Response

success
boolean
Example:

true

data
object