The Exchange and Exchange Segment should be represented as distinct entities as they are

Namaskara,

Lets take an example: The response body of GetOrderDetails

{
“status”: “success”,
“data”: {
“exchange”: “NSE”,
“product”: “D”,
“price”: 571.0,
“quantity”: 1,
“status”: “complete”,
“tag”: null,
“instrument_token”: “NSE_EQ|INE062A01020”,
“placed_by”: “******”,
“trading_symbol”: “SBIN-EQ”,
“tradingsymbol”: “SBIN-EQ”,
“order_type”: “LIMIT”,
“validity”: “DAY”,
“trigger_price”: 0.0,
“disclosed_quantity”: 0,
“transaction_type”: “BUY”,
“average_price”: 570.95,
“filled_quantity”: 1,
“pending_quantity”: 0,
“status_message”: null,
“status_message_raw”: null,
“exchange_order_id”: “1300000025660919”,
“parent_order_id”: null,
“order_id”: “231019025562880”,
“variety”: “SIMPLE”,
“order_timestamp”: “2023-10-19 13:25:13”,
“exchange_timestamp”: “2023-10-19 13:25:13”,
“is_amo”: false,
“order_request_id”: “1”,
“order_ref_id”: “GTT-C23191000044253”
}
}

Here Json Key Exchange has value “NSE”, however the list of Exchanges as provided in the appendix is as follows:

Description:

data.exchange : Exchange to which the order is associated. Valid exchanges can be found in the Exchange Appendix

Kindly note the word used is Exchange instead of Exchange Segment.

Valid (major) exchanges in Bharatha are:

1. NSE
2. BSE
3. MCX

However the list as per /appendix/exchange is as follows:

Value Description
NSE Represents equities traded on the National Stock Exchange.
NFO Futures and options segment of the National Stock Exchange.
CDS Currency derivatives segment for forex futures and options.
BSE Equities listed on the Bombay Stock Exchange.
BFO Futures and options segment of the Bombay Stock Exchange.
BCD Currency derivatives trading on the Bombay Stock Exchange.
MCX Commodity futures trading on the Multi Commodity Exchange.
NSCOM Commodity derivatives trading on National Stock Exchange.

Here the entities are mixed leading to confusion…

Let me put this way, the relation between Exchange and Exchange Segments.

Exchange CONTAINS Exchange Segments.

So they are distinct entities. That leads to following combination:

Exchange | Exchange_Segment

  1. NSE | NSE_EQ (NSE cash segment)
  2. NSE | NSE_FO (NSE Derivative segment)
  3. NSE | NSE_NSCOM (NSE Commodity segment)
  4. NSE | NSE_CDS (NSE Currency derivative segment)
  5. BSE | BSE_EQ
  6. BSE | BSE_FO
  7. BSE | BSE_BCD
  8. MCX | MCX_FO

Here we have segregated the entities to their respective sets.

This results in a clearer data representation, for ex:
“exchange”: “NSE”,
“exchange_segment”: “NSE_FO”,

I hope it gets implemented.

Regards
Rathnadhar K V

Namaskara,

Strangely…

Get Trade History Response has SEGMENT !!

{
“status”: “success”,
“data”: [
{
“exchange”: “NSE”,
“segment”: “EQ”,
“option_type”: “”,
“quantity”: 1,
“amount”: 2252.35,
“trade_id”: “75217259”,
“trade_date”: “2023-03-28”,
“transaction_type”: “BUY”,
“scrip_name”: “RELIANCE”,
“strike_price”: “0.0”,
“expiry”: “”,
“price”: 2252.35,
“isin”: “INE002A01018”,
“symbol”: “RELIANCE”,
“instrument_token”: “NSE_EQ|INE002A01018”
}
],

With the following description,

Query Parameters

Name Required Type Description
segment false string Segment for which data is requested can be from the following options, If not provide, will consider all the segment.
EQ - Equity
FO - Futures and Options
COM - Commodity
CD - Currency Derivatives
MF - Mutual funds

This is correct implementation.

This also proves that there is uniformity among the UPSTOX API… that points either the software development system is broken and too person dependent. This is evidenced from my previous posts too… lack of standardization , lack of data type alignment and lack of uniformity in Key names.

Regards
Rathnadhar K V