Skip to main content
POST
/
quantlib
/
pricing
/
binomial
/
barrier
Binomial Tree Barrier Option
curl --request POST \
  --url https://finceptbackend.share.zrok.io/quantlib/pricing/binomial/barrier \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "spot": 100,
  "strike": 105,
  "risk_free_rate": 0.05,
  "dividend_yield": 0.02,
  "volatility": 0.25,
  "time_to_maturity": 1,
  "n_steps": 100,
  "option_type": "call",
  "barrier": 95,
  "is_knock_in": false,
  "is_down": true,
  "rebate": 2,
  "method": "CRR"
}
'
{
  "success": true,
  "data": {
    "price": 6.234,
    "barrier": 95,
    "is_knock_in": false,
    "is_down": true
  }
}

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

Current price of the underlying asset

Example:

100

strike
number
required

Strike price of the option

Example:

105

risk_free_rate
number
required

Risk-free interest rate (annualized, decimal format)

Example:

0.05

volatility
number
required

Annualized volatility (decimal format)

Example:

0.25

time_to_maturity
number
required

Time to expiration in years

Example:

1

barrier
number
required

Barrier level that triggers knock-in or knock-out

Example:

95

is_knock_in
boolean
required

True for knock-in barrier, false for knock-out barrier

is_down
boolean
required

True for down barrier, false for up barrier

dividend_yield
number
default:0

Continuous dividend yield (annualized, decimal format)

Example:

0.02

n_steps
integer
default:100

Number of time steps in the binomial tree

Example:

100

option_type
enum<string>
default:call

Type of option

Available options:
call,
put
Example:

"call"

rebate
number
default:0

Rebate paid if barrier option is knocked out

Example:

0

method
enum<string>
default:CRR

Binomial tree method

Available options:
CRR,
JR,
LR,
TIAN
Example:

"CRR"

Response

Successful calculation

success
boolean
Example:

true

data
object