Small Group Tutorials

Here to help students catch up, keep up, and move ahead. Book a consultation here.

How Bank Market-Making Algorithms Manage Inventory: Bid-Ask Spreads, Order Flow, Adverse Selection, Risk Limits and Market Liquidity

Quick answer: a market maker continuously offers to buy and sell while controlling the risk created when customer or market order flow pushes its inventory away from neutral. The algorithm decides where to quote, how much size to show, when to widen or narrow spreads, and when inventory, volatility, capital or market-access constraints require less risk. The mathematics combines inventory control, stochastic prices, order-arrival models, adverse selection, expected profit, transaction costs and hard risk limits. A good market-making model does not merely maximise spread capture; it balances liquidity provision against the possibility that informed order flow, fast price moves or accumulated inventory makes the next quote dangerous.

A market maker earns from standing ready to trade, but every filled quote changes the inventory it must carry into the next uncertain price move.

Page role: this article owns the mechanics of liquidity provision and dealer inventory. How Bank Market-Surveillance Algorithms Detect Manipulation owns detection of abusive trading behaviour. How Banks Measure Market Risk owns the broader VaR/Expected-Shortfall risk framework. This page asks how a dealer or bank-affiliated market-making desk controls the inventory it creates while providing two-sided liquidity.

Safety boundary: the article uses public mathematical models and regulatory principles for education. It does not provide live trading signals, venue-specific tactics, manipulation techniques or instructions for exploiting market participants.

1. A market maker quotes two prices

The market maker posts or communicates:

  • bid — the price at which it is willing to buy;
  • ask — the price at which it is willing to sell.

The quoted spread is:

Spread = Ask − Bid.

If the mid-price is 100.00, a bid of 99.98 and ask of 100.02 imply a four-cent quoted spread. If both sides trade equally and prices do not move adversely, the dealer can earn part of that spread. Real markets are harder because fills are not symmetric and the price often moves after a trade.

2. The first hidden variable is inventory

Let q be the dealer’s signed inventory. Positive q means the dealer is long; negative q means short.

Inventory changes with trades:

qt+1 = qt + buys from customers − sells to customers.

If customer flow repeatedly sells to the dealer, q becomes increasingly positive. The desk is now exposed to a price fall even if every individual trade was executed at a sensible spread.

The market-making problem is therefore dynamic. Each trade changes the state from which the next decision begins.

3. Inventory risk creates a reason to skew quotes

Suppose the dealer is already long. It can make buying less attractive and selling more attractive by moving its quotes:

  • lower the bid or reduce bid size;
  • make the ask relatively more attractive;
  • reduce overall size if inventory is near a risk limit.

A simplified reservation-price idea is:

Reservation price ≈ mid-price − inventory × risk sensitivity × expected future variance.

When inventory is positive, the dealer’s internal indifference price can move below the public mid-price because another unit of long inventory is less desirable. The exact functional form differs across models; the mechanism is the important part.

4. Spread compensates for more than order-processing cost

A teaching decomposition of the spread contains several components:

  • operational and venue costs;
  • inventory risk;
  • adverse-selection risk;
  • capital or balance-sheet usage;
  • liquidity/hedging cost;
  • uncertainty about the true current price.

The observed spread is not a pure profit margin. If the dealer buys just before the market falls, the spread earned can be smaller than the subsequent inventory loss.

5. Adverse selection means the trade itself contains information

Imagine a dealer repeatedly buys from sellers immediately before prices decline. The dealer is not merely unlucky; it may be trading against counterparties who act faster on information.

The SEC has long used realised-spread and price-impact concepts to separate apparent execution revenue from losses caused by adverse selection. A quote can look profitable at the instant of trade and unprofitable after the market moves.

A simple diagnostic is:

Realised spread after horizon h = trade-side revenue relative to the mid-price observed h later.

If realised spread collapses while quoted spread remains wide, informed or toxic flow may be consuming the apparent margin.

6. Order-arrival probability depends on quote distance

A quote close to the mid-price is more likely to trade but earns less spread. A quote far away earns more if filled but may never execute.

A stylised arrival model is:

λ(δ) = A·exp(−kδ)

where δ is distance from the mid-price, A represents baseline order-flow intensity and k measures how quickly fill probability falls as the quote moves away.

The market maker therefore chooses between:

  • tight quote → high fill probability, low spread, faster inventory change;
  • wide quote → low fill probability, high spread, slower inventory change.

This is an optimisation under uncertain arrivals, not a fixed “best spread.”

7. Volatility should widen the price of waiting

If the underlying price is moving rapidly, inventory becomes more dangerous between the time a quote is posted and the time the position is hedged or unwound.

In many models:

higher expected variance → larger inventory penalty → wider optimal spread or smaller quoted size.

This is one reason market liquidity can deteriorate during stress: the same volatility that increases demand for liquidity also increases the risk of supplying it.

8. Market depth is a capacity measure, not merely a price measure

A market can display a narrow best bid-ask spread but very little size behind those prices. For a large order, the relevant cost depends on depth across multiple price levels.

Useful liquidity measures therefore include:

  • quoted spread;
  • effective spread;
  • market depth;
  • price impact;
  • order-book resiliency;
  • trade size relative to normal depth.

The New York Fed’s April 2026 review of Treasury-market liquidity tracks both bid-ask spreads and order-book depth because either measure alone can miss deterioration. See Treasury Market Liquidity Since April 2025.

9. Dealer balance-sheet capacity can become the hidden market-liquidity constraint

Bank-affiliated dealers cannot expand inventory without limit. Their positions consume risk limits, leverage exposure, capital, funding and management attention.

Federal Reserve research has found that when volatility is high and internal or regulatory constraints become binding, dealer capacity to intermediate Treasury and agency-MBS markets can weaken. See Assessment of Dealer Capacity to Intermediate in Treasury and Agency MBS Markets.

A market-making algorithm should therefore know not just trade-level P&L but the scarce balance-sheet resource consumed by inventory.

10. Capital constraints can turn low-risk securities into high-capacity activities

Government securities can have low credit risk but require enormous gross balance-sheet volume to support large two-way markets. A leverage constraint is sensitive to exposure size, not only credit risk.

This creates a counterintuitive possibility:

low-credit-risk asset + very large trading volume → material balance-sheet constraint.

The New York Fed’s research on dealer capacity shows that Treasury-market functioning can deteriorate when dealer balance-sheet utilisation becomes sufficiently high, even though Treasury securities remain high-quality instruments. See Dealer Capacity and U.S. Treasury Market Functionality.

11. Order flow transmits inventory constraints into price

If customers collectively sell bonds to dealers, dealer inventories rise. Dealers may respond by lowering bids, widening spreads or reducing size. That price concession attracts other buyers or slows further selling.

New York Fed research revised in July 2026 found that net order flow helps explain Treasury auction-day price pressure and that the pressure strengthens when dealers face tighter risk-bearing constraints. See Intraday Price Pressure and Order Flow Around U.S. Treasury Auctions.

The mechanism is important: dealer constraints do not stay inside the dealer. They can propagate into transaction prices through the quotes required to absorb more inventory.

12. An objective function makes the trade-off explicit

A simplified market-making objective over a short horizon can be written:

Maximise expected spread revenue − inventory-risk penalty − adverse-selection loss − transaction/hedging cost − capital/funding cost.

subject to:

  • inventory limits;
  • position and sensitivity limits;
  • market-access controls;
  • capital or leverage constraints;
  • venue and conduct rules;
  • operational latency and system constraints.

This makes clear why “maximise spread” is incomplete. The spread is revenue before the risk created by being filled.

13. Hard risk limits must sit outside the optimiser

An optimiser can always find a theoretical reason to take a little more risk if expected profit is high enough. A production system therefore needs non-negotiable controls such as:

  • maximum position;
  • maximum DV01 or other sensitivity;
  • maximum gross notional;
  • maximum order size;
  • price collars;
  • loss limits;
  • kill switches and manual escalation.

For US securities markets, SEC Rule 15c3-5 requires broker-dealers with market access to maintain financial and regulatory risk controls designed to prevent orders that exceed appropriate preset credit or capital thresholds or appear erroneous. See SEC — Risk Management Controls for Brokers or Dealers With Market Access.

14. A risk limit is not an alpha signal

If an inventory limit causes the desk to reduce bid size, that does not mean the algorithm “predicts the market will fall.” It means the desk has reached its permitted capacity to absorb more long inventory.

This distinction protects model interpretation:

  • forecast model — predicts future price/order flow;
  • inventory controller — changes behaviour because current exposure is large;
  • hard risk limit — prevents action regardless of forecast.

Collapsing these into one score makes it difficult to know whether a quote changed because of information or simply because the desk was full.

15. Continuous liquidity obligations can change the optimisation

Some regulatory or venue frameworks impose obligations on firms pursuing market-making strategies. Under MiFID II Article 17, an algorithmic trader pursuing a market-making strategy must, subject to the instrument and market, provide liquidity on a regular and predictable basis for a specified proportion of trading hours and maintain systems and controls.

See ESMA — MiFID II Article 17.

This means the optimisation can have a service constraint:

provide quotes sufficiently often while remaining inside risk capacity.

Liquidity provision is therefore not always optional moment by moment.

16. Hedging inventory transfers risk rather than erasing it

A dealer long a corporate bond can hedge interest-rate risk with government securities or swaps and perhaps hedge credit spread risk with related instruments. But the hedge can introduce basis risk because the hedge does not move exactly with the original position.

A residual-risk vector might include:

  • duration/DV01;
  • credit spread sensitivity;
  • curve risk;
  • basis risk;
  • optionality;
  • funding and collateral needs.

Inventory control should therefore optimise the residual hedge-adjusted risk, not only raw notional.

For interest-rate hedge construction, see How Banks Construct Interest-Rate Hedges.

17. A simple inventory-control example

Suppose a dealer has a target inventory of zero and a hard limit of ±100 units.

  • At q=0, it quotes symmetrically around the mid-price.
  • At q=+50, it mildly lowers its reservation price and prefers customer buying that reduces the long position.
  • At q=+90, it reduces bid size and increases the urgency of hedging or inventory reduction.
  • At q=+100, the hard limit prevents additional long risk regardless of the statistical forecast.

The exact quote levels are intentionally omitted because production thresholds depend on instrument, liquidity, venue, regulation and firm policy. The important computation is state-dependent control as q approaches the boundary.

18. Market-making P&L should be decomposed

Total desk P&L can be misleading if a directional market move makes a poorly controlled inventory look profitable. A stronger decomposition separates:

  • spread capture;
  • inventory mark-to-market;
  • hedging P&L;
  • fees and transaction costs;
  • funding/capital cost;
  • adverse-selection loss;
  • model or valuation changes.

If a desk earns money because it happened to be long into a rally, that is not proof its market-making algorithm is good at liquidity provision.

19. Stress behaviour is part of the model, not an exception to it

During stress, volatility rises, spreads widen, market depth falls and customer order flow can become one-sided. At the same time, internal risk limits become more likely to bind.

The Federal Reserve’s account of March 2020 Treasury and MBS conditions showed dealers absorbing large amounts of securities while balance-sheet constraints and volatility impaired intermediation; market depth fell and spreads became more volatile even in normally liquid markets.

A robust market-making model therefore needs a stress state in which:

  • fill probabilities change;
  • hedges become more expensive;
  • order flow becomes correlated;
  • inventory takes longer to unwind;
  • risk limits tighten or bind.

20. Creative-work lens: a shop that must keep buying what customers sell

Imagine a shop promising to buy and sell a commodity all day. If customers suddenly all sell to the shop, its shelves fill. The shop may lower its buying price, raise its selling attractiveness and reduce how much more it will accept. If it refuses every customer immediately, it stops being a useful market. If it accepts everything without limits, it can fail from inventory risk.

That tension is market making in miniature: provide continuity without pretending capacity is infinite.

21. The market-making algorithmic pipeline

  1. Read current market state and reference price.
  2. Estimate volatility, depth and order-flow conditions.
  3. Read current inventory and risk sensitivities.
  4. Calculate a reservation price adjusted for inventory risk.
  5. Estimate fill probability versus quote distance.
  6. Estimate adverse-selection and hedging cost.
  7. Choose quote spread and size within policy constraints.
  8. Apply hard pre-trade credit, capital and position controls.
  9. Process fills and update inventory immediately.
  10. Hedge or transfer residual risk where appropriate.
  11. Recalculate quotes as state changes.
  12. Decompose realised P&L and price impact.
  13. Stress one-sided order flow and reduced market depth.
  14. Recalibrate only after checking whether the market regime has changed.

22. Failure modes

  • Spread-profit illusion. Quoted spread is treated as profit before adverse selection and inventory loss.
  • Inventory blindness. Each trade is priced independently of accumulated position.
  • Static fill model. Order-arrival probabilities remain fixed during volatility or venue changes.
  • Notional-only limits. Position size is measured without duration, spread or option sensitivity.
  • Directional P&L confusion. A lucky market move is mistaken for successful market making.
  • Capital omission. Dealer balance-sheet usage is assumed free.
  • Stress extrapolation. Normal market depth is assumed available when everyone is selling.
  • Optimiser authority. A model is allowed to override hard regulatory or firm risk controls.

23. Diagnostics and falsifiers

  • How does realised spread compare with quoted and effective spread?
  • Does adverse price movement systematically follow fills on one side?
  • How quickly does inventory mean-revert after one-sided customer flow?
  • Which risk limit binds most often?
  • How much desk P&L comes from spread capture versus directional inventory?
  • Does the fill-probability model remain calibrated when volatility doubles?
  • How much market depth disappears before the model reduces size?
  • What evidence would show that a tight spread is actually underpricing adverse selection?

Suppose someone claims, “The market-making algorithm is successful because it earns the bid-ask spread on most trades.” A falsifier is evidence that prices systematically move against the dealer after those fills, making realised spread negative. Execution revenue must be evaluated after information and inventory effects.

24. Verification and update triggers

  • backtest fill probabilities by quote distance and regime;
  • compare quoted, effective and realised spreads;
  • measure post-trade price impact and adverse selection;
  • reconcile position and sensitivity limits independently;
  • stress market depth, volatility and one-sided flow together;
  • review pre-trade controls at least as required by applicable rules and firm governance;
  • recalibrate after venue, market-structure or product changes;
  • keep surveillance and market-making optimisation independent enough that one cannot rationalise the other’s anomalies.

Connections across the finance-and-banking algorithms lane

Research anchors

The deeper lesson

Market making is the mathematics of being available without being unlimited. The spread prices immediacy. Inventory records the cost of past fills. Order flow carries information. Volatility changes the cost of holding risk. Capital and balance-sheet constraints limit how much liquidity a dealer can absorb. Hard controls bound the optimiser. A strong market-making system therefore does not ask only “What price should I quote?” It asks “What state will I be in if this quote trades, and can the institution still carry that state if the market moves against it?”

Educational note: This article explains public market-microstructure and bank-dealer risk mathematics. It is not trading advice, an execution strategy, or a recommendation to buy or sell any security.

Discover more from Bukit Timah Tutor

Subscribe now to keep reading and get access to the full archive.

Continue reading