

To start with, how do you optimize your backends for speed? This needs focus on both backend and frontend systems. One thing you notice when Zerodha is how fast it feels compared to standard web applications. So we need to test and migrate piecemeal from the system. We’re doing complex checks that are based on mathematical models that we’ve reverse-engineered after years of experience with the system, as well as developing deep domain knowledge in the area.Īnd once we build out the system, we cannot simply migrate away from the old system due to the high consequences of potential errors. A margin check is based on mathematical models that take a lot of different parameters into account.

There’s no spec out there to build an Order or a Risk Management System. Why is it so tricky to rebuild an Order Management System? We now have a ton of services that do all sorts of things like document verification, KYC, payments, banking, integrations, trading, PNL, number crunching and analytics, visualizations, mutual funds, absolutely everything you can imagine. Then, we rewrote some of the services in Go. The first version of Kite, written in Python, came out in 2015. We’ve had a project to replace this OMS ongoing for 2.5 years and are currently an running internal beta, and once this is complete, we will have no external dependencies. We kept on replacing systems and dependencies, and the last piece left is the OMS - the Order Management System. So in late 2014, we built a reporting platform that replaced this vendor-based system. To give a sense of their maturity, they only worked on Internet Explorer 6. But they worked on 1/10,000th the scale that we operate on today, for a tiny fraction of the userbase. We had vendor products that let users log in and trade, and the competition was on pricing. In general, how has Zerodha evolved over time, from the v0 of the tech product to today?įrom 2010 to 2013, there was no tech team, and Zerodha’s prime value add was a discount pricing model. We still use (abuse) PostgreSQL with hundreds of billions of rows of data, sharded several ways Are you still using PostgreSQL for storing data? We have a joke in our engineering team that we’re just CSV engineers since re-conciliation in our industry happens via several CSV files that are distributed at the end of the trading day. What does the reconciliation process look like with the exchange? If you already have some futures and options in your account, the risk is variable based on that pre-existing amount. With equities, it’s a simple linear check of whether you have enough, but for derivatives, it’s about figuring out if you have enough margins. The most critical check is a margin check - whether you have enough purchasing power margins in your account. What is the risk management system doing? What exactly is the risk management system doing? Can you give an example of where it will block a trade?
