DocsOrderbook
Learning Path00 Start Here01 Big Picture
IntroductionWhat Is an Order BookBids and AsksSpread and Mid PriceLimit OrdersMarket OrdersDepth and Liquidity
Matching Engine Basics02 Core Domain03 Matching Flow05 Guided Exercises06 Visual Guide07 Why This Design08 Performance Bridge
ArchitectureTechnical ArchitectureUI Notes and Terminal Ideas
Engine Performance NotesPerformance
Milestones
Glossary
LearnTerminal
DocsOrientation

00 Start Here

How to approach the project without getting lost in the implementation.

00 Start Here

This repo can teach you a lot, but only if you study it in the right order.

If you jump straight into src/matching.rs, it will feel dense and mechanical. That is normal. The code assumes you already know what an order book is, what a maker and taker are, and why FIFO matters. This chapter exists to remove that problem.

What you are looking at

This project has two relevant surfaces:

  • solbook-core: the real project, a matching engine library
  • web/: the learning terminal and docs interface built on top of the engine concepts

For learning, the engine comes first.

What a matching engine does

A matching engine is a program that keeps track of buy orders and sell orders. When a new order comes in, it decides:

  1. is this order valid?
  2. can it trade right now?
  3. if yes, with which resting orders?
  4. if some quantity is left over, should it rest on the book?
  5. what events or results should be returned?

That is the heart of this repository.

What you do not need to know yet

You do not need to understand:

  • networking
  • async Rust
  • TCP details
  • web servers
  • advanced data-structure theory

Those topics matter later, but they are not required to understand the core matching flow.

Words you should learn first

Before reading code, make sure these terms are at least somewhat familiar:

  • Order book
  • Bid
  • Ask
  • Price level
  • FIFO
  • Limit order
  • Market order
  • Maker
  • Taker
  • Trade
  • Price-time priority

If any of those are fuzzy, pause and read the glossary first.

How to study this repo without getting lost

Use this rule:

  1. learn the words
  2. learn the state
  3. learn one order path
  4. learn the data structures
  5. learn the performance tradeoffs
  6. only then study the learning UI and how it visualizes the engine

Do not try to understand the whole repository at once.

What “understanding” means here

You understand this engine when you can explain, in plain English:

  • where bids are stored
  • where asks are stored
  • how the engine finds the best price
  • why FIFO is preserved
  • what happens when a limit order crosses
  • what happens when a market order cannot fully fill
  • how cancel finds the right order

First source files to open

Start with:

  • src/lib.rs
  • src/order.rs
  • src/order_book.rs

Do not start with the UI. If you want a visual aid later, use the learning terminal in `web/` after the core flow makes sense.

First mindset to keep

This is not mainly a web app.

It is an in-memory machine that updates book state deterministically. The frontend is one learning surface around that machine.

PreviousNext
On This Page8
What you are looking atWhat a matching engine doesWhat you do not need to know yetWords you should learn firstHow to study this repo without getting lostWhat “understanding” means hereFirst source files to openFirst mindset to keep