Skip to content

Option Chain

option_chain() returns the option chain for an underlying instrument. The response includes strike-level calls and puts together with OI, volume, Greeks, top-level price data, and available expiries.

Walkthrough Video

If the embedded video does not load, watch it on YouTube: Option Chain Snapshot Walkthrough

When To Use This Page

Use this page when you need to:

  • inspect strikes around the current underlying price
  • read OI, IV, Greeks, and volume by strike
  • find the at-the-money strike
  • work with expiry-aware option analytics

LLM guidance

Use option_chain() for strike-level option analytics and discovery. If you only need one option instrument quote, resolve the instrument and use Market Quotes or Current Price as appropriate.

Basic Usage

from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv

nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True)
market_data = MarketData(nubra)

result = market_data.option_chain("NIFTY", exchange="NSE")
print(result)

Accessing Response Fields

chain = result.chain

print(f"Current Price: {chain.current_price}")
print(f"ATM Strike: {chain.at_the_money_strike}")
print(f"Available Expiries: {chain.all_expiries}")

atm_ce = next((opt for opt in chain.ce if opt.strike_price == chain.at_the_money_strike), None)
atm_pe = next((opt for opt in chain.pe if opt.strike_price == chain.at_the_money_strike), None)

if atm_ce:
    print(atm_ce.ref_id, atm_ce.last_traded_price, atm_ce.open_interest, atm_ce.iv)

if atm_pe:
    print(atm_pe.ref_id, atm_pe.last_traded_price, atm_pe.open_interest, atm_pe.iv)

SDK Surface

from nubra_python_sdk.marketdata.market_data import MarketData

MarketData.option_chain(instrument: str, expiry=None, exchange=None)

Request Contract

Parameter Type Required Example Meaning
instrument str yes NIFTY underlying instrument symbol
expiry str no 20250508 expiry in YYYYMMDD format
exchange str no NSE exchange override

Response Contract

Field Type Nullable Meaning
chain OptionChain no option-chain payload
message str no response label
exchange str yes exchange name
chain.asset str no underlying asset symbol
chain.expiry str yes selected expiry
chain.ce list[OptionData] yes call-side chain
chain.pe list[OptionData] yes put-side chain
chain.at_the_money_strike int yes ATM strike
chain.current_price int yes underlying current price
chain.all_expiries list[str] yes available expiries

Reference Response Shape

class OptionChainWrapper:
    chain: OptionChain
    message: str
    exchange: str | None

class OptionChain:
    asset: str
    expiry: str | None
    ce: list[OptionData]
    pe: list[OptionData]
    at_the_money_strike: int | None
    current_price: int | None
    all_expiries: list[str]

class OptionData:
    ref_id: int
    timestamp: int
    strike_price: int
    lot_size: int
    last_traded_price: int
    last_traded_price_change: float
    iv: float
    delta: float
    gamma: float
    theta: float
    vega: float
    open_interest: int
    open_interest_change: float
    volume: int

Implementation Notes

  • instrument refers to the underlying, not the option symbol itself.
  • Use all_expiries to discover available expiries before choosing one explicitly.
  • The ce and pe arrays expose strike-level call and put data separately.
  • ref_id values inside the option chain can be used in downstream quote or trading workflows after environment-appropriate resolution.

Important Rules

  • Use the underlying symbol, not an option trading symbol, when calling option_chain().
  • Expiry availability can vary, so do not assume a hardcoded expiry will always be present.
  • Use Get Instruments to retrieve the latest instrument expiries before selecting an expiry for option-chain or option-contract workflows.
  • ref_id values are environment-specific. Do not reuse UAT identifiers in PROD or vice versa.
  • Strike and price fields are returned in exchange-native integer units such as paise for NSE instruments unless your application converts them.
  • This is a snapshot response, not a realtime streaming feed.
  • Use option-chain data for strike discovery and analytics, then pass the selected option ref_id into downstream quote or trading flows as needed.

The most common next pages are:

  1. Get Instruments
  2. Market Quotes
  3. Current Price
  4. Place Order
NEO Assistant