Option Chain Data¶
The option realtime stream delivers continuously updating option-chain data, including strikes, price data, OI, and Greeks for a selected underlying and expiry.
LLM guidance
Use this page when generating streaming option-chain logic for one underlying and expiry key over WebSocket. Use Option Chain for one-time snapshot reads instead of a live stream.
Basic Usage¶
from nubra_python_sdk.ticker import websocketdata
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv
nubra = InitNubraSdk(NubraEnv.PROD, env_creds=True)
def on_option_data(msg):
print("[OPTION]", msg)
def on_connect(msg):
print("[status]", msg)
def on_close(reason):
print(f"Closed: {reason}")
def on_error(err):
print(f"Error: {err}")
socket = websocketdata.NubraDataSocket(
client=nubra,
on_option_data=on_option_data,
on_connect=on_connect,
on_close=on_close,
on_error=on_error,
)
socket.connect()
socket.subscribe(["RELIANCE:20250626"], data_type="option", exchange="NSE")
socket.keep_running()
Subscription Contract¶
| Parameter | Type | Required | Meaning |
|---|---|---|---|
symbols |
list[str] |
yes | option-chain subscription keys such as RELIANCE:20250626 |
data_type |
str |
yes | must be option |
exchange |
str |
no | exchange override |
Response Shape¶
class OptionChainWrapper:
asset: str
expiry: str
at_the_money_strike: int
current_price: int
exchange: str
ce: list[OptionData]
pe: list[OptionData]
class OptionData:
ref_id: int
timestamp: int
strike_price: int
lot_size: int
last_traded_price: int | None
last_traded_price_change: float | None
iv: float | None
delta: float | None
gamma: float | None
theta: float | None
vega: float | None
volume: int | None
open_interest: int | None
previous_open_interest: int | None
Response Contract¶
| Field | Type | Meaning |
|---|---|---|
asset |
str |
underlying symbol |
expiry |
str |
selected expiry |
at_the_money_strike |
int |
ATM strike for the current chain state |
current_price |
int |
underlying current price |
exchange |
str |
exchange name |
ce |
list[OptionData] |
call-side option rows |
pe |
list[OptionData] |
put-side option rows |
ce[].ref_id / pe[].ref_id |
int |
option instrument identifier |
ce[].last_traded_price / pe[].last_traded_price |
int |
option last traded price |
ce[].iv / pe[].iv |
float |
implied volatility |
ce[].delta / pe[].delta |
float |
delta |
ce[].gamma / pe[].gamma |
float |
gamma |
ce[].theta / pe[].theta |
float |
theta |
ce[].vega / pe[].vega |
float |
vega |
ce[].open_interest / pe[].open_interest |
int |
open interest |
ce[].volume / pe[].volume |
int |
traded volume |
Implementation Notes¶
- This stream is the realtime counterpart to the snapshot Option Chain page.
- Subscription keys typically combine the underlying and expiry.
- Prices and strikes are returned in exchange-native units where applicable.
Important Rules
- This is a realtime stream, not a snapshot API.
- Option Chain subscriptions have high weight cost. Review Subscription Limits.
- Use Get Instruments to retrieve the latest instrument expiries before building an
ASSET:EXPIRYoption-chain subscription key. - Use the correct underlying and expiry key format when subscribing.
- Do not assume identifiers or contract availability are identical across environments.