0% found this document useful (0 votes)
20 views

Realtime Technical Specification CM Segment

Uploaded by

DJ Rockwell
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Realtime Technical Specification CM Segment

Uploaded by

DJ Rockwell
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

MARKET FEED

Capital Market (CM)


(LEVEL – 1, LEVEL – 2, LEVEL – 3)

Version: 1.25
Date: 14 June 2024

NSE DATA & ANALYTICS LIMITED


EXCHANGE PLAZA,
PLOT NO. C/1, G BLOCK,
BANDRA-KURLA COMPLEX,
BANDRA (E), MUMBAI 400 051.
INDIA.
© 2009 National Stock Exchange India Limited. All rights reserved.
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

COPYRIGHT NOTICE

All rights reserved. No part of this document may be reproduced or transmitted in


any form and by any means without the prior permission of NSE Data & Analytics
Ltd.

2
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Revision History

Name Description Date


Version 1.0 New Specification Issued 16 October 2012
Correction in
Version 1.1 30 November 2012
ST_COMP_BATCH_HEADER Point no 3
S&P is removed from the indices name
Version 1.2 12 February 2013
Point no 10
Version 1.3 New Index addition 11 March 2014
Version 1.4 New Index addition 28 May 2014
Version 1.5 Addition of 4 New Indices 30 September 2014
Version 1.6 New Index addition 12 June 2015
Version 1.7 Index Name Rebranding 29 September 2015
10 New Indices Addition and Indices
Version 1.8 08 March 2016
Rename Change
Version 1.9 Correction in Broadcast Message 09 January 2018
Version 1.10 Addition of 4 New Indices 31 January 2018
Version 1.11 Index Rename Change 19 March 2018
Change in regular/market lot field size from
CHAR[5] to CHAR[6] in 2 structures 5.7 EOD –
Version 1.12 11 May 2018
Master Addition/ Modification/ Deletion and 5.10
EOD Corporate Action Update
Version 1.13 Index Rename Change 03 July 2018
Version 1.14 Addition of 5 New Indices 04 January 2019
Version 1.15 Index Segregation 30 January 2020
Version 1.16 Addition of 2 New Indices 06 August 2020
Version 1.17 Addition of 2 New Indices 30 September 2020
1. Removed FAO L3 and FAO TBT description
Version 1.18 2. Removed section 2.2 Online Requirements 03 August 2021
3. Addition of 5 New Indices
Removal of TCP/IP Session Initialization, Login
Version 1.19 29 October 2021
Request, Login Response
Added Settlement Cycle field in BOD Master
Version 1.20 21 December 2021
Information
Version 1.21 Addition of 7 new indices 08 January 2022
1. Removal of section 4.3 Online Indices
Information (CX).
Version 1.22 12 March 2024
2. Removal of section 4.10 EOD – Index
Information (CI) and section 9 (Annexure 1).
1. Addition of T+0 Settlement Mechanism
Version 1.23 2. Merger of Level 1, Level 2 & Level 3 20 March 2024
documents.

Version 1.24 FAQ added 04 June 2024

Version 1.25 Adding 6 new fields in BOD - Master Information 14 June 2024

3
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Table of Contents
1 Introduction .............................................................................................. 6
2 Packet Format ........................................................................................... 8
2.1 Data Types ........................................................................................... 9
2.2 Diagrammatic Representation of Packet Format ........................................ 10
3 Session Messages ..................................................................................... 11
3.1 Heartbeat Message (Sent by server) ....................................................... 11
4 Sequenced Data Message (Sent by server) ................................................... 12
4.1 BOD - Master Information ..................................................................... 12
4.2 Online - Market Status Message ............................................................. 15
4.3 Online – Touchline Market Update........................................................... 16
4.4 Online – 5 Depth Market Update ............................................................. 18
4.5 Online – 20 Depth Market update ........................................................... 21
4.6 Online - Call Auction Market Security Update ............................................ 25
4.6.1 Call Auction Market (Call Auction 1) ..................................................... 25
4.6.2 Reserved Market (Call Auction 2) ......................................................... 25
4.6.3 Call Auction 1 & 2 (Touchline Market Update) ........................................ 25
4.6.4 Call Auction 1 & 2 (5 Depth Market Update) .......................................... 28
4.7 Online - Broadcast Message ................................................................... 32
4.8 EOD – Market Statistics (Bhavcopy) ........................................................ 33
4.9 EOD – Master Addition/Modification/Deletion ............................................ 34
4.10 EOD – Corporate Action Update ............................................................ 35
4.11 BOD & EOD Checksum Information ....................................................... 36
4.12 EOD – End of Feed Information ............................................................ 37
5 Steps for Decompressing the Data Packets ................................................... 38
5.1 LZO Algorithm Details ........................................................................... 38
5.2 Files required for LZO algorithm ............................................................. 38
5.3 Decompression steps ............................................................................ 38
6 Checksum Calculation Algorithm ................................................................. 40
7 Notes ..................................................................................................... 41
7.1 Normal Market Session ......................................................................... 41
7.2 Auction Market Session ......................................................................... 41
7.3 Pre-Open Session................................................................................. 41
7.4 Call Auction Session 1........................................................................... 42

4
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

7.5 Call Auction Session 2........................................................................... 42


7.6 Buy Back Flag & Market Maker (BBMM Flag) ............................................. 42
8 Acronyms Used ........................................................................................ 44
9 FAQs ...................................................................................................... 45
10 Support Information................................................................................ 48

5
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Market Feed – Capital Market (Level 1, Level 2 & Level 3)

1 Introduction

NSE Data & Analytics Ltd. disseminates NSEIL’s real time broadcast data to
various information agencies. It provides 6 different types of data products viz.

1. Real Time Data


2. Snapshot Data
3. End of Day Data
4. Corporate Data
5. Historical Data
6. Analytical Products data

The real time data and corporate data is a packet broadcast available for
dissemination through feed, whereas the snapshot data, end of day data and
historical data is available in the form of files. All these data products come
under in Infofeed application.

6
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

In Infofeed’s Real Time Data product following sub-products are available

a. Market Feed (CM/FO/CD/SLBM/WDM/CBRICS/COM Level 1)


b. Market Feed (CM/FO/CD/SLBM/COM Level 2)
c. Market Feed (CM Level 3)
d. Index Feed
e. NSEMD (CM/CD)

This document explains the NSE – Market Feed (CM Level 1, Level 2 & Level
3) products. Through this product on a real-time basis all the NSE’s market
update information is disseminated.
The information agencies connect to the Market Feed Server through Leased
Lines. These leased lines are terminated on Infofeed Router and their data
specific pneumonic calls are forwarded to Infofeed server.
The feed consists of series of sequenced and unsequenced variable length
compressed messages. The compression algorithm used over here is LZO –
Compression.

7
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

2 Packet Format

Server sends all the packets in following format.

typedef struct
{
CHAR cCompOrNot;
SHORT nDataSize;
SHORT iNoOfPackets;
}ST_COMP_BATCH_HEADER;

typedef struct
{
SHORT iCode;
SHORT iLen;
LONG lSeqNo;
} ST_INFO_HEADER;

typedef struct
{
.
.
}ST_DATA_INFO;

typedef struct
{
SHORT iCheckSum;
CHAR cEOT;
} ST_INFO_TRAILER;

typedef struct
{
ST_INFO_HEADER stInfoHdr;
ST_DATA_INFO stDataInfo;
ST_INFO_TRAILER stInfoTrailer;
.
}ST_DATA_PACKET;

8
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

All the packets received from server consist of compress batch header.
Compress batch header gives the information about the data packet
compressed or not, number of packets in the following data packet and the
total size of data packet. Client needs to decompress the data packet using
LZO decompression algorithm. After decompression each data packet consists
of ST_INFO_HEADER, which has the iCode field to identify the type of the
packet. Using iCode field, data info packet is mapped to the respective data
packet.

2.1 Data Types

Data types used in feed:

Data Type Size In Bytes


CHAR 1
SHORT 2
INT 4
LONG 4
DOUBLE 8

Byte order - Big Endian

9
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

2.2 Diagrammatic Representation of Packet Format

Compressed Header

1. Compressed/ Uncompressed = 0 then compressed/ 1 uncompressed

2. Number of packets = Number of records in compressed data

3. Data Size = Compressed data size

As the data packets are sent in compressed format there is a need to


decompress them. The compression algorithm used is LZO.

10
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

3 Session Messages

3.1 Heartbeat Message (Sent by server)

Heartbeat message will be sent every 2 seconds if data is not available.

Field Name Data Type Value Remark


INFO HEADER
Code SHORT ‘CH’
Size of (INFO HEADER
Length SHORT Numeric + INFO DATA + INFO
TRAILER)

0(Zero) for heartbeat


Sequence Number LONG Numeric
message
INFO DATA
Not associated with any data
INFO TRAILER
Refer to section checksum
calculation
Checksum SHORT Numeric Checksum is not
calculated, so it is sent as 0
(Zero)
End Of Trailer CHAR [1] ‘\r’ Carriage Return

11
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4 Sequenced Data Message (Sent by server)

Sequenced data messages will be sent by server and will contain the actual market
data.

4.1 BOD - Master Information

These packets are sent at the beginning of each trading day before market open.
This feed contains the information about the securities valid in the CM Market for
trading.

Field Name Data Type Value Remark


INFO HEADER

Code SHORT ‘CT’

Size of (INFO HEADER


Length SHORT Numeric + INFO DATA + INFO
TRAILER)
Application sequence
Sequence Number LONG Numeric
number
INFO DATA

Unique identifier for the


Token Number CHAR [10] Character
securities listed on NSE.

Symbol CHAR [10] Character Security symbol

Series CHAR [2] Character Series

An International
Securities Identification
ISIN Number CHAR [12] Character
Number (ISIN) uniquely
identifies a security

‘Y’ = Deleted
Is Deleted CHAR [1] Character
‘N’ = Not Deleted

Minimum price at which


order can be placed
Low Price Range CHAR [10] Character
without causing a price
freeze

Maximum price at which


order can be placed
High Price range CHAR [10] Character
without causing a price
freeze

12
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Refer the table given


ST_SECURITY_EL
Security Eligibility below
IGIBILITY_PER_ Structure
Per Market ST_SECURITY_ELIGIBILITY_
MARKET [6]
PER_MARKET and FAQ

Value can be 0 or 1
0 = T+0 will be the
settlement Period for
Settlement cycle SHORT Numeric that security
1 = T+1 will be the
settlement Period for
that security
Security Description CHAR [30] Character Security Name

Regular Lot CHAR [6] Character Lot Size

Tick Size CHAR [6] Character Security tick size


Face Value CHAR [9] Character Security face value
Issue Capital CHAR [12] Character Security issued capital
This is used as identifier
for different market
securities.
1 - Normal Market
security.
2 – IPO Session is being
SSEC SHORT Numeric
held security.
3 – Relist Session is
being held security.
4 – Call Aution2 market
security.
5 - SME security.
INFO TRAILER
Refer to section
Checksum SHORT Numeric
checksum calculation
End Of Trailer CHAR [1] ‘\r’ Carriage Return

13
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

ST_SECURITY_ELIGIBILITY_PER_MARKET

Field Name Data Type Value Remark


ST_SECURITY_ELIGIBILITY_PER_MARKET
‘N’ = Normal
‘O’ = Odd Lot
‘S’ = Spot
Market Type CHAR [1] Character
‘A’ = Auction
‘C’ = Call Auction
‘G’ = Call Auction 2

‘1’ = Allowed to trade


Eligibility CHAR [1] Character
‘0’ = Not allowed to trade

‘1’ = Open
Security Status CHAR [1] Character
‘0’ = Suspended

14
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4.2 Online - Market Status Message

This message is sent by the server, whenever the market status changes.

Field Name Data Type Value Remark


INFO HEADER
‘PO’ = Pre-open / Call
Auction session start
‘PC’ = Pre-open / Call
‘PO’ Auction session end
‘PC’ ‘CO’ = Normal market
‘CO’ open
Code SHORT
‘CC’ ‘CC’ = Normal market
‘CK’ close
‘CL’ ‘CK’ = Post close session
start
‘CL’ = Post close session
end
Size of (INFO HEADER
Length SHORT Numeric + INFO DATA + INFO
TRAILER)
Application sequence
Sequence Number LONG Numeric
number
INFO DATA
‘N’ = Normal
‘O’ = Odd Lot
‘S’ = Spot
Market Type CHAR [1] Character
‘A’ = Auction
‘C’ = Call Auction
‘G’ = Call Auction 2
INFO TRAILER
Refer to section
checksum calculation
Checksum SHORT Numeric Checksum is not
calculated, so it is sent
as 0(Zero)
End Of Trailer CHAR [1] ‘\r’ Carriage Return

15
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4.3 Online – Touchline Market Update

NSE securities update information for pre-open and normal market is sent through
this Message.

This market update is available only in level 1 feed.

Field Name Data Type Value Remark


INFO HEADER
‘PN’ = Pre-open session
‘PN’ updates
Code SHORT
‘CN’ ‘CN’ = Normal market
Updates
Size of (INFO HEADER
Length SHORT Numeric + INFO DATA + INFO
TRAILER)
Application sequence
Sequence Number LONG Numeric
Number
INFO DATA
Symbol CHAR [10] Character Symbol of the security
Series CHAR [2] Character Series
‘N’ = Normal
‘O’ = Odd Lot
Market Type CHAR [1] Character
‘S’ = Spot
’A’ = Auction

No. of seconds from 01-


Timestamp CHAR [11] Character 01-1970 00:00:00
(DD-MM-YYYY
HH:MM:SS)

Best buy side’s


Best Buy-Order price CHAR [10] Character
outstanding order price

Best buy side’s


Best Buy-Order
CHAR [12] Character outstanding order
Quantity
quantity
Best Sell side’s
Best Sell-Order price CHAR [10] Character
outstanding order price
Best Sell side’s
Best Sell-Order
CHAR [12] Character outstanding order
quantity
quantity

16
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Price of the last trade


happened on the
security if no trade has
Last Traded
CHAR [10] Character happened for the day,
Price (LTP)
then previous day’s
trade price is taken or
the base price is taken

Total Traded
CHAR [12] Character Volume traded today
Quantity (TTQ)

‘S’ = Suspended
Security Status CHAR [1] Character
‘ ‘ = Non-suspended
Open price of the
security for the day.
In pre-open session the
Opening Price CHAR [10] Character indicative open price is
sent if security is
available in pre- open
session.
High price of the
High Price CHAR [10] Character
security for the day
Low price of the
Low Price CHAR [10] Character
security for the day
Close price of the
security.
During the day previous
day’s close price is sent.
Close Price CHAR [10] Character
After market close
current day’s close
price is calculated and
sent through this field
Weighted average price
Average Trade Price CHAR [10] Character of the security
i.e. value / quantity
Security traded value
Total Turnover CHAR [25] Character i.e. Average Trade
Price * TTQ
Online Index CHAR [8] Character NIFTY 50 index value
INFO TRAILER
Refer to section
Checksum SHORT Numeric
checksum calculation
End Of Trailer CHAR [1] ‘\r’ Carriage Return

17
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4.4 Online – 5 Depth Market Update

NSE securities update information for pre-open and normal market is sent through
this Message.

This 5 Depth market update is available in level 2 and level 3 feed.

Field Name Data Type Value Remark


INFO HEADER
‘PN’ = Pre-open session
‘PN’ updates
Code SHORT
‘CN’ ‘CN’ = Normal market
updates
Size of (INFO HEADER
Length SHORT Numeric + INFO DATA + INFO
TRAILER)
Application sequence
Sequence Number LONG Numeric
number
INFO DATA

Symbol CHAR [10] Character Symbol of the security

Series CHAR [2] Character Series

‘N’ = Normal
‘O’ = Odd Lot
Market Type CHAR [1] Character
‘S’ = Spot
‘A’ = Auction

No. of seconds from 01-


01-1970 00:00:00
Timestamp CHAR [11] Character
(DD-MM-YYYY
HH:MM:SS)

Refer the table given


5 Depth Buy Order MARKET_DEPTH_BUY below
Structure
details _ORDER_INFO [5] MARKET_DEPTH_BUY_
ORDER_INFO

Refer the table given


5 Depth Sell Order MARKET_DEPTH_SELL below
Structure
details _ORDER_INFO [5] MARKET_DEPTH_SELL_
ORDER_INFO

18
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Price of the last trade


happened on the
security.
Last Traded Price If no trade has
CHAR [10] Character
(LTP) happened for the day,
then previous day’s
trade price is taken or
the base price is taken.

Quantity of the last


trade happened on the
security.
Last Traded If no trade has
CHAR [12] Character
Quantity happened for the day,
then previous day’s
trade quantity is taken
or zero is sent
Total Traded
CHAR [12] Character Volume traded today
Quantity (TTQ)
‘S’ = Suspended
Security Status CHAR [1] Character
‘ ‘ = Non-suspended

Open price of the


security for the day.
In pre-open session the
Opening Price CHAR [10] Character indicative open price is
sent if security is
available in pre- open
session.

High price of the


High Price CHAR [10] Character
security for the day
Low price of the
Low Price CHAR [10] Character
security for the day
Close price of the
security.
During the day previous
Close Price CHAR [10] Character day’s close price is sent.
After market close
current day’s close price
is calculated
Weighted average price
Average Trade
CHAR [10] Character of the security
Price
i.e. value / quantity

19
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Total quantity of the


Total Buy Quantity CHAR [12] Character outstanding orders
available on buy side
Total quantity of the
Total Sell Quantity CHAR [12] Character outstanding orders
available on sell side
Security traded value
Total Turnover CHAR [25] Character i.e. Average Trade
Price * TTQ

Online Index CHAR [8] Character NIFTY 50 index value

INFO TRAILER
Refer to section
Checksum SHORT Numeric
checksum calculation

End Of Trailer CHAR [1] ‘\r’ Carriage Return

20
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4.5 Online – 20 Depth Market update

These packets contain the latest order and trade information of securities up to the
order book depth of 20. These packets are sent during normal market hours. These
packets would not be sent during the Pre-Open session.

The Online Index field in this packet indicates the value of the Nifty 50 when the
trade occurs.

This 20 Depth Market Update is available only in level 3 feed.

Field Name Data Type Value Remark


INFO HEADER

Code SHORT ‘CV’

Size of (INFO HEADER


Length SHORT Numeric + INFO DATA + INFO
TRAILER)
Application sequence
Sequence Number LONG Numeric
number
INFO DATA
Symbol CHAR [10] Character Symbol of the security

Series CHAR [2] Character Series

‘N’ = Normal
‘O’ = Odd Lot
Market Type CHAR [1] Character
‘S’ = Spot
’A’ = Auction
No. of seconds from
Timestamp CHAR [11] Character 01-01-1970 00:00:00
(DD-MM-YYYY
HH:MM:SS)

Refer the table given


MARKET_DEPT
20 Depth Buy order below
H_BUY_ORDE Structure
details MARKET_DEPTH_BUY_
R_INFO [20]
ORDER_INFO

21
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Refer the table given


MARKET_DEPT
20 Depth Sell order below
H_SELL_ORDE Structure
details MARKET_DEPTH_SELL
R_INFO [20]
_ORDER_INFO

Price of the last trade


happened on the
security.
If no trade has
Last Traded Price
CHAR [10] Character happened for the day,
(LTP)
then previous day’s
trade price is taken or
the base price is
taken
The quantity of the
last trade happened
on the security.
If no trade has
Last Traded Quantity CHAR [12] Character
happened for the day,
then previous day’s
trade quantity is taken
or zero is sent
Total Traded
CHAR [12] Character Volume traded today
Quantity (TTQ)

‘S’ = Suspended
Security Status CHAR [1] Character
‘ ‘ = Non-suspended

Open price of the


security for the day.
In pre-open session
Opening Price CHAR [10] Character the indicative open
price is sent if security
is available in pre-
open session
High price of the
High Price CHAR [10] Character
security for the day
Low price of the
Low Price CHAR [10] Character
security for the day

22
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Close price of the


security.
During the day
previous day’s close
Close Price CHAR [10] Character price is sent.
After market close
current day’s close
price is calculated and
sent through this field
Weighted average
Average Trade Price CHAR [10] Character price of the security.
i.e. value / quantity
Total quantity of the
Total Buy Quantity CHAR [12] Character outstanding orders
available on buy side
Total quantity of the
Total Sell Quantity CHAR [12] Character outstanding orders
available on sell side
Security traded value
Total Turnover CHAR [25] Character i.e. Average Trade
Price * TTQ
Online Index CHAR [8] Character NIFTY 50 index value
INFO TRAILER
Refer to section
Checksum SHORT Numeric
checksum calculation
End Of Trailer CHAR [1] ‘\r’ Carriage Return

23
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

MARKET_DEPTH_BUY_ORDER_INFO

Field Name Data Type Value Remark


MARKET_DEPTH_BUY_ORDER_INFO
Best 5 or 20 buy side’s
outstanding orders price and
Best Buy-Order quantity information
CHAR [10] Character
price In the case of PN packets the
best 4 buy side’s
outstanding orders price and
quantity information is sent.
Best Buy-Order In the 5th price and quantity
CHAR [12] Character
Quantity field buy side’s ATO orders
information is sent.

MARKET_DEPTH_SELL_ORDER_INFO

Field Name Data Type Value Remark


MARKET_DEPTH_SELL_ORDER_INFO
Best 5 or 20 sell side’s
outstanding orders price and
Best Sell-Order quantity information
CHAR [10] Character
price

In the case of PN packets


best 4 sell side’s
outstanding orders price
and quantity information is
Best Sell-Order sent.
CHAR [12] Character
quantity
In the 5th price and quantity
field sell side’s ATO orders
information is sent.

24
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4.6 Online - Call Auction Market Security Update

Two new market types, Call Auction and Reserved (for future use) are introduced in
the capital market trading system. These markets securities update information is
sent through these messages.

4.6.1 Call Auction Market (Call Auction 1)

SME (Small & Medium Enterprise) securities call auction session is conducted in
this market type. For detailed explanation please refer to section Call Auction 1.

4.6.2 Reserved Market (Call Auction 2)

IPO, Relisting & illiquid securities call auction session is conducted in this market
type. For detailed explanation please refer to section Call Auction 2.

4.6.3 Call Auction 1 & 2 (Touchline Market Update)

Field Name Data Type Value Remark


INFO HEADER
Code SHORT ‘SN’
Size of (INFO HEADER
Length SHORT Numeric + INFO DATA + INFO
TRAILER)
Application sequence
Sequence Number LONG Numeric
Number
INFO DATA
Symbol CHAR [10] Character Symbol of the security
Series CHAR [2] Character Series
‘C’ = Call Auction
Market Type CHAR [1] Character
‘G’ = Call Auction 2
No. of seconds from
01-01-1970 00:00:00
Timestamp CHAR [11] Character
(DD-MM-YYYY
HH:MM:SS)
Best buy side’s
Best Buy-Order price CHAR [10] Character outstanding order
Price
Best buy side’s
Best Buy-Order
CHAR [12] Character outstanding order
Quantity
Quantity
Refer to section
Buy BBMM Flag CHAR [1] Character
BBMM Flag

25
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Best Sell side’s


Best Sell-Order price CHAR [10] Character outstanding order
Price
Best Sell side’s
Best Sell-Order
CHAR [12] Character outstanding order
quantity
Quantity
Refer to section
Sell BBMM Flag CHAR [1] Character
BBMM Flag

During order collection


Last Traded Price as well as during
CHAR [10] Character
(LTP) matching, it contains
LTP of the security

This field contains the


Total Traded total quantity of a
CHAR [12] Character
Quantity (TTQ) security traded on the
current day
During order collection
Indicative Traded period this field will
CHAR [12] Character
Quantity contain Indicative
Equilibrium Quantity

‘S’ = Suspended
Security Status CHAR [1] Character
‘ ‘ = Non-suspended
This field contains the
indicative opening
price (IOP) of a
security for order
Opening Price CHAR [10] Character
collection period
session and Final Open
Price of a security in
matching period

During order collection


period it will always be
High Price CHAR [10] Character
zero. Once matching
starts it will be updated

During order collection


period it will always be
Low Price CHAR [10] Character
zero. Once matching
starts it will be updated

26
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

This field contains the


Close Price CHAR [10] Character Closing price of a
security
Weighted average
price of the security
i.e. value / quantity
During order collection
Average Trade Price CHAR [10] Character period it will always be
zero. Once matching
starts it will contain the
Average Trade
Price
During first call auction
order collection period
this field will be zero
Once matching starts
it will contain the First
Trade Price.
First Open Price CHAR [10] Character Once updated for all
subsequent call
auctions it will not
change.
This field may remain
zero till the first trade
happens
During the order
collection period it will
Total Turnover CHAR [25] Character always be zero. Once
matching
starts it will be updated
INFO TRAILER
Refer to section
Checksum SHORT Numeric
checksum calculation
End Of Trailer CHAR [1] ‘\r’ Carriage Return

27
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4.6.4 Call Auction 1 & 2 (5 Depth Market Update)

This 5 Depth market update is available in level 2 and level 3 feed.

Field Name Data Type Value Remark


INFO HEADER
Code SHORT ‘SN’
Size of (INFO HEADER
Length SHORT Numeric + INFO DATA + INFO
TRAILER)
Application sequence
Sequence Number LONG Numeric
number
INFO DATA
Symbol CHAR [10] Character Symbol of the security
Series CHAR [2] Character Series
‘C’ = Call Auction
Market Type CHAR [1] Character
‘G’ = Call Auction 2
No. of seconds from
01-01-1970 00:00:00
Timestamp CHAR [11] Character
(DD-MM-YYYY
HH:MM:SS)
Refer the table given
MARKET_DEPT below
5 Depth Buy order
H_BUY_ORDER Structure MARKET_DEPTH_AUC
details
_INFO [5] TION_BUY_ORDER_IN
FO[5]
Refer the table given
MARKET_DEPT below
5 Depth Sell order
H_SELL_ORDE Structure MARKET_DEPTH_AUC
details
R_INFO [5] TION_SELL_ORDER_I
NFO[5]
Buy BBMM Order Refer to section
CHAR [1] Character
Exists BBMM Flag
Sell BBMM Order Refer to section
CHAR [1] Character
Exists BBMM Flag
During order collection
as well as during
Last Traded
CHAR [10] Character matching it
Price (LTP)
contains LTP of the
security

28
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

During order collection


as well as during
matching, it contains
Last Traded Quantity CHAR 12] Character
the quantity at which
the last trade took
place in a security
This field contains the
Total Traded total quantity of a
CHAR [12] Character
Quantity (TTQ) security traded on the
current day
During order collection
Indicative Traded period this field will
CHAR [12] Character
Quantity contain Indicative
Equilibrium Quantity
‘S’ = Suspended
Security Status CHAR [1] Character
‘ ‘ = Non-suspended

This field contains the


indicative opening price
(IOP) of a security for
Opening Price CHAR [10] Character order collection period
session and Final Open
Price of a security in
matching period

During the order


collection period it will
High Price CHAR [10] Character always be zero. Once
matching starts it will
be updated

During the order


collection period it will
Low Price CHAR [10] Character always be zero. Once
matching starts it will
be updated

This field contains the


Close Price CHAR [10] Character closing price of a
security

29
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Weighted average price


of the security.
i.e. value / quantity

During the order


Average Trade Price CHAR [10] Character collection period it will
always be zero. Once
matching starts it will
contain the Average
Trade
Price
During first call auction
order collection period
this field will be zero
Once matching starts
it will contain the First
Trade Price.
First Open Price CHAR [10] Character Once updated for all
subsequent call
auctions it will not
change.
This field may contain
zero until the first trade
happens
This field contains the
Total Buy Quantity CHAR [12] Character total quantity of buy
orders in a security
This field contains the
Total Sell Quantity CHAR [12] Character total quantity of sell
orders in a security
During the order
collection period it will
Total Turnover CHAR [25] Character always be zero. Once
matching
starts it will be updated
INFO TRAILER
Refer to section
Checksum SHORT Numeric
checksum calculation
End Of Trailer CHAR [1] ‘\r’ Carriage Return

30
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

MARKET_DEPTH_AUCTION_BUY_ORDER_INFO[5]
Field Name Data Type Value Remark
MARKET_DEPTH_AUCTION_SELL_ORDER_INFO[5]
Best 5 buy side’s
outstanding orders price,
Best Buy-Order quantity & BBMM flag
CHAR [10] Character
price information.
Refer to section BBMM Flag
In case of Call Auction 1,
best 4 buy side’s
outstanding orders price,
Best Buy-Order quantity & BBMM flag
CHAR [12] Character
Quantity information is sent.
In the 5th price, quantity and
BBMM flag fields buy side’s
ATO orders information is
sent.
Buy BBMM Flag CHAR [1] Character In case of Call auction 2,
best 5 buy side’s
outstanding orders
information is sent

MARKET_DEPTH_AUCTION_SELL_ORDER_INFO[5]
Field Name Data Type Value Remark
MARKET_DEPTH_AUCTION_SELL_ORDER_INFO[5]
Best 5 sell side’s
outstanding orders price,
Best Sell-Order quantity & BBMM flag
CHAR [10] Character
price information.
Refer to section BBMM Flag
In case of Call Auction 1, the
best 4 sell side’s outstanding
orders price, quantity &
Best Sell-Order BBMM flag information is
CHAR [12] Character
Quantity sent.
In the 5th price, quantity and
BBMM flag fields sell side’s
ATO orders information is
sent.
Sell BBMM Flag CHAR [1] Character
In case of Call auction 2,
best 5 sell side’s outstanding
orders information is sent

31
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4.7 Online - Broadcast Message

These packets consist of the messages broadcast during the Trading time containing
information such as changes in the price bands of particular script and market-
related information.

Field Name Data Type Value Remark


INFO HEADER
Code SHORT ‘CB’
Size of (INFO HEADER
Length SHORT Numeric + INFO DATA + INFO
TRAILER)
Application sequence
Sequence Number LONG Numeric
number
INFO DATA
Message Code CHAR [3] Character ‘NSE’
Broadcast Message
Message Length CHAR [3] Character
Length
Message String CHAR [239] Character Broadcast Message
INFO TRAILER
Refer to section
Checksum SHORT Numeric
checksum calculation
End Of Trailer CHAR [1] ‘\r’ Carriage Return

32
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4.8 EOD – Market Statistics (Bhavcopy)

The end of day status of the securities is sent through these messages. After market
close, this information is disseminated to client as the “End of Day” (EOD) feed.

Field Name Data Type Value Remark


INFO HEADER
Code SHORT ‘CS’
Size of (INFO HEADER
+ INFO DATA + INFO
TRAILER) (Variable
Length SHORT Numeric length depending upon
Message Length field
of INFO DATA
structure)
Application sequence
Sequence Number LONG Numeric
number
INFO DATA
Symbol CHAR [10] Character Security symbol
Series CHAR [2] Character Series
‘N’=Normal
‘O’=Odd Lot
‘S’= Spot
Market Type CHAR [1] Character
‘A’=Auction
‘C’=Call Auction
‘G’=Call Auction 2
Security high price for
Trade High Price CHAR [10] Character
the day
Security low price for
Trade Low Price CHAR [10] Character
the day
Security open price for
Opening Price CHAR [10] Character
the day
Security close price for
Closing Price CHAR [10] Character
the day
Security last traded
Last Traded Price CHAR [10] Character
price for the day
Previous Close Security previous
CHAR [10] Character
Price day’s close price
Total Traded Volume traded today
CHAR [12] Character
Quantity for the security
Total traded value
Total Traded Value CHAR [25] Character
for the security
INFO TRAILER
Refer to section
Checksum SHORT Numeric
checksum calculation
End Of Trailer CHAR [1] ‘\r’ Carriage Return
33
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4.9 EOD – Master Addition/Modification/Deletion

This packet consists of information about addition, modification, or deletion any of


the securities. After market close, this information is disseminated to client as the
“End of Day” (EOD) feed.

Field Name Data Type Value Remark


INFO HEADER
‘CA’ = Security added
‘CA’
‘CM’ = Security
Code SHORT ‘CM’
modified
‘CD’
‘CD’ = Security deleted
Size of (INFO HEADER
+ INFO DATA + INFO
TRAILER) (Variable
Length SHORT Numeric length depending upon
Message Length field of
INFO DATA
structure)
Application sequence
Sequence Number LONG Numeric
number
INFO DATA
Symbol CHAR [10] Character Security symbol
Series CHAR [2] Character Series
Security Description CHAR [30] Character Security Name
Regular Lot CHAR [6] Character Regular Lot
‘N’ = Normal
’O’ = Odd Lot
‘S’ = Spot
Market Type CHAR [1] Character
‘A’ = Auction
‘C’ = Call Auction
‘G’ = Call Auction 2
Tick Size CHAR [6] Character Security tick size
Face Value CHAR [9] Character Security face value
Issue Capital CHAR [12] Character Security issued capital
Market Index ‘Y’ = Yes
CHAR [1] Character
Participation ‘N’ = No
Format:
Last Update Date &
CHAR [20] Character DD-MON-YYYY
Time
HH:MM:SS
INFO TRAILER
Refer to section
Checksum SHORT Numeric
checksum calculation
End Of Trailer CHAR [1] ‘\r’ Carriage Return

34
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4.10 EOD – Corporate Action Update

After market close, this information is disseminated to client as the “End of Day”
(EOD) feed.

Field Name Data Type Value Remark


INFO HEADER
Code SHORT ‘CU’
Size of (INFO HEADER
+ INFO DATA + INFO
TRAILER) (Variable
Length SHORT Numeric length depending upon
Message Length field
of INFO DATA
structure)
Application sequence
Sequence Number LONG Numeric
number
INFO DATA
Symbol CHAR [10] Character Security symbol
Series CHAR [2] Character Series
‘0’ = Equities
‘1’ = Preference Shares
‘2’ = Debentures
Instrument Type CHAR [1] Character
‘3’ = Warrants
‘4’ = Miscellaneous
‘5’ = Others
Issue Capital CHAR [12] Character Security Issue Capital
Face Value CHAR [9] Character Security Face value
Market Lot CHAR [6] Character Security market lot
Dividend/Interest Dividend/Interest
CHAR [6] Character
Rate Rate
Format:
Record Date CHAR [10] Character
YYYY-MM-DD
Book Closure Start Format:
CHAR [10] Character
Date YYYY-MM-DD
Book Closure End Format:
CHAR [10] Character
Date YYYY-MM-DD
Format:
Ex-Date CHAR [10] Character
YYYY-MM-DD
No Delivery Start Format:
CHAR [10] Character
Date YYYY-MM-DD
No Delivery End Format:
CHAR [10] Character
Date YYYY-MM-DD
Dividend CHAR [1] Character ‘D’ or Blank

35
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Rights Flag CHAR [1] Character ‘R’ or Blank


Bonus Flag CHAR [1] Character ‘B’ or Blank
Interest Flag CHAR [1] Character ‘I’ or Blank
AGM Flag CHAR [1] Character ‘A’ or Blank
EGM Flag CHAR [1] Character ‘E’ or Blank
Others Flag CHAR [1] Character ‘O’ or Blank
‘B’ =Book Closure
Corp Data Type CHAR [1] Character ‘R’=Record Date,
’N’=None
Corp Action Corp Action
CHAR [25] Character
Description Description
INFO TRAILER
Refer to section
Checksum SHORT Numeric
checksum calculation
End Of Trailer CHAR [1] ‘\r’ Carriage Return

4.11 BOD & EOD Checksum Information

This message gives the information about the number of messages (i.e. count)
sent for each BOD & EOD message. This message will be sent multiple times in
a day. (i.e. After complete dissemination of any BOD/ EOD messages this
message will be sent.)

Field Name Data Type Value Remark


INFO HEADER
Code SHORT ‘CZ’
Size of (INFO HEADER
+ INFO DATA + INFO
TRAILER) (Variable
Length SHORT Numeric length depending upon
Message Length field
of INFO DATA
structure)
Application sequence
Sequence Number LONG Numeric
number
INFO DATA
Message code for
‘CT’/‘CA’/‘CM’/
Data Code SHORT which the count is
‘CD’/‘CS’/‘CU’
sent
Message count for the
Messages Count CHAR [10] Character
Data Code
INFO TRAILER

36
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

Refer to section
checksum calculation
Checksum SHORT Numeric Checksum is not
calculated, so it is
sent as 0(Zero)
End Of Trailer CHAR [1] ‘\r’ Carriage Return

4.12 EOD – End of Feed Information

This end of the packet indicates that all the parts of EOD feed have been
completed. Only once this message is sent through the Feed. After receiving this
message clients can stop their application i.e. no new update information will be
disseminated from the server.

Field Name Data Type Value Remark


INFO HEADER
Code SHORT ‘CE’
Size of (INFO HEADER
+ INFO DATA + INFO
TRAILER) (Variable
Length SHORT Numeric length depending upon
Message Length field of
INFO DATA
structure)
Application sequence
Sequence Number LONG Numeric
number
INFO DATA
Not associated with any data
INFO TRAILER
Refer to section
checksum calculation
Checksum SHORT Numeric Checksum is not
calculated, so it is sent
as 0 (Zero)
End Of Trailer CHAR [1] ‘\r’ Carriage Return

37
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

5 Steps for Decompressing the Data Packets

5.1 LZO Algorithm Details

The LZO stands for Lempel Ziv Oberhaumer. It is a data compression library which
is suitable for data Decompression in real-time. This means it favors speed over
compression ratio.
LZO is written in ANSI C. Both the source code and the compressed data format
are designed to be portable across platforms. This algorithm is freely available on
the internet (URL: https://www.oberhumer.com/opensource/lzo/). It is made
available by free software foundation. The algorithm is tested on various
operating systems like UNIX and Red Hat Linux.

LZO implements several algorithms with the following features.


• Decompression is simple and *very* fast.
• Requires no memory for decompression.
• Requires 64 KB of memory for compression.
• Allows you to dial up extra compression at a speed cost in the
compressor.
• The speed of the decompression is not reduced.
• Includes compression levels for generating pre-compressed data which
achieve a quite competitive compression ratio.
• There is also a compression level which needs only 8 KB for
Compression.
• The algorithm is thread safe.
• Algorithms are lossless.
• LZO supports overlapping compression and in-place decompression.

5.2 Files required for LZO algorithm

• Include files, source files (src) provided by LZO.


• LZO.lib
• LZO library version used is 1.0.7.

5.3 Decompression steps

Receive the packet in the temporary buffer i.e. array of characters.

The first field is compressed or decompressed.


The second field is the number of packets in the following data packet.
The third field is data packet length.

Use the following function of LZO to Decompress.

r = lzo1z_decompress ((lzo_byte*)cInputBuf, ipLength,


(lzo_byte*)cOutputBuf, (lzo_uint*)&opLength, NULL);

38
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

lzo1z_decompress: Function which decompresses the data packet received.


cInputBuf: Input buffer in which compressed data is received.
ipLength: The length of the packet which application has received using
Receive ().
cOutputBuf: The uncompressed output data which is result of decompression.
opLength: Length of uncompressed data
After decompression data will be available in Output Buffer.

Each output data packet contains the INFO HEADER, after mapping the output
decompressed buffer to INFO HEADER find out the data packet and according
to it map the output buffer to respective data packet.

Algorithm:

ST_NIFO_HEADER *pstInfoHeader;

for (i=0; i < iNoOfPackets; i++) // iNoOfPackets received in


// compressed data header
{
pstInfoHeader = (ST_NIFO_HEADER *) cOutputBuf

switch (pstInfoHeader->iCode)
{
case CB: //Broadcast Message
{
ST_INDEX_DATA *stIndexData = (ST_INDEX_DATA *)cOutputBuf;
.
.
cOutputBuf = cOutputBuf +
sizeof(ST_INDEX_DATA); break;
}
}
}

39
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

6 Checksum Calculation Algorithm


The Checksum routine followed for Info Vendor Feed is as follows:

// Following is the defines for checksum calculation

#define DC1 17
#define DC3 19
#define CR 13
#define LF 10
#define POLY 0x1021

// End of defines
unsigned check_sum (cData, iLength)
char *cData ;
int iLength;
{
unsigned uAccum = 0;
unsigned uData;
unsigned char ucChk[2];
int i,j;
for (i=0;i<iLength;i++)
{
uData = *(cData+i);
uData <<= 8;
for(j=8; j>0 ;j--)
{
if((uData^uAccum)&0x8000)
uAccum=(uAccum<<1)^POLY;
/* SHIFT AND SUBTRACT POLY */
else
uAccum<<=1;
uData<<=1;
}
}

ucChk[0] = uAccum>>8;
if (ucChk[0] == DC1 || ucChk[0] == DC3 || ucChk[0] == CR || ucChk[0] == LF )
ucChk[0] -= 1;
ucChk[1] = uAccum&0xFF;
if (ucChk[1] == DC1 || ucChk[1] == DC3 || ucChk[1] == CR || ucChk[1] == LF )
ucChk[1] -= 1;
uAccum = ucChk[1];
uAccum = (uAccum<<8) + ucChk[0];

return(uAccum);
}

40
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

7 Notes

7.1 Normal Market Session

All orders which are of regular lot size or multiples thereof are traded in the
Normal Market. Normal market consists of various book types of wherein orders
are segregated as Regular lot orders, Special Term orders, Negotiated Trade
Orders and Stop Loss orders depending on their order attributes.

7.2 Auction Market Session

In the Auction Market, auctions are initiated by the Exchange on behalf of trading
members for settlement related reasons. There are 3 participants in this market.
• Initiator - the party who initiates the auction process is called an initiator.
• Competitor - the party who enters orders on the same side as the initiator.
• Solicitor - the party who enters orders on the opposite side as of the initiator.

In the auction market the Open price and the Last Traded Price would be zero till
the auction ends and the auction price is calculated by the system. Since Auction
in any scrip is done at a fixed price the High Price, Low Price, Closing Price and
Index values is zero for all scrips traded in the Auction Market.

7.3 Pre-Open Session

Pre-open session will be conducted for the Normal Market segment. The session
will be conducted before the normal market start time. Exchange may decide to
allow all or selective securities in pre-open session. During the Pre-open session,
only order entry, orders modification and order cancellation will be allowed. Once
the pre-open session ends, no order activity will be allowed and the final open
price (i.e. equilibrium price based on accumulated buy and sell orders) will be
computed. Pre-open orders will be matched at this final open price resulting in
trade execution. Pre-open orders that could not participate in the pre-open
matching for reasons such as a demand-supply gap, order price worse than the
equilibrium price etc. shall be carried forward to the normal market. The time
priority of such orders shall be retained.

In the above context NSE – Market Feed (Level 1, Level 2 & Level 3) product
sends messages in the following sequence.
1. Pre-open session start (PO) – market type ‘N’
2. Security Update Information (PN) – Indicative open price in open price field
3. Pre-open session end (PC) - market type ‘N’

41
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

4. Security Update Information (PN) – Derived final open price in open price
field and current security information
5. Normal Market open (CO) - market type ‘N’
6. Security Update Information (CN) – With current security
7. Normal Market Close (CC) - market type ‘N’

7.4 Call Auction Session 1

SME (small and medium enterprises) securities call auction is done through this
session. It is similar to the pre-open session. Multiple sessions of this can be held
on a trading day. Market type for this session is ‘C’

In the above context NSE – Market Feed (Level 1, Level 2 & Level 3) product
sends messages in the following sequence in one call auction session.
1. Pre-open session start (PO) – market type ‘C’
2. Call Auction Security Update Information (SN) – Indicative open price in open
price field.
3. Pre-open session end (PC) - market type ‘C’
4. Security Update Information (SN) – Derived final open price in open price field
and current security information

7.5 Call Auction Session 2

IPO, Relisting, and illiquid securities call auction is done through this session. It
is similar to the pre-open session. Multiple sessions of this can be held in a trading
day. The market type for this session is ‘G’. IPO/Relisted securities get transferred
to normal market session after deriving the open.

In the above context NSE – Market Feed (Level 1, Level 2 & Level 3) product
sends messages in the following sequence in one call auction session.
1. Pre-open session start (PO) – market type ‘G’
Call Auction Security Update Information (SN) – Indicative open price in open
price field.
2. Pre-open session end (PC) - market type ‘G’
Security Update Information (SN) – Derived final open price in open price field
and current security information

7.6 Buy Back Flag & Market Maker (BBMM Flag)

In call auction session 1 & 2 the buy back and market maker orders are allowed.
To identify the buy back or market maker orders BBMM flag is sent in

42
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

the SN messages. For the probable values of BBMM flag refer the table given
below
1. BuyBBMMOrderExists: Buy Back or Market Maker order exists at buy side but
not in top five price points.
2. SellBBMMOrderExists: Buy Back or Market Maker order exist at sell side but
not in top five price points.
3. Sell BBMM Flag: Buy Back or Market Maker order at that price point.
4. Buy BBMM Flag: Buy Back or Market Maker order at that price point.

Buy Back Order Exists Market Maker Order Exists BuyBBMMOrderExists/


SellBBMMOrderExists/
Sell BBMM Flag/
Buy BBMM Flag
No No ‘0’
Yes No ‘1’
No Yes ‘2’
Yes Yes ‘3’

E.g. If Buy Back and Market Maker orders exist at particular price point then
the above fields will contain ‘3’.

43
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

8 Acronyms Used

BOD Begin Of Day Information


EOD End Of Day Information
ONLINE Information Sent During Market Timing
CM Cash Market
F&O Future & Options Market
CD Currency Derivatives Market
SLBM Securities Lending & Borrowing Market
WDM Wholesale & Debt Market

44
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

9 FAQs
1) For Sequenced Data Messages, why do fields contain datatype as short, but contain
value is specified as character?
Data sent by server contains number, which is the ASCII value of the field and at
client’s end it needs to be converted from ASCII value into character.

2) How to differentiate between numeric and non-numeric values?


Numeric values are always right aligned and non-numeric values are left aligned. For
instance, even though LTP has a datatype as character, it is distinguished by the
alignment as numeric value is always right aligned.

3) How to decompress a packet and extract data from it?

Follow the steps mentioned below.

• Receive a packet from the feed, and check ST_COMP_BATCH_HEADER's


cCompOrNot to see if the data is compressed or not.
• if the cCompOrNot flag is '0' then the data is compressed so use LZO
Decompress to extract the data. The position of data
would be the difference in position between the received bytes and the
ST_COMP_BATCH_HEADER size.
• if the cCompOrNot flag not '0' then the data is not compressed so just copy
the bytes after the header to get the data.
• Type cast the data above data to ST_INFO_HEADER and get iCode from it.
iCode can be used to identify the type of packet.
• Based on iCode, map the data section into the required structure.
• After the data section, map the trailer ST_INFO_TRAILER to get the
iCheckSum i.e checksum (Refer to section checksum calculation)

4) What is Level 1, Level 2 and Level 3 Data?

The list of market depth is organized by price levels, and it is updated in real-time
to reflect current activity where:
• Level 1 provides the best Bid and best Ask price.
• Level 2 offers up to the best 5 Bids and Asks prices.
• Level 3 market depth offers a view of the best 20 Bids and Asks prices.

45
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

5) What structures are available for level 1, level 2 and level 3 feeds?

Packets Sent Level 1 Level 2 Level 3


3.1 Heartbeat Message ✔️ ✔️ ✔️

4.1 BOD - Master Information ✔️ ✔️ ✔️

4.2 Online - Market Status Message ✔️ ✔️ ✔️

4.3 Online – Touchline Market Update ✔️ - -


4.4 Online – 5 Depth Market Update - ✔️ ✔️

4.5 Online – 20 Depth Market update - - ✔️

4.6.3 Call Auction 1 & 2 (Touchline Market


Update)
✔️ - -
4.6.4 Call Auction 1 & 2 (5 Depth Market Update) - ✔️ ✔️

4.7 Online - Broadcast Message ✔️ ✔️ ✔️

4.8 EOD – Master Addition/Modification/Deletion ✔️ ✔️ ✔️

4.9 EOD – Market Statistics (Bhavcopy) ✔️ ✔️ ✔️

4.10 EOD – Corporate Action Update ✔️ ✔️ ✔️

4.11 BOD & EOD Checksum Information ✔️ ✔️ ✔️

4.12 EOD – End of Feed Information ✔️ ✔️ ✔️

6) How do we interpret Security Eligibility per Market in CT message type and Master
Data security.txt file?

The security.txt file does not populate the market type. It contains 12 fields as
depicted below:

|6|1|2|0|2|0|2|1|1|0|1|0|

There are 12 consecutive fields which indicate Security status and Eligibility for 6
Markets.

In these 12 fields the set of the first 2 fields represents the Normal market and
the set of next 2 fields represent the odd lot market and so on.

The market types are in below orders:


1.Normal Market
2.Odd lot Market
3.Spot Market
4.Auction Market
5.Call Auction1
6.Call Auction2

46
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

In Real Time feed CT packet, we populate Market type separately.


For e.g. N,0,1, O,0,1, S,0,1, A,0,1, C,0,1, G,1,1,

N: Market type, 0: Eligibility, 1: Security status


Here 1 security status belongs to N market type.
O: Market type, 0: Eligibility, 1: Security status
S: Market type, 0: Eligibility, 1: Security status
A: Market type, 0: Eligibility, 1: Security status
C: Market type, 0: Eligibility, 1: Security status
G: Market type, 1: Eligibility, 1: Security status

47
Market Feed - CM (Level 1, Level 2 & Level 3) Specification

10 Support Information
Name Email Contact Number
Business & Technical [email protected] +91-22-26598385
Support

48

You might also like