Skip to main content
POST
/
quantlib
/
solver
/
finance
/
oas
Calculate Option-Adjusted Spread (OAS)
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/solver/finance/oas \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "price": 102.5,
  "scenario_cashflows": [
    [
      3,
      3,
      103
    ],
    [
      3,
      3,
      3,
      103
    ],
    [
      3,
      103
    ]
  ],
  "times": [
    1,
    2,
    3,
    4
  ],
  "probabilities": [
    0.4,
    0.4,
    0.2
  ],
  "base_rates": [
    0.03,
    0.035,
    0.04,
    0.042
  ],
  "base_times": [
    1,
    2,
    3,
    4
  ]
}
'
{
  "success": true,
  "data": {
    "oas": 0.0085
  }
}

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 security

Example:

102.5

scenario_cashflows
number[][]
required

Array of cash flow arrays, one for each scenario

Example:
[[3, 3, 103], [3, 3, 3, 103], [3, 103]]
times
number[]
required

Array of payment times in years (same for all scenarios)

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

Array of scenario probabilities (must sum to 1.0)

Example:
[0.4, 0.4, 0.2]
base_rates
number[]
required

Array of zero rates for the base discount curve

Example:
[0.03, 0.035, 0.04, 0.042]
base_times
number[]
required

Array of times for the base discount curve

Example:
[1, 2, 3, 4]

Response

Successful Response

success
boolean
Example:

true

data
object