MultiOptionGreeks

Multi Option Greeks API

Endpoint URL

This API Function Calculates Multi Option Greeks (Delta, Gamma, Theta, Vega, Rho) and Implied Volatility using Black-76 Model

Local Host   :  POST http://127.0.0.1:5000/api/v1/multioptiongreeks
Ngrok Domain :  POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/multioptiongreeks
Custom Domain:  POST https://<your-custom-domain>/api/v1/multioptiongreeks

Why Black-76 Model?

OpenAlgo uses the Black-76 model (via py_vollib library) instead of Black-Scholes for calculating multi option Greeks. This is the correct choice for Indian F&O markets:

Key Benefits:

  • Accurate pricing for options on futures and forwards

  • Industry-standard model used by NSE, BSE, MCX

  • Greeks match with professional trading platforms

  • Proper handling of cost of carry

Prerequisites

  1. py_vollib Library Required

    • Install with: pip install py_vollib

    • Or with uv: uv pip install py_vollib

    • Required for Black-76 calculations

  2. Market Data Access

    • Requires real-time LTP for underlying and option

    • Uses OpenAlgo quotes API internally

  3. Valid API Key

    • API key must be active and valid

    • Get API key from OpenAlgo settings

Sample API Request (NFO - NIFTY Option with Auto-Detected Spot)

Note: Auto-detects NIFTY from NSE_INDEX (spot price: 26240) as underlying

Sample API Request (Explicit Underlying with Zero Interest Rate)

Note: Explicitly specifies NIFTY spot (26240) from NSE_INDEX. Using interest_rate: 0 for theoretical calculations or when interest rate impact is negligible.

Sample API Response (Success)

Sample API Request (Using Futures as Underlying)

Sample API Response (Success - With Futures)

Sample API Request (With Custom Interest Rate)

Parameter Description

Parameters
Description
Mandatory/Optional
Default Value

apikey

App API key

Mandatory

-

symbol

Option symbol (e.g., NIFTY02DEC2526000CE)

Mandatory

-

exchange

Exchange code (NFO, BFO, CDS, MCX)

Mandatory

-

interest_rate

Risk-free interest rate (annualized %). Specify current RBI repo rate (e.g., 6.5, 6.75) for accurate Rho calculations. Use 0 for theoretical calculations or when interest rate impact is negligible

Optional

0

forward_price

Custom forward/synthetic futures price. If provided, skips underlying price fetch. Useful for synthetic futures (Spot x e^rT) or illiquid underlyings like FINNIFTY, MIDCPNIFTY

Optional

Auto-fetched

underlying_symbol

Custom underlying symbol (e.g., NIFTY or NIFTY30DEC25FUT)

Optional

Auto-detected

underlying_exchange

Custom underlying exchange (e.g., NSE_INDEX or NFO)

Optional

Auto-detected

expiry_time

Custom expiry time in HH:MM format (e.g., "17:00", "19:00"). Required for MCX contracts with non-standard expiry times

Optional

Exchange defaults: NFO/BFO=15:30, CDS=12:30, MCX=23:30

Notes:

  • Interest Rate: Default is 0. For accurate Greeks (especially Rho), specify current RBI repo rate (typically 6.25-7.0%). Interest rate has minimal impact on short-term options (< 7 days).

  • Forward Price: When provided, the API uses this value directly instead of fetching underlying price. Calculate synthetic futures as: Forward = Spot x e^(r x T) where r is interest rate and T is time to expiry in years.

  • Use underlying_symbol and underlying_exchange to choose between spot and futures as underlying. If not specified, automatically uses spot price.

  • Use expiry_time for MCX commodities that don't expire at the default 23:30. See MCX Commodity Expiry Times section below.

Response Parameters

Parameter
Description
Type

status

API response status (success/error)

string

symbol

Option symbol

string

exchange

Exchange code

string

underlying

Underlying symbol

string

strike

Strike price

number

option_type

Option type (CE/PE)

string

expiry_date

Expiry date (formatted)

string

days_to_expiry

Days remaining to expiry

number

spot_price

Underlying spot/futures/forward price

number

option_price

Current option premium

number

interest_rate

Interest rate used

number

implied_volatility

Implied Volatility (%)

number

greeks

Object containing Greeks

object

greeks.delta

Delta (rate of change of option price)

number

greeks.gamma

Gamma (rate of change of delta)

number

greeks.theta

Theta (time decay per day)

number

greeks.vega

Vega (sensitivity to volatility per 1%)

number

greeks.rho

Rho (sensitivity to interest rate)

number

Last updated

Was this helpful?