In the instruments file, certain futures contracts (e.g., BANKNIFTY) are named differently from their underlying assets (e.g., NIFTY BANK). This mismatch causes automation failures on expiry/closing days when scripts rely on fetching the underlying’s closing price.
While most instruments share identical names with their underlyings (e.g., "RELIANCE" futures vs. "RELIANCE" equity), exceptions like BANKNIFTY exist:
Futures name: BANKNIFTY → Underlying: NIFTY BANK Futures name: FINNIFTY → Underlying: NIFTY FINANCIAL SERVICES This inconsistency breaks workflows that assume 1:1 name alignment. Manually hardcoding mappings for each exception is error-prone and unsustainable.
Question: Is there a scalable way to programmatically link futures contracts to their underlyings? For example:
A broker/Exchange API that returns the underlying’s name or ID? A static reference table (e.g., CSV/JSON) maintained by the Exchange? How do others handle such mismatches in automated systems?
The tradingsymbol is something that exchange decides and publishes. We have no control over it. The only way to keep our systems up and running is to maintain a static mapping at your end and use it. We also do the same as it is inevitable.