Maroof Street

A stock exchange I built from scratch: a C++ matching engine, Kafka, Postgres and Redis. Five bots trade on it while it is open. Place your own order and watch it match.

Connecting…

Simulated market. Prices are made-up reference values, not real quotes.

Trades per minute

—

last trade —

Trades this session

—

since the exchange opened

Shares traded

—

across all five stocks

Shares waiting

—

resting in order books

Order book · AAPL

Orders waiting for a match. Green are buyers, red are sellers. Click a price to use it.

No resting orders yet. The market maker posts fresh quotes every few seconds.

Buyers

price · shares wanted

—

Sellers

price · shares offered

—

Place an order · AAPL

Buys or sells right now at the best price in the book (— a share). In this demo every order completes: if nobody else is offering that price, a house account takes the other side.

Estimated cost—

Your demo wallet

Everyone starts with $100,000 of pretend money. This wallet is only yours, and it changes when your orders fill.

Cash—
AAPL shares—

Your trades

Place an order and it appears here. Every trade you make stays in this list.

How a trade works

Place an order and watch it travel out through the exchange and come back to you. Click any box to see what it does.

Live activity

Every trade as it happens. Hover to pause.

Waiting for the first trade…

Who is trading

Six traders, written in four languages, all talking to the same exchange over the same gRPC API.

Market Maker
Python

Posts a buy price and a sell price around the middle of the market every 5 seconds, so there is always someone to trade with.

Waiting for the market to open

Random Trader
Python

Fires an aggressive order at a random stock every few seconds. This is what creates most of the trades.

Waiting for the market to open

Go Momentum
Go

Follows the crowd. If 4 of the last 5 trades were buys it buys, if 4 were sells it sells.

Waiting for the market to open

Rust Mean-Reversion
Rust

Bets against the crowd. Sells when the price runs above its recent average, buys when it drops below.

Waiting for the market to open

Java TWAP
Java

Slices a big order into 10 pieces, 10 seconds apart, the way an institution hides its size.

Waiting for the market to open

Visitor
You

Anyone on this page. Each visitor has their own wallet, and all orders trade against the same market.

Waiting for the market to open