How Dhan optimised its OMS for faster execution?

In the fast-paced world of trading, every millisecond counts, and even a few milliseconds can make the difference between a successful trade and a missed opportunity. This is especially true in the Indian derivatives market, where volatility is high and institutional algorithms execute trades at lightning speed. To retail traders, it takes more than a good trading strategy to survive and prosper here; it takes a trading platform that has an execution engine designed to run fast.
This is where the in-house Exchange Trading System (DEXT) of Dhan comes in. Dhan has redefined the basic structure of its Order Management System (OMS) and has abandoned the old legacy systems, and has set a new standard of speed in trade execution in India with its proprietary DEXT trading engine. Let's explore how Dhan optimised its OMS to do this.
From industry standard to Dhan’s shift
Before understanding the how, it’s important to understand the starting point. The traditional infrastructure is used by many trading platforms in India, which involves relying on third-party services.
Once an order is placed, it undergoes a sequence of checks in order, such as risk management, order validation, and margin availability, and is finally sent to the exchange. Although this is a reliable process, it inherently introduces latency.
At the beginning, the order execution time on Dhan was 120-150 milliseconds (ms), aligning with the industry standards, but Dhan’s team had a vision of building something much faster. Then it built its own proprietary DEXT architecture, and it proved to be a game-changer in the execution speed segment.
At first, execution speeds were below 50ms, but with constant optimisation, DEXT now processes almost 90% of all orders in less than 20ms. This is a staggering 6-8 times faster execution than industry standards, enhancing the trader’s trading experience on the Dhan platform.
Why build in-house?
The philosophy behind the decision to develop an in-house trading engine was that Dhan is not just a stockbroker; it's a tech-driven platform. Relying on third-party vendors often slows down a platform's ability to innovate and meet specific user needs because of reliance on them for core infrastructure. Dhan wanted to take things into their hands.
Dhan's control over its infrastructure enabled it to be agile, iterate quickly, enhance reliability, and deploy complex features seamlessly. This independence is the reason behind Dhan being able to offer advanced features such as Super Orders, the Scalper on Charts, and integration with TradingView.
Additionally, Dhan’s in-house trading engine also enables it to customise the entire trading experience, from the front-end user interface to the back-end execution engine, to cater to the needs of active traders.
The core idea behind optimisation
The key to optimising the OMS was not only writing better code, but a paradigm shift in the way an order is processed. The conventional myth in trading architecture was that order processing had to be sequential. This includes that the order is first sent to OMS for validation, then to the Risk Management System (RMS) for margin check, and then it is formatted for the exchange.
Dhan’s DEXT engine challenged this myth with parallelisation and smart synchronisation. It enables all checks to be done at the same time instead of waiting for one to be done before doing the next.
How is DEXT designed?
To understand the magnitude of this shift, let's take a look at the DEXT architecture. At Dhan, using order execution rather than having one pipe where orders queue behind each other, it is divided into several parallel pipelines at an early stage of the journey.
Multiple layers are responsible for different things at the same time as the order progresses through the system. Lastly, a smart final system makes sure that all is checked before the order is executed. Let's take a quick look at the different layers and what they do:
- Receiver: This is the ingress gateway that allocates a unique order ID and splits the order instantly into two parallel streams to perform a simple readiness assessment and complete validation test.
- OMS (Order Management System): This layer performs detailed order validation with 40-50 checks, which run simultaneously, and updates the validator in real-time, and later streams the output to Encoder.
- RMS (Risk Management System): This layer conducts an extensive set of 130-150 risk checks per order in parallel and then sends the output to the Encoder.
- Encoder with Internal Validator: This is the last aggregation and decision-making layer, which acts as a barrier and consensus arbiter, ensuring that all parallel tasks are synchronised and validated before the order passes to the exchange.
- Order constructor: This is the last integration stage, where the validated data is compiled and sent to the exchange for order execution.
What makes it fast?
The lightning execution speed of DEXT comes from these key innovations:
- Parallel processing: Instead of sequential checks, it conducts simultaneous checks on multiple engines.
- 200+ validations simultaneously: The DEXT system simultaneously carries out more than 200 different checks in the OMS and RMS layer.
- Barrier synchronisation & consensus mechanism: The Encoder acts as a smart barrier, which means that the order only moves forward when all parallel paths agree, and thus guarantees absolute safety without compromising speed.
- Early order construction: When the order is formatted for the exchange while validations are still in process, the order is already packaged and ready to go when it is approved.
What makes it reliable at scale?
With rapid changes in the trading landscape, speed is important, but robustness is equally vital when volatility strikes the market. DEXT is capable of processing thousands of orders in one minute without affecting its efficiency. Dhan has adopted a cautious server utilisation strategy, where, under normal conditions, the utilisation rate of the server does not exceed 30%.
The AWS-powered infrastructure features include auto-scaling features that enable the system to scale up its capacity in real-time during periods of high market activity. This pace and volume ensure that traders get their fills at the time they are needed, even in a fast-paced market.
Conclusion
Dhan's optimisation of its OMS with DEXT engine is a testament to its commitment to offering an institutional-grade trading experience to retail investors. Dhan has revolutionised latency by rethinking traditional architectures, breaking the myth of sequential processing, and adopting parallel systems.
To the active trader, this results in reduced slippage, quicker entries and exits, and a significant structural advantage in the competitive Indian stock market.











