Punit (@punit363) header
Punit (@punit363) profile picture

Night Cook with a taste.

Mumbai
Joined January 2024
Photo by Punit (@punit363)Photo by Punit (@punit363)Photo by Punit (@punit363)Photo by Punit (@punit363)Photo by Punit (@punit363)Photo by Punit (@punit363)Photo by Punit (@punit363)Photo by Punit (@punit363)Photo by Punit (@punit363)Photo by Punit (@punit363)
Joined @100xSchool last month, where @kirat_tw introduced me to perpetual futures. Weeks of late-night cooking and my perp exchange is ready: Order Book, Matching Engine, Market Positions, Funding Rate Mechanism, Insurance Fund and Crash Recovery. Live@ perpex.punitpawar.xyz/
10
9
3
26
560
dropping today...
3
67
A great day to start
50
RUST: - Ownership model enforces memory safety at compile time without needing a garbage collector. - Its borrow checker prevents data races and dangling pointers. - It prevents data races and dangling pointers much needed for exchanges.
70
RUST: - Has a compilation step that spits out optimised binary - Built in support for multi-threading - One of the highest memory safe language - Integer datatype can be highly specific as in size of an integer and signed and unsigned can also be defined
67
CEX-v2 I have completed most of the revamp that came after shifting to the new architecture, now moving to further optimisation I have started learning RUST to improve the matching engine performance.
44
Too many for one project 😭 is there a better way to handle soo many services in dev?
45
CEX-v1: so for the past 1 month i have been working on building a simplified stock exchange, to summarise my learnings about the project I have written a blog about it you can check that out here : punitpawar.xyz
43
CEX-v2: - a new router service to transport post match trade and order data from engine to riskCheck service for balance update - engines from all markets use redis stream to send data to router - router has sharding data to send trade and order detail to correct riskcheck shard
40
CEX-v2: - removed balance ledger from engine this makes sharding possible in engine based on markets - prerisk check balance ledger moved to a different service sharded by user groups - http server connects to risk check using gRPC to reduce latency
47
This architecture has a simple NextJs frontend connected to a http server. The http server receives all the requested and sends it to the Exchange Engine via a Redis Queue. The engine manages an orderbook of all markets and also maintains balance ledger for all users in memory.
1
59
After an order is processed the trade and klines data generated in engine are sent to Database and also published on a redis PubSub. A seperate websocket server reads from the PubSub and streams the data live to user frontend.
24
Presenting my Project Apex-CEX-v1 This is a centralised exchange it follows @kirat_tw 's architecture from his cohort at @100xDevs a simple and close replica of a real exchange. I have it public on my github with complete documentation. Checkout below: github.com/punit363/apex-cex
1
1
57
Update | 23/7/2026 CEX : endles articles, lot of chai pe charcha with claude & gemini, jargons like LMAX disruptor buffer, FIX Protocol, DPDK networking and some mind boggling numbers of real exchanges, safe to say there is scope of improvement that i can personally achieve.
40
Had an annoying bug with cookies last week. Wrote this blog about my insights. Give it a read here-> punitpawar.xyz
31
Update | 22/7/2026 CEX : - Read some papers on how exchanges irl are architected to handle millions and billions of daily trade - horizontal scaling is very harding but is somewhat achieved thru sharding - low latency is achieved at optimization at hardware level
1
33
- a single process use multiple threads reduce latency but only for specific parts of the arch - threads use in-memory ring buffers to share data - Unix Domain Sockets or a shared memory-mapped file can also be used
30
Update | 21/7/2026 CEX : So today its finally complete🥳 Almost a month of work on this project. A lot of great concepts that i already knew about but felt when implemented. Thanks @kirat_tw for bringing up the benchmark. I am still improving the architecture. Stay tuned!
33
Daily Update | 20/7/2026 Crypto Exchange : - integrated common env for all workspaces in the monorepo - moved auth to httpOnly cookie to increase security - generalised error response for all API
27
Punit retweeted
Learn to sell. Learn to build. If you can do both, you will be unstoppable.
210
8,324
796
50,672