# Market Making Simulator: Spread and Inventory

Play market maker: quote a bid and an ask as orders arrive, earn the spread, manage inventory risk and see adverse selection eat your P&L.

## About this tool

A market maker stands ready to buy at the bid and sell at the ask, all day, to anyone. When a buyer and a seller arrive one after the other, the market maker earns the spread between the two prices. That is the business: income is roughly the spread times the volume that is matched on both sides. The catch is that customers do not arrive in neat pairs. Between trades the market maker holds inventory whose value moves with the market, and some customers trade because they know where the price is going. This lab lets you play the role yourself and see where the money comes from and where it goes.

## Frequently asked questions

### How does a market maker make money?

By buying at the bid and selling at the ask. Each matched round trip earns the spread, so a first estimate of income is spread × matched volume. A wider spread earns more per trade but attracts fewer customers, because they can find better prices elsewhere or simply decide not to trade. The best spread balances income per trade against the number of trades, which you can find by experiment in the lab.

### Why does a wider spread not always mean more profit?

Because the number of fills falls as the spread widens. If the arrival rate of customers decays with the distance of your quote from the fair price, doubling the spread can more than halve the volume. Total income is the product of the two, so it rises at first and then falls. A spread that is too narrow, on the other hand, may not cover the losses to informed traders.

### What is inventory risk?

When more customers sell to you than buy from you, you end up long the asset, and the other way round. That position gains or loses as the price moves, often much more than the spread you earned on the trades. Market makers therefore shade their quotes: with a long position they lower both bid and ask to encourage buyers and discourage further sellers, until the inventory comes back towards zero.

### What is adverse selection?

Some customers trade because they know the price is about to move. They buy from you just before the price rises and sell to you just before it falls, so every trade with them loses money. A common misconception is that the spread is pure profit; in reality part of it is an insurance premium paid by uninformed traders to cover the losses to informed ones.

## Learn the theory

- [Market makers and liquidity](https://quantsandbox.dev/guide/microstructure/market-makers): Who provides liquidity, how bid and ask quotes work, the spread as the price of immediacy, makers and takers, and the risks a market maker carries.
- [Adverse selection and informed trading](https://quantsandbox.dev/guide/microstructure/adverse-selection): Why trading with someone who knows more costs money, markouts as the measure of that cost, toxic flow, and how informed traders change the best spread.
- [Market making profit and loss attribution](https://quantsandbox.dev/guide/microstructure/market-making-pnl): Splitting a maker's P&L into spread capture, adverse selection, inventory and fees, with markout curves, fill ratios and the numbers a desk watches.
- [Inventory risk and quote skewing](https://quantsandbox.dev/guide/microstructure/inventory-risk): How a maker's position turns price moves into P&L, why that risk grows with position and time, and how shading both quotes pulls inventory back to zero.

Open the interactive tool: https://quantsandbox.dev/market-making
