transcribe

From your phone to the exchange — Journey of an Order | In the Money by Zerodha

In The Money by Zerodha · 18m · transcribed Jun 2026
More from In The Money by Zerodha Business
𝕏 Share ▶ YouTube 📥 PDF 🤖 .md

Transcript

0:00 You know, I've been thinking about something. Every single day, lacks of traders log into Kite. Find the stock or the option strike and hit buy or sell. Done. 2 seconds order placed. But I always wondered as to what actually happens in those 2 seconds. Like where does that order go? Who checks it? Now whether you are sitting in Salem, Surat, Shillong or the middle of nowhere with a decent internet connection, that order travels all the way to an exchange in Mumbai, gets validated, gets matched and comes back to you as a confirmed trade every single time. But what really happens behind the scenes? What are those millions of moving parts that make this process possible? And in that process, what are all the things that could go wrong? I wanted to figure all that out. So, I sat down with our infrastructure team and basically made them explain the whole thing to me. And honestly, it blew my mind. So, that's what this video is about. A full breakdown of the journey of an order from the moment you tap that buy button on Kite to the moment the exchange says yes, done, complete. It's specific to how we built things at Zeroda, but most brokers work in a broadly similar way.

1:15 So this should be relevant to you regardless of where you trade. I'm your host Sepra and this is the journey of an order. Let's start with where we all start every morning by logging into kite. Now most of us think logging in is just logging in. You type your credentials, do your 2FA and you are in. Simple. But the moment you hit that login button, something important is already happening in the background that most of us have no idea about. So what is that? You see, at the time you created your account, Zeroda mapped you on to a specific silo and every time you log in, that's exactly where you land. Now think of silos like lanes on a highway. Instead of all users piling onto one single lane like that and subway and causing a traffic jam, the system splits its users across multiple independent lanes. Now, here's what's interesting. Each silo is actually housed in a different physical data center. For instance, silos A and B in Mumbai and C and D in Chennai. Four completely different locations. Two in Mumbai and two in Chennai. So, by the time you finished your morning chai or coffee, you are ready to place your first trade. Your order already knows exactly which lane it's going to travel through. All of that even before we talk about the order itself.

2:46 All right, you are logged in. You put the stock on the watch list and you hit buy. The moment that happens, your order leaves your phone or your laptop and travels across the internet. And the very first thing it runs into before it even gets to zeroda servers is a checkpoint called Cloudflare. Now Cloudflare is essentially a security guard of sorts and its job is to figure out if the request coming in is legitimate or not. Here's the thing.

3:13 When you have lacks of users hitting your platform every day, you are also a target. Bad actors on the internet can attempt something called a DDoS attack, where they flood your servers with millions of fake requests all at once, trying to overwhelm the system and bring it down. Cloudflare's job is to catch all of that and block them before they cause any damage. But here's where it gets a bit tricky. Sometimes Cloudflare 2 can get it wrong. If your ISP say or Jio has been flagged for suspicious activity, maybe too many requests coming from a particular location, Cloudflare can accidentally block legitimate users too. It's a false positive. Your order never even makes it in and from your end, it just looks like Kite isn't working. So, if you ever had a moment where every other app is working fine, but Kite just wouldn't load, this could actually be the reason. But for now, let's assume your order gets through Cloudflare, and almost always it would.

4:15 It now moves on to the next stop. So now your order has made it past Cloudflare and enters what is essentially the brain of Zeroda's operation, AWS or Amazon Web Services. Now, before you ask, yes, Zeroda, like most modern tech companies, runs a large part of its infrastructure on Amazon's cloud. That's not unusual. In fact, some of the biggest banks and financial institutions in the world do the same thing. But here's the challenge AWS has to solve. On a normal day, Zeroda has hundreds of thousands of users placing orders. But on a volatile day, say when the budget is announced or there's a big global event, that number can spike dramatically and very suddenly. So how do you make sure the system doesn't buckle under that kind of a pressure?

5:07 Two things. First is load balancers. Think of these like traffic cops standing at a busy intersection. They make sure incoming orders are distributed evenly across multiple servers so no single server gets overwhelmed. And second, unlike a physical server that you can't just magically expand, AWS can automatically create new capacity when traffic spikes. It can actually scale with demand in real time. One more thing worth mentioning here, AWS doesn't run everything from one location. They have servers across multiple locations in India. So if there's an issue with the Mumbai infrastructure, AWS can automatically reroute traffic to say their Hyderabad servers with barely any disruption on your end. So by the time your order clears AWS, it's been load balanced, routed correctly, and is ready to move to the next stage, which is where things start to get really interesting.

6:10 Okay, so here's where the story shifts gears a little bit. Up until now, your order has been handled entirely on Zeroda's cloud infrastructure on AWS. But now, it needs to travel to a completely separate physical setup. Zeroda has its own dedicated onpremise data centers in Mumbai and Chennai. Now, let me clarify, these are not cloud servers sitting somewhere on the internet. These are physical servers housed in buildings and are maintained and secured by a company called NT Global Data Centers, previously known as Net Magic. And honestly, the word data center just doesn't do justice to it.

6:50 These are fortress-like facilities, heavily secured, temperature controlled with redundant power supplies, more secure than most government offices. This is where the critical aspects of your order execution happens. Now, while it may seem obvious, it's important to understand how the order actually gets from AWS to the data center. That happens through what are called P2P lines, point-to-point lease lines. Think of a P2P line like a private expressway that Zeroda has exclusively for itself.

7:22 No traffic, no noise, no sharing with anyone else. just a direct dedicated high-speed connection between two points which is much faster and more reliable than the regular internet but and this is equally important zeroda doesn't rely on just one line there are always two parts available the P2P line is primary and the internet acts as a backup if the P2P line has any issues the system automatically switches to the internet connection and this matters because these lines while extremely ly reliable are not completely immune to problems.

7:58 There have been instances where ISP routing issues caused a line to go down in the middle of a trading day because the switch over to the backup is automatic. Most users never even felt it. So, your order has now arrived at the data center. What next? Now, this is where things get even more interesting. Inside the data center, your order goes through a series of checks. Think of it like a series of security gates. Each one making sure your order is valid before letting it through to the next.

8:34 The first check happens through a mini RMS layer that Zeroda has built inhouse, which sits right at the entry point. This is essentially Zeroda's own pre-f filter. Before your order even reaches the main order processing system, it quickly checks the basics. Is the order within circuit limits? Is the exchange segment correct? Is the account active? Think of it as a quick sanity check that filters out the obvious problems early so they don't clog up the system further down the line. If it clears these checks, your order moves to the big one, the MS, the order management system.

9:10 Zeroda uses an industry-leading MS called Omnest. More than half of India's orders flow through this particular MS. This is actually the most critical piece of infrastructure in the entire journey of an order. Everything happens here. Your order is logged, assigned an order ID and then passed to the RMS that is the risk management system. This RMS is where the real scrutiny happens. Do you have enough margin? Is your order within the permissible limits? All those checks that happen in the background when you place a trade, that's the RMS doing its job. And here's something worth knowing.

9:49 Every order that successfully enters the MS gets a unique order ID assigned to it. If you ever call the Zeroda support about an order, this is the number they are referring to. It's essentially the fingerprint of your order from this point onwards. And once the RMS gives the green light, your order is finally ready for the last leg of its journey, the exchange itself. Let's say your order has now cleared every internal check. Zeroda's mini RMS, the MS and the main RMS and all's green.

10:27 Now it's ready for the final leg, the stock exchange, which is usually BSC, NSC or MCX. And just like the connection between AWS and the data center, the connection between Zeroda's data center and the exchange is not the regular internet. It's another set of dedicated P2P lease lines. direct private high-speed lines because at this stage every millisecond matters. Now, here's something not many would know. These lines to the exchange are not cheap. Zeroda pays a significant amount to the exchanges particularly NSC for this connectivity. And there's a reason for that. These lines actually have two types of capacity. The number of messages per second and bandwidth.

11:10 Interestingly, the lines are built on the number of messages, not bandwidth. To put that in perspective, a line that supports 5,000 messages per second costs around 2.5 crores for both the primary and the backup lines combined. Both NSE and BSC offer up to 100 Mbps capacities and Zeroda is currently on a 100 Mbps line. Now, that might sound nothing compared to your home broadband, but remember these lines only carry tiny bite-sized order packets. No videos, no images, nothing else. So the capacity is more than sufficient for normal trading volumes. But on extremely volatile days when the market moves sharply and thousands of orders and fills are flying back and forth simultaneously, even these lines can get congested. Now what happens if a line goes down completely?

12:01 Zeroda has two physical lines to the exchange serviced by two different ISPs, typically Airel and TCL. If one goes down, the system automatically switches to the other. And if for some reason the automatic switch over doesn't happen, say the line is partially working, what's called flapping, the team manually intervenes and switches it over. And once your order hits the exchange, the exchange runs its own set of checks. Is the market open? Is the order valid?

12:33 Is the account recognized? If everything checks out, the exchange accepts the order, stamps it with its own Exchange order ID and sends back a confirmation. That confirmation travels all the way back through the same path exchange to the data center to AWS and then to your phone. And if you see your order as open, it means it has reached the exchange. And if you see complete, it means your order is filled. And all of that, every single step we just walked through happens in a few milliseconds.

13:06 And before we get into what can go wrong in this whole journey, and trust me, there's a lot to cover there, let's just take a moment to look at how far an order has to actually travel. First, you log into Kite from wherever you are. And the moment you log in, the system recognizes your assigned silo. Then you place your order. It leaves your device and goes to Cloudflare to get cleared. from there on to AWS gets load balanced across service travels via a dedicated P2P lease line to Zeroda's physical data center in Mumbai or Chennai once inside the data center it passes through Zeroda's own RMS then the MS and then the main RMS again once it gets cleared by all three it's sent via another lease line to the exchange which is NSE BSC or MCX exchange validates it, accepts it, stamps it with an order ID. Confirmation comes back. You see it on your screen as open or complete. Seven layers, hundreds of moving parts, multiple physical locations in India. And it all happens in a few milliseconds. Now on to the question of what happens when something goes wrong somewhere in this chain.

14:23 The fact is things can go wrong at any point in this journey. But not all failures are equal. Most you'll never even notice. Others will have you refreshing kite wondering what happened. Let's go from the least disruptive to the most. The ones you'll never feel. The P2P line between AWS and the data center goes down. The system automatically switches to the internet backup. Done. You don't even experience it. The AWS Mumbai infrastructure has an issue. traffic routes to Hyderabad automatically. Again, you won't even feel it. These are failures that the redundancies are specifically designed for and they work seamlessly. Moving on to issues that can cause a brief hiccup.

15:08 A traffic spike on AWS for that matter can take a few seconds to autoscale. Cloudflare falls positive that blocks a handful of users from a specific ISP. These are temporary, usually resolved in seconds or minutes, but you might notice kite being slightly slow or unresponsive for a brief moment. Now over to issues that are visible but manageable. The exchange lease line starts flapping, partially working, partially not. The automatic switch over doesn't trigger because the line isn't fully down. In such a situation, the team has to manually intervene and switch to the backup. Now, this may take a few minutes and during that window, orders might be delayed. You may see an error, something on the lines of open pending on your screen. Lastly, issues that are genuinely disruptive. The MS goes down or the exchange itself experiences an outage. Now, these are the rarest, but also the most impactful. When the MS has an issue, order confirmations can be significantly delayed. And when the exchange itself has an outage, there's very little anyone on Zeroda's end can do except communicate with the exchange and keep users informed. These are the situations when you'll see Zeroda's notifications about the issue on the Kite app and also on social media handles. The truth is most of the time you'll never know any of this happening.

16:35 The redundancies do their job quite smoothly in the background. But on the days when something does go wrong, you may experience minor delays or in case of issues with significant impact, you will get notifications and updates about what's happening. So the next time you open Kite, find your stock and hit buy or sell. Just take a moment to marvel at what's happening under the hood. And before you even think your order would have traveled from your phone irrespective of where you're located and then crossed the internet passed through Cloudflare been load balanced across servers on AWS traveled via dedicated lease lines to physical data centers in Mumbai or Chennai cleared three layers of internal checks across another lease line to the exchange gets validated accepted and finally confirmed. Now all of this is possible thanks to hundreds of engineers, some inside of Zeroda and many more outside of it. Years of infrastructure work and a lot of redundancies built to quietly do the job every single trading day and most of the times you never have to think about any of it. And that I think is pretty much the point. I hope you found this episode useful and honestly I hope it gives you a little more context when you are on kite and something doesn't go as expected. As always, if you have any questions about anything we've covered today, drop them in the comments below and I read them all and I'll do my best to answer. Thank you and see you in the next

Summary

The video explores the intricate journey of a stock or options order placed through Zeroda's Kite platform, detailing the various stages and systems involved from the moment a trader clicks "buy" or "sell" until the order is confirmed by the exchange. It highlights the technology and infrastructure that support this process, including security measures, data centers, and redundancy systems designed to ensure smooth operation even during high traffic or technical issues.

- Orders travel from the user's device to Zeroda's servers through a series of checkpoints, starting with Cloudflare for security.
- Zeroda uses Amazon Web Services (AWS) for cloud infrastructure, which includes load balancers to manage incoming traffic and ensure stability during spikes.
- Orders are processed in dedicated physical data centers in Mumbai and Chennai, connected via private point-to-point lease lines for speed and reliability.
- Each order undergoes multiple checks, including validity and risk management, before being sent to the stock exchange.
- The exchange performs its own validations before confirming the order, which is then relayed back to the user.
- Redundancies are built into the system to handle potential failures, such as automatic switches to backup connections during outages.
- Disruptions can range from unnoticed automatic switches to significant delays caused by issues with the exchange or order management system.
- The entire process is designed to be seamless, with most users unaware of the complexities involved in order execution.
© transcribe · For agents Built with care and craft by Gokul Rajaram