I built a native, low-latency C++ CLOB client for @Polymarket
After wrapping up my finals, I’ve been spending my winter break—like a lot of others—trading Polymarket’s 15-minute crypto price markets. Naturally, I started writing bots to trade these markets, and one thing I quickly noticed was that while there were solid Python, TypeScript, and Rust clients, there wasn’t a C++ option.
A lot of trading infrastructure in quantitative trading and HFT is still written in C++, and I thought this could be a good on-ramp for folks from that world to experiment with Polymarket using tools they’re already comfortable with, while also being a great learning experience for me as a student.
When it comes to Ethereum tooling, Rust, Python, and TypeScript all have fairly mature ecosystems—C++ is the odd one out. Because of that, I had to implement much of the Ethereum-specific logic completely from scratch, which ended up being one of the most rewarding parts of the project:
- EIP-712 typed data signing
- RLP encoding
- ABI encoding
- Ethereum JSON-RPC client
- On-chain approval helpers
- L2 HMAC auth message construction
(Using OpenSSL for cryptographic primitives and libsecp256k1 for signing)
Along the way, I spent a lot of time learning and applying low-latency optimizations for high-frequency trading—like keeping TCP/TLS hot, SIMD JSON parsing for fast market data handling via simdjson, background heartbeats, and more. I plan on writing more about this in a future post, so stay tuned.
The client is still early, but it already has full feature parity with the Rust client for core trading:
- L1 / L2 authentication
- Order creation, signing, and posting
- Market data endpoints
- On-chain approvals (USDC + CTF)
- All order types (GTC, FOK, GTD, FAK)
On the roadmap:
- Custom memory allocators
- Zero-copy string views
- Profile-guided optimization
- 100% feature parity with the Rust client
I’ve learned a lot from this project, and with the new maker rebates that have just rolled out for 15-minute markets, I expect more participants to start providing liquidity. Hopefully this makes it easier to build tighter, lower-latency trading strategies.
School starts soon, but I plan on shipping a lot of the roadmap items before then.
Contributors welcome.
cc: @PolymarketBuild@shayne_coplan
https://t.co/xfYbWvJiTx
A milestone for U.S. market structure: a true bitcoin perpetual, approved by the @CFTC on a registered exchange.
Perps have long been crypto’s center of gravity for liquidity and price discovery and now that activity is onshore in the U.S. for the first time. This is a huge win for U.S. financial innovation: bringing products onshore and regulated by the @CFTC .
imc prosperity is unironically a great benchmark for agents; interesting to see how much edge each model can achieve from reading the problem, ingesting the data and one-shotting a solution
@mmdhrumil@solana i think itd be cool.. only problem is finding people willing to make on them.
realistically you'd just need to have a way for MMs to buy YES/NO token pairs for $1 each before markets open and then provide a router for taker orders to hit their posted curves
@annanay@jarxiao exchanges generate hundreds of millions providing services like colocation, etc. the incentive is largely not there for them to change market structure unfortunately
Huge congratulations to TradeXYZ and S&P for this historic partnership. I'm honored that these teams choose to build on Hyperliquid.
Seeing official S&P500 perpetual futures launch exclusively on Hyperliquid is a validation of everyone's past years of hard work: global access to decentralized finance, perpetual futures as 24/7 price discovery, and Hyperliquid upgrading the existing financial stack to house all of finance.
The S&P500 is synonymous with "the market," a single number that captures the essence of the largest economy in the world. Looking forward to tracking the world's most important financial gauge 24/7 on the most liquid permissionless markets.