IPO Allotment Engine
Deterministic
Settlement
at Scale
A scale-elastic processing platform for high-stakes IPO settlement and SEBI compliance.
Peak Throughput
10M+
Applications / run
Processing Time
<7s
End-to-end allotment
Memory Ceiling
<3GB
RAM for 10M records
Settlement Cycle
T+4
SEBI mandated window

Fig 01. // Basis of Allotment Grid & Processing Flow
High-stakes settlement infrastructure for India's securities market.
Client
SEBI-Registered Category I Registrar & Share Transfer Agent — 30+ yrs in India's securities market
Jrats Studio was engaged by a SEBI-registered Category I Registrar to Issue and Share Transfer Agent (RTA) with over three decades of experience in India's securities market to re-architect their IPO processing infrastructure from the ground up.
In the traditional registry space, processing an IPO is notoriously fragile — the platform must reconcile, validate, and compute the Basis of Allotment (BoA) for anywhere between 50,000 to over 10 million investor applications within a rigid T+4 settlement cycle. A single delay or calculation mismatch risks regulatory penalties, compliance failures, and reputational damage.
The goal was to transform legacy file-ingestion workflows into a fully automated, deterministic, and elastically scaling state machine — processing data in-memory rather than through slow relational aggregations.
Reconciliation & Allotment Engine
A high-performance, vectorized batch processor written in Python, optimized with Rust-under-the-hood via Polars LazyFrames. Three heterogeneous data sources. One reconciled truth set. Under 7 seconds.
Exchange CSV Bids
Bid Logs & Application ID Mapping
Sponsor Bank CSV
Clearing confirmations & timestamps
NPCI UPI Mandates
Payment blocking status & locks
Polars Join
SIMD Hash Join on Apache Arrow memory structures
Reconciled Set
Deduplicated clients, flagged PAN violations, audited accounts ready for solver routing.
Vectorized 3-Way Joins
POLARS_JOINReconciled raw exchange CSV logs, sponsor bank confirmations, and NPCI UPI transactions in-memory using Polars LazyFrames, matching 10M+ records under 3GB of RAM.
O(n) Demat Validation
RE2_ENGINETransitioned Demat format validations to Google's re2 engine, eliminating ReDoS vulnerabilities during heavy application surges.
Deduplication Strategy
DEDUP_STREAMImplemented Polars Streaming to aggregate and flag duplicate PAN applications in parallel, shifting workloads from database index locks to CPU-bound execution.
Reproducible Lottery CSPRNG
CSPRNG_SEEDIntegrated a cryptographically secure random number generator (CSPRNG) seeded for absolute reproducibility during tiebreaker lotteries, providing perfect audit trails.
Basis of Allotment Solver
A mathematically strict solver implementing four distinct SEBI-mandated allotment scenarios, applied dynamically based on subscription coverage and buffer thresholds.
100% Demand Allotment
When total bids are less than or equal to offered capacity. All valid applications are granted 100% of their applied shares.
Highest Remainder Method
Guarantees a minimum lot to all valid unique bidders, then distributes remaining shares proportionally. Colliding remainders resolved via seed-reproducible Draw of Lots.
SME Buffer Optimization
Automatically leverages an overallotment buffer (up to α% of Net Offer) to guarantee minimum lots to all bidders and avoid a lottery, primarily for SME public offerings.
Seeded CSPRNG Lottery
Triggered when demand vastly exceeds capacity plus the overallotment buffer. Runs a computerized draw using a CSPRNG seeded for absolute reproducibility and audit.
Decoupled Operations Console
Go Admin API Backend
Next.js Operations Portal
Next.js Panel
TypeScript / shadcn
AWS Cognito
OIDC / Fine-grained RBAC
Go Gin Backend
Gin / Zap Logging
Audit Ledger
Postgres / Checksums
Low-Latency Go Backend
High-throughput API gateway in Go using Gin with structured logging via Uber Zap. Authenticated via OAuth2/OIDC from AWS Cognito, supporting granular role-based access control distinguishing operations staff from allotment approvers.
Next.js Stage Orchestration
Operations interface built with TypeScript and shadcn/ui. Visual timeline for tracking ingestion, monitoring validation anomalies, resolving PAN and depository conflicts, and signing off on stage gates.
Compliance & Audit Ledger
Every administrative override, stage gate unlock, or parameter change triggers a structured audit record stored with cryptographic checksums in a dedicated audit database partition.
Backend API
Go (Gin / Zap)
Database
Amazon Aurora PostgreSQL
Frontend
Next.js 15 / shadcn
IAM Identity
AWS Cognito OIDC
Scale-to-Zero
with Hardened Egress
Provisioned via OpenTofu (Terraform), the infrastructure scales dynamically during massive allotment windows and collapses to zero otherwise — with zero security compromise.
01 // Egress Isolation
Routed private ECS and AWS Batch worker traffic through static NAT Gateways with Elastic IPs, ensuring predictable outbound addresses for exchanges (BSE/NSE) that require strict IP allowlisting.
02 // Parent-Child States
Orchestrated heavy parse/validate/reconcile operations inside parent AWS Step Functions, passing S3 and database resource keys rather than raw data payloads across child workflows to eliminate container memory limitations.
03 // Flyway Migrations
Maintained schemas dynamically using Flyway SQL migrations executed securely inside CodeBuild pipelines. Isolated database topologies inside private subnets of Amazon Aurora PostgreSQL (v15.8).
Determinism
as an Absolute
Requirement.
My work at Jrats Studio was built around one core tenet: Determinism is not an optimization — it is a regulatory requirement.
In high-volume financial operations, you cannot afford “mostly correct” outcomes. If an allotment runs three times, it must yield the exact same allottee profile down to the single lot and the single currency unit.
By building this platform around deterministic, file-first lazy execution, and leveraging modern memory architectures (Polars and Apache Arrow), we proved that enterprise-grade registry workflows can be scalable, secure, and bulletproof under regulatory audit loops.
Philosophy // 01
“Don't let your database do what a CPU can do in-memory.”
Philosophy // 02
“A platform is only as secure as its egress boundaries. Hardening the NAT gateways and isolating database networks is what keeps data safe — not just API access controls.”
Determinism is the only currency that matters when executing at scale.