One thing I learn from Moonshot AI dude @Bobby___Young few month earlier: rewrite every lines of code /w most advanced model every quarter. Polymarket did that as well.
At the end of August, I said our Polymarket DeFi CLOB couldn't be saved, and we were rewriting it from scratch in Rust 🦀View quoted post on X
Today I'm excited to announce Nex, our new exchange built from the ground up.
We've been sprinting on it since August. A Nex instance has been running in shadow mode on production traffic for the last week, side by side with the current exchange. It mirrors every order the current exchange gets, so we can measure latency, stability under load, and validate matching correctness against live production flow.
The numbers below are internal exchange timings, not e2e (those are coming soon), but we wanted to show how big the difference is.
p99 current CLOB → Nex:
- Place order: 1.55s → 3.76ms (412x faster)
- Cancel orders: 627.92ms → 3.20ms (196x faster)
- Cancel market orders: 810.16ms → 5.14ms (158x faster)
- Cancel all*:
↳ Response (current CLOB) vs complete (Nex): 35.70ms → 3.14ms (11x faster)
↳ Full cancel all: ~636ms-2.04s → 3.14ms (~200-650x faster)
p95 current CLOB → Nex:
- Place order: 341.84ms → 1.59ms (215x faster)
- Cancel orders: 78.22ms → 1.58ms (50x faster)
- Cancel market orders: 84.89ms → 2.27ms (37x faster)
- Cancel all*:
↳ Response (current CLOB) vs complete (Nex): 6.20ms → 1.58ms (4x faster)
↳ Full cancel all: ~606ms-2.01s → 1.58ms (~380-1,270x faster)
*Cancel all: the current CLOB responds immediately and cancels in the background, so when you get the response, your orders aren't cancelled yet. Nex responds only after everything is actually cancelled. Full cancel all on the current CLOB depends on how many orders you have, but it usually adds another 600ms-2s.
We also rewrote our WebSockets in Rust. This is the feed you see the market through: book changes, price moves, your fills. Fall behind it, and you're trading on old prices, and your quotes get picked off.
- Write latency p99: 44.5-88.1ms → 0.099ms (~449-889x faster)
- Slow readers/sec: 48.7-75.6 → 0.01 (~4,870-7,560x fewer, basically 0)
Scale: The current CLOB in stable state can handle 10k commands/s with 15k bursts → Nex can handle 100k commands/s with 150k bursts. 10x more, and with a few optimisations we can get to 200k commands/s with 250k bursts; with more low-level core changes, we can get to 1M commands/s over the next year. Not needed yet, but the headroom is there.
Startup time: 5 mins → 15s (20x faster)
The old CLOB had many race conditions and wasn't deterministic. Nex is deterministic by design and removes the race conditions in the old CLOB.
We also skipped some easy wins for launch to get this out faster that could make p95 and p99 another 5x faster, and we'll start work on that in Q1 next year to keep pushing these numbers down.
We wanted to build this without any breaking changes for MMs or builders; Nex has no breaking changes to requests or responses, so we just need to swap out the binary on our side and it will go live.
We want everyone to be on this journey with us, with the ability to relay feedback and test it against the existing CLOB, so we've opened a Nex Sandbox. Fill out the form and test it yourself: docs.polymarket.com/nex
We'll run 4 weeks of shadow mode on production traffic to make sure everything is perfect, then if everything is good, we will go live mid-December. We can roll out WebSocket improvements without the full exchange, so we may do that sooner.
We've been rebuilding every system around the exchange for months, and we've seen huge benefits, but the exchange is the heart of Polymarket DeFi. Nex fixes most of the pain traders have had.
Really proud of the team on this one.
Make Polymarket fast, finally. It's coming.