📈

Financial Services

Trading & Securities

Equity, derivatives, and bond markets — the technology powering NSE, BSE, Zerodha, and India's 160M+ demat accounts across order management, clearing, settlement, and market data.

160M+

Demat Accounts

#1

NSE — Global Derivatives

T+1

Settlement Cycle

₹350T+

Annual Equity Turnover

Understanding Trading & Securities— A Developer's Domain Guide

Trading & Securities technology encompasses all systems that power the buying and selling of financial instruments — equities, derivatives (futures & options), bonds, mutual funds, and commodities. India's capital markets are among the world's most sophisticated: NSE is the world's largest derivatives exchange by contracts traded, Zerodha runs entirely on custom-built technology and processes millions of orders daily, and SEBI's T+1 settlement (world's fastest) was delivered entirely through technology transformation. The stack covers order management systems (OMS), exchange matching engines, clearing and settlement via NSCCL/ICCL, depository systems (NSDL/CDSL), and market data infrastructure.

Why Trading & Securities Domain Knowledge Matters for Engineers

  • 1NSE is the world's #1 derivatives exchange — processes 1B+ orders daily at microsecond latency
  • 2Zerodha, Groww, Upstox, Angel One all built on custom, high-performance trading stacks
  • 3India moved to T+1 settlement in 2023 — one of the most complex technology migrations in BFSI
  • 4SEBI's algo trading, co-location, and market surveillance regulations drive constant tech evolution
  • 5HFT (High Frequency Trading) and quantitative trading require deep understanding of exchange systems
  • 6Highest-paying niche in BFSI — exchange engineers, quant developers, and OMS architects

How Trading & Securities Organisations Actually Operate

Before writing a single line of code, it helps to understand how the business works end-to-end. In Trading & Securities, there are typically several distinct types of organisations: those building the core product or service, those distributing or reselling it, those providing regulatory oversight, and those supplying enabling technology. Each has its own systems, data flows, and integration requirements.

Systems & Architecture — An Overview

Enterprise Trading & Securities platforms are composed of a set of core systems, data platforms, and external integrations. For a detailed, interactive breakdown of the core systems and the step-by-step business flows, see the Core Systems and Business Flows sections below.

The remainder of this section presents a high-level architecture diagram to visualise how channels, API gateway, backend services, data layers and external partners fit together. Use the detailed sections below for concrete system names, API examples, and the full end-to-end walkthroughs.

Technology Architecture — How Trading & Securities Platforms Are Built

Modern Trading & Securitiesplatforms follow a layered microservices architecture. The diagram below shows how a typical enterprise system in this domain is structured — from the client layer through the API gateway, backend services, data stores, and external integrations. This is the kind of architecture you'll encounter on real projects, whether you're building greenfield systems or modernising legacy platforms.

Trading & Securities — High-Level System ArchitectureClient & Channel LayerWeb ApplicationMobile App (iOS/Android)Admin / Back-OfficePartner / B2B PortalThird-Party APIsBatch / Scheduled JobsAPI Gateway & Security LayerAuthentication · Rate Limiting · Routing · API Versioning · WAFCore Domain Microservices📋 Order Management S…Order capture from web, mo…Pre-trade risk checks — ma…POST /api/v1/orders Exchange Matching …Continuous order book main…Price-time priority matchi…POST /fix/v1/NewOrderSingle🏦 Clearing & Settlem…Trade confirmation and mat…Novation — clearing corp b…GET /api/v1/obligations/{m…🗄️ Depository System …Demat account (beneficiary…Securities credit on buy —…GET /api/v1/holdings/{dpId…📊 Market Data & Feed…Real-time tick data distri…Order book / market depth …GET /api/v1/quote/{symbol}Data & Event Streaming LayerOracle / PostgreSQLRedisEvent Bus (Kafka)Document Store (S3)Analytics / BIExternal Integrations & PartnersExchange FIX Gat…Risk EngineMargin SystemDepository (NSDL…Back OfficeClient AppCloud Infrastructure: AWS · Co-location (NSE/BSE premises) · On-premise (Exchanges)· Container Orchestration · CI/CD Pipeline · Monitoring & ObservabilityCross-Cutting: Authentication (OAuth2/JWT) · Audit Logging · Encryption (TLS/AES) · Regulatory Compliance↑ Requests flow top-down · Events propagate via message bus · Data persisted in domain-specific stores ↓

End-to-End Workflows

Detailed, step-by-step business flow walkthroughs are available in the Business Flows section below. Use those interactive flow breakouts for exact API calls, system responsibilities, and failure handling patterns.

Industry Players & Real Applications

🇮🇳 Indian Companies

NSE (National Stock Exchange)

Stock Exchange

C++, Linux, co-location

World's #1 derivatives exchange — NEAT trading system, sub-millisecond matching

BSE (Bombay Stock Exchange)

Stock Exchange

BOLT+ system

Asia's oldest exchange — sensex, equity, SME platform

Zerodha

Discount Broker

Go, Python, Kite platform

India's largest broker by active clients — built Kite, Coin, Streak in-house

Groww

Investment App

Java, Kotlin, AWS

10M+ active investors — mutual funds, equity, IPO

Upstox

Discount Broker

Java, Kotlin, AWS

RKSV rebranded — Tiger Global backed

Angel One

Full-Service Broker

Java, SmartAPI

Legacy + modern — SmartAPI for algo trading

NSDL / CDSL

Depository

Java, Oracle

Hold all demat securities — every share is an electronic record here

NSCCL / ICCL

Clearing Corporation

Java, Oracle

Guarantee settlement — counterparty to every NSE/BSE trade

🌍 Global Companies

CME Group

USA

Derivatives Exchange

C++, Globex platform

World's largest futures and options exchange

NYSE / NASDAQ

USA

Stock Exchange

C++, custom FPGA

World's largest equity markets by market cap

Interactive Brokers

USA

Global Broker

C++, Java

TWS platform — 150 markets, advanced order types

Bloomberg

USA

Financial Data & Terminal

Proprietary, APIs

325,000 terminal subscribers — market data backbone

Refinitiv (LSEG)

UK

Market Data

Java, cloud

Reuters news + Eikon terminal + Elektron data

🛠️ Enterprise Platform Vendors

Charles River IMS

OMS / IMS

Buy-side order management system — used by large asset managers and hedge funds

ION Trading / Fidessa

OMS / EMS

Sell-side OMS and EMS — used by brokers and prime brokers globally

Murex

Capital Markets Platform

Capital markets platform — trading, risk, and treasury for investment banks

Bloomberg AIM

Buy-side OMS

Asset and investment management OMS — buy-side focused

Core Systems

These are the foundational systems that power Trading & Securities operations. Understanding these systems — what they do, how they integrate, and their APIs — is essential for anyone working in this domain.

Business Flows

Key Business Flows Every Developer Should Know.Business flows are where domain knowledge directly impacts code quality. Each flow represents a real business process that your code must correctly implement — including all the edge cases, failure modes, and regulatory requirements that aren't obvious from the happy path.

The detailed step-by-step breakdown of each flow — including the exact API calls, data entities, system handoffs, and failure handling — is covered below. Study these carefully. The difference between a developer who “knows the code” and one who “knows the domain” is exactly this: the domain-knowledgeable developer reads a flow and immediately spots the missing error handling, the missing audit log, the missing regulatory check.

Technology Stack

Real Industry Technology Stack — What Trading & Securities Teams Actually Use. Every technology choice in Trading & Securitiesis driven by specific requirements — reliability, compliance, performance, or integration capabilities. Here's what you'll encounter on real projects and, more importantly, why these technologies were chosen.

The pattern across Trading & Securities is consistent: battle-tested backend frameworks for business logic, relational databases for transactional correctness, message brokers for event-driven workflows, and cloud platforms for infrastructure. Modern Trading & Securitiesplatforms increasingly adopt containerisation (Docker, Kubernetes), CI/CD pipelines, and observability tools — the same DevOps practices you'd find at any modern tech company, just with stricter compliance requirements.

⚙️ backend

C++ (High Performance)

Exchange matching engines (NSE NEAT), HFT systems, co-location strategies — microsecond latency

Java / Spring Boot

Broker OMS, back-office, clearing systems, depository — reliability over raw speed

Go (Golang)

Zerodha's core trading services — Kite connect API, real-time data feeds

Python

Algorithmic trading strategies, backtesting, quantitative analysis, risk models

🖥️ frontend

React / Next.js

Trading dashboards (Kite web, Groww, Upstox), charting interfaces, back-office portals

React Native / Flutter

Mobile trading apps — Kite, Groww, Angel One mobile

WebSockets

Real-time price feeds, live order book updates, trade notifications

🗄️ database

Oracle / PostgreSQL

Transactional systems — OMS, clearing, depository records requiring ACID guarantees

Redis

Real-time positions, margin availability, LTP cache, rate limiting for API

Apache Kafka

Trade event streaming, order state machine, market data pipeline

kdb+ (KX Systems)

Time-series tick data storage — the industry standard for financial market data, blazing fast queries

InfluxDB / TimescaleDB

OHLC candle generation, market data analytics for smaller-scale implementations

☁️ cloud

AWS

Zerodha, Groww, Upstox — EC2, SQS, RDS for broker platforms and analytics

Co-location (NSE/BSE premises)

Algo traders and HFT firms house servers physically inside exchange premises for lowest latency

On-premise (Exchanges)

NSE, BSE core matching engines run on-premise — regulated, deterministic hardware

Interview Questions

Q1.Explain India's T+1 settlement cycle — how does it work technically?

T+1 means a trade executed today (T) is settled tomorrow (T+1). Technically: On trade day, NSE sends trade files to NSCCL. NSCCL performs multilateral netting — for each security, calculates net delivery obligation per broker (sum of all client buys minus sells). On T+1 morning: 1) Securities settlement — brokers with delivery obligation instruct NSDL/CDSL to debit securities from selling clients' demat; depository transfers to buying clients' demat by afternoon. 2) Funds settlement — net funds obligations settled via clearing banks through RBI RTGS, funds credited to selling brokers, debited from buying brokers. India achieved T+1 in Jan 2023 for all securities — world's first major market to do so. Key challenge: compressed timeline required real-time reconciliation between broker, depository, and clearing corp.

Q2.What is SPAN margin and how is it calculated for F&O?

SPAN (Standard Portfolio Analysis of Risk) is the margin methodology developed by CME and adopted globally for derivatives. It calculates the maximum one-day loss of a portfolio across 16 risk scenarios (price up/down × volatility up/down combinations). How it works: 1) Define risk array — 16 scenarios for each contract. 2) Calculate worst-case loss per scenario for each position. 3) Sum across portfolio considering correlations. 4) SPAN margin = worst single-day loss scenario. In India: NSCCL calculates SPAN daily; brokers must collect at least this much from clients. Exposure margin (additional 2–5% of position value) collected on top. Example: If Nifty Futures SPAN margin is ₹1.2L per lot, buying 1 lot blocks ₹1.2L + exposure margin from client account.

Q3.How does a stock exchange matching engine work?

A matching engine maintains an order book per instrument — a sorted list of buy orders (bid side, highest price first) and sell orders (ask side, lowest price first). Matching algorithm: 1) Price-time priority — best price matched first; among same-price orders, earlier timestamp wins. 2) When a new buy order arrives at price ≥ best ask, a trade is generated. 3) Partial fills possible if counter order quantity is smaller. Performance requirements: NSE NEAT processes millions of orders per second, sub-millisecond latency. Implementation: C++ with lock-free data structures, FIFO queues per price level, pre-allocated memory pools. Special scenarios: market orders (execute at best available), limit orders (execute only at specified price), stop-loss (trigger only when price crosses threshold).

Q4.Explain the role of a Depository Participant (DP) and how demat transfers work.

A Depository (NSDL/CDSL) is like a bank for securities — holds all shares electronically. A Depository Participant (DP) is the intermediary between investor and depository — banks (HDFC, SBI), brokers (Zerodha, Groww) are DPs. Every investor has a BO (Beneficiary Owner) account at a DP. Demat transfer flow on selling: 1) Investor sells shares via broker. 2) After trade, NSCCL sends delivery obligation to clearing member (broker). 3) Broker instructs DP to debit shares from client's demat (DIS — Delivery Instruction Slip, now digital). 4) DP debits client's BO account, credits clearing pool account of clearing corporation. 5) Clearing corp then credits buyer's BO account. On buy: reverse — clearing corp pool → buyer's DP → buyer's BO account. All this happens on T+1 in India.

Q5.How do you design a rate limiter for a trading API like Zerodha's Kite Connect?

Trading API rate limiting requirements: prevent order spam, protect exchange connectivity (FIX connections are limited by NSE per broker), and ensure fair usage. Design: 1) Multi-level limiting — per API key (client), per IP, per exchange segment. 2) Algorithm: Token bucket preferred over fixed window — allows short bursts but limits sustained rate. Token bucket: each client gets N tokens per second; each order consumes 1 token; tokens refill at rate R/second. 3) Storage: Redis with INCR and EXPIRE for distributed rate limiting across gateway pods. 4) Different limits per endpoint: /orders (stricter — e.g., 10/sec per client) vs /quotes (lenient — 100/sec). 5) Soft limits with headers (X-RateLimit-Remaining) + hard limits with 429 response. 6) Algo traders on paid plans get higher limits via a flag in the token metadata.

Glossary & Key Terms

OMS

Order Management System — broker's central system for capturing, routing, and tracking all trading orders

FIX Protocol

Financial Information eXchange — industry standard messaging protocol for real-time trade communication

NSCCL

NSE Clearing Corporation Ltd — clears and settles all NSE trades, guarantees settlement

ICCL

Indian Clearing Corporation Ltd — clears and settles all BSE trades

NSDL / CDSL

National/Central Securities Depository Ltd — hold all electronic securities (demat)

DP

Depository Participant — broker or bank that provides demat account services on behalf of NSDL/CDSL

ISIN

International Securities Identification Number — unique 12-character identifier for each security

SPAN

Standard Portfolio Analysis of Risk — margin methodology for derivatives

MTM

Mark-to-Market — daily revaluation of open positions at closing price; P&L settled daily for futures

T+1

Trade date plus 1 day — India's equity settlement cycle, world's fastest

ASBA

Application Supported by Blocked Amount — IPO application process where funds are blocked, not debited until allotment

CNC

Cash and Carry — delivery-based equity trade product (held overnight, settled T+1)

MIS

Margin Intraday Square-off — intraday trading product, auto square-off before market close

HFT

High Frequency Trading — algorithmic trading at microsecond speeds, co-located at exchange premises

Co-location

Placing trading servers physically inside exchange premises to minimise latency to matching engine

Circuit Breaker

Automatic market halt when index falls/rises beyond threshold (10%, 15%, 20%) to prevent panic selling