Introducing 20-Depth Market Data on DhanHQ Data APIs

Key takeaways:
- 20-Depth Market Data offers Level 3 order book data (20 bid and 20 ask levels per instrument) through real-time WebSockets.
- It is available for both Equity (Cash) and F&O segments.
- You can subscribe to up to 50 instruments at once for 20-depth market data.
- Available on DhanHQ Data APIs using real-time WebSocket streams.
When you are building an algorithmic trading system, the depth of your order book data directly determines the quality of your execution. Many brokers only provide market depth up to 5 levels, which implies that the system is based on the top 5 bid and ask levels. It only provides you with a small window into what is going on in the market. It limits your visibility into broader order flow and liquidity patterns, which often results in slippages.
To solve this, we have introduced 20-Depth Market Data on DhanHQ APIs to provide you access to Level 3 market depth data with up to 20 bid and ask levels for instruments across Equity and F&O segments.
What is 20-Depth Market Data?
While the standard 5-level depth only shows you the top 5 bid and ask prices. The 20-depth market data provides you with real-time access to Level 3 market depth data through WebSockets for up to 50 instruments across Equity and F&O segments.
It enables developers and algo traders like you to get deeper order book data directly within your systems, which allows you to build more informed and data-driven trading systems.
Why does it matter?
A common limitation of 5-level market depth is reduced visibility into broader order flow and liquidity patterns. Thus, by providing you with 20-level market depth data, we help you access broader market signals and build more informed, data-driven trading systems.
See what is building before it moves the price
With 20-depth data, your system can detect large bid or ask stacking at levels beyond 5. This gives your algorithm an edge in identifying liquidity concentrations before they reach the top levels of the order book.
Write smarter execution logic
When you know the real depth of the book, you can build pre-execution liquidity checks into your system with routing orders only when there is sufficient depth at multiple levels to absorb the order at an acceptable price. This can help reduce slippage by providing greater visibility into available liquidity.
Equity and F&O from one integration
20-depth data covers both the cash market and F&O segments through the same API connection. Thus, whether your strategy is based on equities or index options, you do not need separate data feeds or additional integrations to access the same depth quality across both.
How to access 20-level market depth?
To access 20-Depth Market Data on DhanHQ Data APIs, you can follow the steps given below:
Step 1: Go to DhanHQ and use your credentials to log in.
Step 2: Open a real-time WebSocket connection to the 20-depth data stream.
Step 3: Subscribe to up to 50 instruments across Equity, Futures, or Options to start receiving real-time order book updates.
Step 4: Order-book updates are streamed in real time through WebSockets.
Step 5: Integrate the depth data into your strategy, execution model, or analytics workflow.
Key benefits of 20-Depth Market Data
The key benefits offered by 20-Depth Market Data are as follows:
- 4x more order book visibility: It offers you market depth up to 20 levels of bid and ask, giving you 4x more order book visibility than the standard 5-level market depth.
- Real-time streaming delivery: WebSocket updates ensure that the data remains up-to-date with changes in the order book.
- Built for integration: The data can easily be integrated into custom systems, algorithms, and analytics tools.
- Cross-segment coverage: Offers up to 20 bids and ask levels for instruments across both Equity and F&O segments.
- Improved signal foundation: The greater the depth, the more context the system has for each decision to be made.
Use cases
Some practical use cases of 20-Depth Market Data are:
Algorithmic execution logic
You are developing a smart order routing system that can leverage 20-depth market data to gain insight into the liquidity distribution at different levels before placing a large order. That can assist the algorithm in determining whether to aggressively place an order or spread it out over levels to minimise market impact.
Developing strategies for F&O markets
You are running delta-neutral strategies on Bank Nifty options, and you want to know where real liquidity lies across various strikes before you place hedges. 20-depth market data across F&O instruments lets your system check the actual bid-ask stack at each strike before routing, thus enhancing the accuracy and execution efficiency of your position adjustments.
Order-flow analytics
You are building an analytics layer that identifies unusual order book activity, including large bids at deeper levels, a quick withdrawal of order book, and an aggressive one-sided flow, as early directional signals. Here, the 20-depth market data provides your system with the raw data to spot these patterns in real time, before they show up in price action.
Conclusion
With our 20-Depth Market Data on DhanHQ APIs, you can access up to 20 bids and ask levels of the order book in real-time for both Equity and F&O through a single WebSocket integration.
It addresses the fundamental data constraint of standard 5-level market depth, where decisions are based on only the top 5 bid and ask levels of the order book, without knowing broader order flow and liquidity patterns.












