Greeks Data¶
The greeks realtime stream delivers continuously updating option Greeks and related option fields for a subscribed option contract.
LLM guidance
Use this page when the application needs live Greeks for one or more option ref_id values. Use snapshot option-chain APIs for one-time inspection instead of continuously updating Greeks.
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_greeks_data(msg):
print("[GREEKS]", 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_greeks_data=on_greeks_data,
on_connect=on_connect,
on_close=on_close,
on_error=on_error,
)
socket.connect()
socket.subscribe(["1058227"], data_type="greeks", exchange="NSE")
socket.keep_running()
Subscription Contract¶
| Parameter | Type | Required | Meaning |
|---|---|---|---|
ref_ids |
list[str] |
yes | option reference IDs |
data_type |
str |
yes | must be greeks |
exchange |
str |
no | exchange override |
Response Shape¶
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 |
|---|---|---|
ref_id |
int |
option instrument identifier |
timestamp |
int |
event timestamp |
strike_price |
int |
strike price |
lot_size |
int |
lot size |
last_traded_price |
int |
latest traded option price |
last_traded_price_change |
float |
option price change field |
iv |
float |
implied volatility |
delta |
float |
delta |
gamma |
float |
gamma |
theta |
float |
theta |
vega |
float |
vega |
volume |
int |
traded volume |
open_interest |
int |
open interest |
previous_open_interest |
int |
previous open interest |
Implementation Notes¶
- Subscribe using option
ref_id, not the underlying symbol. - This stream is useful when the application needs continuously updating sensitivity metrics.
- Use the snapshot option-chain page when you only need one-time inspection.
Important Rules
- This is a realtime stream, not a snapshot API.
greekssubscriptions require valid optionref_idvalues.- Use Get Instruments to retrieve the latest instrument expiries and resolve the correct option contract before subscribing by
ref_id. - Do not reuse environment-specific identifiers across UAT and PROD.
- Review Subscription Limits before opening large numbers of subscriptions.