finds.dev← search

// the find

i25959341/orderbook

★ 548 · Go · MIT · updated Apr 2025

Matching Engine for Limit Order Book in Golang

A Go implementation of a price-time priority order book with limit and market order matching. Targets developers building exchange backends or trading simulators who need a drop-in matching engine without writing one from scratch. Compact single-package library, no external service dependencies.

Uses a sorted map structure for O(log n) price level lookup, which is the right call for a general-purpose order book. The shopspring/decimal dependency for price arithmetic is correct — floating point in financial code is a career-ending mistake. Test coverage across orderbook, orderqueue, and orderside is present and the API surface is small enough to actually understand in an afternoon. The return signature of ProcessLimitOrder (done, partial, err) maps cleanly to real exchange semantics.

300k trades/second claim has no benchmark file in the repo to verify — the .travis.yml runs tests but not benchmarks, so that number is unsubstantiated. No stop orders, stop-limit orders, or iceberg orders, which means you'll hit a wall quickly if building anything beyond a toy exchange. Order IDs are plain strings with no built-in deduplication beyond a map lookup, so uniqueness is entirely the caller's problem with no ergonomic help. Last meaningful commit activity suggests the project is in maintenance mode at best — issues and PRs have piled up unanswered.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →