Building a Market Making Bot

AlgoCourse | April 15, 2026 5:30 AM

Building a Crypto Market Making Bot

Market making is the practice of simultaneously posting bid and ask limit orders to collect the spread. It sounds simple, but a crypto trading bot that makes markets well requires careful management of inventory, latency, and adverse selection.

The Basic Loop

Your market maker quotes a bid slightly below mid-price and an ask slightly above. When both sides fill, you profit the spread. Repeat thousands of times per day.

mid = (best_bid + best_ask) / 2\nmy_bid = mid - spread / 2\nmy_ask = mid + spread / 2\nplace_limit_order("buy", my_bid, qty)\nplace_limit_order("sell", my_ask, qty)

Inventory Management

If your bids consistently fill more than asks, you accumulate a long inventory. Skew your quotes to incentivize the other side: push your ask lower to attract sellers. This is the core challenge of automated crypto trading market making.

Adverse Selection

Sophisticated counterparties will trade against you when they know the price is about to move. Use a toxicity signal like trade imbalance to widen your spread when you detect informed flow and avoid being picked off in your crypto algo trading strategy.


Ready to build your own trading bot?

Join our comprehensive C# Algo Trading course and learn from experts.