Instruments: Uniformity in the Instrument json structure is desired

Namaskra,

The Instruments json structure for equity (first 4 fields) is as follows:

NSE EQUITY

{
“segment”: “NSE_EQ”,
“name”: “SIEMENS LTD”,
“exchange”: “NSE”,
“isin”: “INE003A01024”, …

where as for the F&O is as follows:

{
“weekly”: false,
“segment”: “NSE_FO”,
“name”: “NIFTY”,
“exchange”: “NSE”,

If we have a standardized structure ..then the first key will be “segment” .
It would then super easy to determine the record type with first key itself.

WIth the introduction of Weekly as first key in F&O json object, we how have to check each and every record for weekly and then process the record. That is huge over head when I have to iterate over 47000 records.

It would be great if the key “Weekly” can be shifted to the bottom of the Json object so that the first key is always Segment.. so that the each record can be sorted fast on segment key.

Regards
Rathnadhar K V

I asked the same thing but they wanted million developers to iterate it 47000 times to filter their needs which they can resolve easily by sorting json keys once.

I think they didnt give much thought in the placement of keys.

the most critical key position must be on the top…
Here unfortunately they have violated that rule.

Since its Json, moving the week down dosent make any difference to those who are just working with Json style objects only.

But for critical performance there they should think carefully in establishing the standards for placing the keys. Here disturbing the most critical key index, as per the stock type…is not a professional outcome, in my opinion,

They can still change the Weekly key position, up the index. There by keeping Index [0] only for segment … that way the library that uses this will be highly temporally optimized.

Regards
Rathnadhar K V

Hi @RathnadharKV

Noted. This shouldn’t have been this way. Shall fix it soon and update back here

Thank you so much…looking forward to the fix.

1 Like