Skip to content

Market Depth Event

Upon your initial subscription, you will receive a complete packet (delivered as a flat string) on the relevant event channel over the socket. For any subsequent market data events that involve incremental changes, you will receive updates as partial changes in a flat string format. For instance, if there is a change only in the Last Traded Price (LTP), that specific update for the instrument will be sent to you. For full market data events, a complete event message will be broadcast every time. However, for partial market data events, only the relevant partial message will be broadcast each time.

MarketDepth Event message for JSON Full Packet

socket.on("1502-json-full",function(data){
    console.log("data is "+data);
}); 

Response to 1502-json-full response

{
    "Asks": [
        {
            "BuyBackMarketMaker": 0,
            "Price": 12803.75,
            "Size": 50,
            "TotalOrders": 1
        },
        {
            "BuyBackMarketMaker": 0,
            "Price": 12803.8,
            "Size": 50,
            "TotalOrders": 1
        },
        {
            "BuyBackMarketMaker": 0,
            "Price": 12804.25,
            "Size": 50,
            "TotalOrders": 1
        },
        {
            "BuyBackMarketMaker": 0,
            "Price": 12804.95,
            "Size": 50,
            "TotalOrders": 1
        },
        {
            "BuyBackMarketMaker": 0,
            "Price": 12805.0,
            "Size": 50,
            "TotalOrders": 1
        }
    ],
    "Bids": [
        {
            "BuyBackMarketMaker": 0,
            "Price": 12790.15,
            "Size": 50,
            "TotalOrders": 1
        },
        {
            "BuyBackMarketMaker": 0,
            "Price": 12790.1,
            "Size": 50,
            "TotalOrders": 1
        },
        {
            "BuyBackMarketMaker": 0,
            "Price": 12789.8,
            "Size": 50,
            "TotalOrders": 1
        },
        {
            "BuyBackMarketMaker": 0,
            "Price": 12789.2,
            "Size": 50,
            "TotalOrders": 1
        },
        {
            "BuyBackMarketMaker": 0,
            "Price": 12786.65,
            "Size": 50,
            "TotalOrders": 1
        }
    ],
    "ExchangeInstrumentID": 52232,
    "ExchangeSegment": 2,
    "ExchangeTimeStamp": 1714644357,
    "MessageCode": 1502,
    "Touchline": {
        "AskInfo": {
            "BuyBackMarketMaker": 0,
            "Price": 12790.0,
            "Size": 50,
            "TotalOrders": 1
        },
        "AverageTradedPrice": 12750.69,
        "BidInfo": {
            "BuyBackMarketMaker": 0,
            "Price": 12790.0,
            "Size": 50,
            "TotalOrders": 1
        },
        "BuyBackTotalBuy": 0,
        "BuyBackTotalSell": 0,
        "Close": 12964.2,
        "High": 12850.85,
        "LastTradedPrice": 12790.0,
        "LastTradedQuantity": 50,
        "LastTradedTime": 1714644308,
        "LastUpdateTime": 1714644357,
        "Low": 12670.0,
        "Open": 12850.8,
        "PercentageChange": -1.34,
        "TotalBuyQuantity": 8650,
        "TotalSellQuantity": 8500,
        "TotalTradedQuantity": 10850,
        "TotalValueTraded": 138344986.5
    }
}

MarketDepth Event message for JSON Partial Packet

socket.on("1502-json-partial",function(data){
    console.log("data is "+data);
});

Response to 1502-json-partial response

{
    "ai": "0|1|2529.90|1|1|1|2530.15|1|2|1|2530.20|1|3|1|2530.25|1|4|1|2530.30|1",
    "ap": 2532.59,
    "bi": "0|1|2529.65|1|1|1|2529.00|1|2|1|2528.55|1|3|1|2528.45|1|4|1|2528.40|1",
    "c": 2531.8,
    "h": 2546.9,
    "l": 2523.45,
    "ltp": 2530.3,
    "ltq": 1,
    "ltt": 1714645518,
    "lut": 1714645520,
    "o": 2544.0,
    "pc": -0.06,
    "t": "1_22",
    "tb": 48881,
    "ts": 84817,
    "v": 76158,
    "vp": 192876989.22
}

Reference

Symbol Explanation
t ExchangeSegment.ExchangeInstrumentID(exchange segment enum with underscore along with instrumentID of the particular subscribed instrument)
ltp Last traded price
ltq Last traded quantity
tb Total buy quantity
ts Total sell quantity
v The volume is commonly reported as the number of shares that changed hands during a given day.
ap Average Traded Price
ltt Last Traded Time
lut Last Update Time
pc Percent Change
o Open
h High
l Low
c Close
vp Total price volume
ai Ask Info(Ask Size Index + "
bi Bid Info(Bid Size Index+'