Hi team,
I am integrating the Upstox V3 Market Data WebSocket feed in a Python backend and I am able to connect successfully, but I only receive heartbeat packets and no market data.
Environment:
-
Python
-
FastAPI backend
-
Upstox V3 Market Data Feed
-
Protobuf decoding using MarketDataFeedV3.proto
Connection flow:
-
Authorize feed
GET https://api.upstox.com/v3/feed/market-data-feed/authorize -
Connect WebSocket
wss://wsfeeder-api.upstox.com/market-data-feeder/v3/… -
Send subscription payload:
{
“guid”: “strikeiq-feed”,
“method”: “sub”,
“data”: {
“mode”: “ltpc”,
“instrumentKeys”: [
“NSE_INDEX|Nifty 50”,
“NSE_INDEX|Nifty Bank”,
“NSE_EQ|INE009A01021”
]
}
}
WebSocket logs:
UPSTOX WS CONNECTED
WS STATE → CONNECTED
READY TO SEND SUBSCRIPTION
SUBSCRIPTION PAYLOAD=3 instruments
WS FRAME RECEIVED
RAW PACKET SIZE = 165
HEARTBEAT PACKET SIZE=165
Expected behaviour:
Market packets larger than ~350 bytes containing protobuf FeedResponse messages.
But currently only heartbeat packets are received.
Questions:
-
Is there a required subscription acknowledgement step in V3?
-
Does Upstox send ticks only when price changes?
-
Is there any minimum delay required before sending the subscription?
-
Are the instrument keys correct for index + equity in LTPC mode?
Code snippet (recv loop):
raw = await websocket.recv()
if isinstance(raw, str):
logger.info(f"CONTROL MESSAGE: {raw}")
continue
packet_size = len(raw)
if packet_size < 200:
logger.info(f"HEARTBEAT PACKET SIZE={packet_size}")
continue
ticks = decode_protobuf_message(raw)
if ticks:
await queue.put(ticks)
Would appreciate any guidance on whether this behaviour is expected or if something is missing in the subscription process.
Thanks!