Rajandran R Creator of OpenAlgo - OpenSource Algo Trading framework for Indian Traders. Building GenAI Applications. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Building Algo Platforms, Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in

Understanding Market Making & Inventory Management: A Trader’s Guide

11 min read

What Is Market Making?

Imagine you run a currency exchange booth at an international airport. Travelers come to you wanting to exchange rupees for dollars and vice versa. Here’s how you actually make money:

  • The official mid-market exchange rate is ₹87.00 per dollar
  • But you BUY dollars from travelers at only ₹86.00 (below market rate)
  • And you SELL dollars to travelers at ₹88.00 (above market rate)

Your ₹2.00 spread represents a profit of about 2.3% on each transaction. Plus, you might add a “service fee” of ₹50 per transaction regardless of amount.

Throughout the day, your rates shift based on:

  • Your current inventory (if you’re running low on dollars, you offer less attractive rates to buyers)
  • Market movements (if the rupee weakens against the dollar, you quickly adjust both rates)
  • Competition from nearby exchange booths

When you accumulate too many rupees, you might contact your wholesaler to exchange them back to dollars at a rate slightly worse than the mid-market rate – another small cost of doing business.

Market making in stocks works on these exact same principles. Market makers quote prices slightly away from the true market value, manage their inventory of shares, and constantly adjust their quotes based on their positions and market conditions. The spread between their buy and sell prices is their primary source of profit.

Market Making with Reliance Shares

Let’s say Reliance stock is currently trading at ₹1,246. As a market maker, you are willing to:

  • BUY Reliance shares from sellers at ₹1,245 (your “bid” price)
  • SELL Reliance shares to buyers at ₹1,247 (your “ask” price)

Your profit comes from this ₹2 spread. If people buy and sell equally throughout the day, you earn ₹2 per share traded.

The Reality: Transaction Costs and Breakeven Points

Every market maker faces transaction costs that eat into spreads. Looking at real charges from Zerodha Brokerage calculator:

For 100 Shares (Buy & Sell at ₹1,240):

  • Total transaction costs: ₹91.49
  • Points needed to breakeven: 0.91 points
  • Wider spread needs to be quoted for breakeven

For 1000 Shares (Buy & Sell at ₹1,240):

  • Total transaction costs: ₹486.97
  • Points needed to breakeven: 0.49 points
  • tight spreads can be quoted for breakeven

This illustrates a critical insight: larger turnover reduce your per-share breakeven point (0.91 points for 100 shares vs. 0.49 points for 1000 shares). A market maker trading performing larger turnover can profitably work with tighter spreads.

What Exactly Is “Trading Inventory” for Market Makers?

Unlike regular traders who take directional positions, market makers accumulate inventory as a byproduct of their activity.

Trading inventory is simply the net quantity of shares you hold at any given moment as a result of your market making activity.

Examples of Inventory Positions

  • Positive Inventory (Long): You’ve bought 6,000 Reliance shares but only sold 4,000 = +2,000 shares
  • Negative Inventory (Short): You’ve sold 5,000 Reliance shares but only bought 3,500 = -1,500 shares
  • Neutral Inventory: You’ve bought and sold equal amounts = 0 shares (the ideal state)

Order Types Used by Market Makers

Market makers use different order types depending on their inventory situation:

1. During Inventory Accumulation (Building Positions)

When market makers are comfortable taking on inventory, they typically use:

  • Passive Limit Orders: Orders placed away from the current market price
    • Example: Placing buy orders at ₹1,245 when Reliance is trading at ₹1,246
    • These orders wait for the market to come to them
    • Lower risk of execution but higher chance of getting the desired price
  • Layered Orders: Multiple orders at different price levels
    • Example: Buy 200 shares at ₹1,245, 300 at ₹1,244.50, 500 at ₹1,244
    • Creates a “ladder” of potential executions
    • Allows capture of more volume during price movements
  • Resting Orders: Orders that stay in the market for longer periods
    • Typically left in place until executed or consciously canceled
    • Helps maintain consistent market presence

2. During Inventory Adjustment (Rebalancing)

When inventory reaches concerning levels, market makers shift to:

  • More Aggressive Limit Orders: Orders placed closer to or at current market prices
    • Example: If long 3,000 Reliance shares, placing sell orders at ₹1,246 instead of ₹1,247
    • These orders have higher execution probability
  • Order Size Adjustments: Changing the relative sizes of buy vs. sell orders
    • Example: If long inventory, placing sell orders of 500 shares but buy orders of only 200
    • This naturally creates imbalance toward desired inventory direction
  • Quote Skewing: Shifting both bid and ask prices in one direction
    • Example: If long, moving from Buy@₹1,245/Sell@₹1,247 to Buy@₹1,244/Sell@₹1,246
    • Encourages market participants to trade in ways that reduce your inventory
  • Frequent Order Updates: Canceling and replacing orders more regularly
    • Adjusting prices every few seconds in response to market movements
    • Ensures orders remain optimally positioned for inventory reduction

3. During Inventory Liquidation (Reducing Positions)

When inventory needs rapid reduction (like near market close), market makers employ:

  • Aggressive Orders: Orders designed for immediate execution
    • Market orders: Accept current best available price to ensure execution
    • Marketable limit orders: Set at or beyond current market price to maximize execution chance
  • Hidden/Iceberg Orders: Large orders that show only a portion to the market
    • Example: Selling 2,000 shares but only showing 200 at a time
    • Helps prevent market impact while liquidating large inventory
  • Time-Sensitive Execution: Increasing aggression as time constraints approach
    • Example: At 3:15 PM, crossing the spread to ensure position reduction before market close
    • Willing to sacrifice some spread profit to reduce overnight risk
  • Opportunistic Orders: Taking advantage of temporary price improvements
    • Example: If trying to sell inventory and market briefly moves up, quickly placing larger sell orders
    • Requires constant monitoring and rapid execution

How Market Makers Manage Inventory Throughout the Trading Day

Morning Session (9:15 AM – 11:00 AM)

During market open, volatility is typically higher and market makers focus on:

  • Setting initial spreads: Often wider due to opening volatility
  • Position building: Willing to accumulate some inventory as price discovery happens
  • Monitoring order flow: Identifying which side (buy or sell) has more pressure

Strategy: Moderate inventory limits, slightly wider spreads

Example:

  • Starting with zero Reliance shares
  • Morning quotes: Buy@₹1,244.50, Sell@₹1,247.50 (₹3 spread)
  • Acceptable inventory range: ±3,000 shares
  • Order Approach: Primarily passive limit orders with occasional adjustments

Midday Session (11:00 AM – 2:00 PM)

The middle of the trading day usually has:

  • Lower volatility: Markets settle into a rhythm
  • More balanced flow: Institutional trading often occurs in this window
  • Time to adjust: Enough hours left to manage accumulated inventory

Strategy: Tighter spreads, manage growing inventory positions

Example:

  • By noon, you’ve accumulated +2,500 Reliance shares
  • To reduce inventory, you adjust quotes: Buy@₹1,244, Sell@₹1,246.50
  • The lowered sell price attracts more buyers to help reduce your inventory
  • Order Approach: Mix of passive and slightly aggressive orders, more frequent quote adjustments

Closing Session (2:00 PM – 3:30 PM)

As the market close approaches:

  • Inventory reduction becomes priority: Lower risk for overnight
  • Spreads may widen again: End-of-day volatility
  • More aggressive rebalancing: Willingness to cross the spread to reduce large positions

Strategy: Focus on inventory reduction, possibly sacrifice some spread profit

Example:

  • At 2:30 PM, you still have +1,800 Reliance shares
  • Your adjusted quotes: Buy@₹1,243, Sell@₹1,245.50
  • If inventory remains high by 3:15 PM, you might sell 800 shares at market price to reduce risk
  • Order Approach: Increasingly aggressive orders, including marketable limits or market orders

Overnight Inventory: Yes or No?

Should Market Makers Hold Overnight Positions?

The answer depends on:

  • Your capital: Larger firms can handle more overnight risk
  • Stock characteristics: Less volatile stocks pose lower overnight risk
  • Market conditions: Avoid overnight positions before major events

Typical Approaches

  1. Zero Overnight: Many market makers aim for zero or minimal overnight inventory
    • Advantage: No exposure to overnight gaps or news
    • Disadvantage: May require aggressive (unprofitable) trades near close
    • Order Strategy: Very aggressive liquidation orders in final 15-30 minutes
  2. Reduced Overnight: Keep no more than 20-30% of normal day inventory
    • Advantage: Some flexibility at close, less pressure
    • Disadvantage: Still exposed to overnight risk
    • Order Strategy: Moderately aggressive orders with price limits
  3. Strategic Overnight: Maintain inventory in specific situations
    • Example: If markets were trending strongly all day, small position in trend direction
    • Requires strict risk management and size limitations
    • Order Strategy: Selective reduction using limit orders at favorable prices

Inventory Risks and How to Mitigate Them

Major Inventory Risks

  1. Price Movement Risk: Stock moves against your inventory position
    • Example: Holding +3,000 Reliance shares and price drops 2%
  2. Gap Risk: Overnight news causes stock to open significantly away from previous close
    • Example: Reliance announces disappointing earnings after market hours
  3. Liquidity Risk: Unable to reduce inventory without significant price impact
    • Example: Accumulating too much inventory in a thinly traded stock
  4. Volatility Risk: Sudden increase in stock volatility widens your risk
    • Example: Market uncertainty causes Reliance to swing 3-4% intraday

Mitigation Strategies

  1. Position Limits: Set maximum inventory thresholds
    • Example: Never exceed ±5,000 Reliance shares
    • Order Implementation: Automatic triggers for aggressive reduction orders when approaching limits
  2. Dynamic Quote Adjustment: Automatically adjust prices based on inventory
    • When long: Lower both bid and ask to encourage selling
    • When short: Raise both bid and ask to encourage buying
    • Order Implementation: Systematic skewing of order prices based on inventory levels
  3. Inventory Reduction Triggers: Create rules for forced reduction
    • Example: If inventory exceeds 80% of limit, reduce by 30% within next 30 minutes
    • Order Implementation: Pre-planned aggressive orders that activate at specific inventory thresholds
  4. Diversification: Spread market making activity across multiple stocks
    • Reduces risk from single-stock exposure
    • Order Implementation: Coordinated order management across multiple symbols
  5. Hedging: Use index futures or options to hedge overall market risk
    • Example: If long 5,000 Reliance shares, consider Nifty futures hedge
    • Order Implementation: Correlated hedging orders in futures/options markets

How Two-Way Auction Process Helps Market Makers

Market making fundamentally relies on the continuous two-way auction process of modern markets:

What Is a Two-Way Auction?

Simply put, it’s a market where buyers and sellers can express their interest simultaneously through bids (buy orders) and asks (sell orders).

How It Benefits Market Makers

  1. Price Discovery: The auction process naturally reveals the “fair price”
    • Helps market makers set reasonable bid-ask spreads
    • Reduces risk of quoting far from true market value
    • Order Benefit: Allows for more confident passive order placement
  2. Order Flow Information: Seeing the order book provides valuable signals
    • More buyers than sellers? Might want to raise your quotes
    • More sellers than buyers? Might want to lower your quotes
    • This “order imbalance” information helps manage inventory proactively
    • Order Benefit: Informs optimal order positioning and adjustment timing
  3. Liquidity Attraction: By providing tight spreads, you attract more traders
    • More traders = more volume = more spread-capturing opportunities
    • Creates a virtuous cycle for market makers
    • Order Benefit: Higher fill rates and more frequent opportunities to balance inventory

Skills Required to Become a Market Maker

Successful market makers need a combination of skills:

1. Technical Skills

  • Programming Knowledge: Ability to automate order placement, cancellation, and modification
    • Python, Java, or C++ are commonly used
    • Understanding of APIs and data structures
  • Data Analysis: Ability to analyze market data and trading patterns
    • Statistical analysis capabilities
    • Pattern recognition
  • Risk Management Mathematics: Understanding probability, statistics, and financial math
    • Calculating optimal position sizes
    • Quantifying inventory risk

2. Market Knowledge

  • Market Microstructure: Understanding order types, market mechanisms, and exchange rules
    • How auctions work in electronic markets
    • Order matching priorities
  • Stock Behavior Patterns: Knowledge of how specific stocks tend to trade
    • Volatility patterns
    • Liquidity characteristics
    • Typical spread sizes
  • Sector Relationships: Understanding correlations between related stocks
    • Sector-wide movements
    • Pairs trading opportunities

3. Psychological Attributes

  • Mental Discipline: Ability to follow systematic rules without emotion
    • Not getting attached to positions
    • Following inventory management rules strictly
  • Quick Decision Making: Processing information and acting rapidly
    • Reacting to sudden market moves
    • Making split-second inventory decisions
  • Stress Management: Handling pressure of continuous trading
    • Remaining calm during volatile markets
    • Managing through losses

Can We Do Market Making Using Broker APIs or Is HFT Required?

Market Making via Broker APIs

Yes, market making can be done using standard broker APIs, but with limitations:

Advantages:

  • Lower Barrier to Entry: Uses existing broker infrastructure
  • Lower Cost: No need for specialized hardware or colocation
  • Simplicity: Easier implementation and maintenance

Disadvantages:

  • Higher Latency: 100-1000ms response times (vs microseconds for HFT)
  • Limited Order Volume: API rate limits restrict order updates. Typically 10-25 orders per second
  • Wider Spreads Required: Need to work with larger minimum spreads to be profitable
  • Execution Uncertainty: Less control over exact execution timing

Best for:

  • Less liquid stocks with naturally wider spreads
  • Longer timeframe market making (minutes instead of milliseconds)
  • Lower frequency of order updates
  • Traders starting with modest capital

HFT (High-Frequency Trading) Market Making

Advantages:

  • Ultra-Low Latency: Microsecond response times
  • Higher Order Volume: Thousands of orders per second
  • Tighter Spreads: Can profitably work with minimal spreads
  • Better Inventory Control: Faster reaction to market changes

Disadvantages:

  • High Infrastructure Costs: Specialized hardware, colocation, direct exchange connectivity
  • Technical Complexity: Advanced programming and optimization required
  • Higher Operational Costs: Data feeds, infrastructure maintenance
  • Regulatory Scrutiny: More regulatory requirements and attention

Best for:

  • Highly liquid stocks with tight spreads
  • High-volume trading environments
  • Well-capitalized operations
  • Sophisticated trading operations

Middle Ground: Semi-Automated Market Making

Many individual traders and small firms operate in the middle:

  • Use broker APIs but with custom optimization
  • Focus on stocks with medium liquidity
  • Employ strategic order placement rather than raw speed
  • Balance automation with human oversight

Platform Stability Requirements for Market Making

Platform stability is absolutely critical for market making. Here’s what you need:

1. Connection Reliability

  • Minimal Downtime: Less than 0.1% downtime during market hours
    • Even brief outages can leave inventory exposed
    • Can result in significant losses during market moves
  • Failover Systems: Backup connections and systems
    • Secondary internet connections
    • Backup power sources
    • Alternative trading platforms ready for emergency use

2. Order Execution Quality

  • Minimal Slippage: Orders executed at or near expected prices
    • Critical for maintaining expected spreads
    • Directly impacts profitability
  • Consistent Fill Rates: Predictable order execution
    • Allows for reliable inventory planning
    • Prevents unexpected inventory accumulation

3. Platform Performance

  • Low Latency: Fast order execution and updates
    • Sub-second response for retail platforms
    • Millisecond response for professional platforms
  • High Throughput: Ability to handle many orders quickly
    • Minimum 10-20 orders per minute for basic market making
    • Much higher rates for active strategies
  • Reliable Order Cancellation: Quick and dependable order removal
    • Critical for risk management
    • Prevents unwanted executions in fast-moving markets

4. API Robustness

  • Rate Limiting Transparency: Clear documentation of API call limits
    • Understanding maximum order update frequency
    • Planning strategies within platform constraints
  • Error Handling: Clear feedback on order issues
    • Immediate notification of rejected orders
    • Detailed error messages for troubleshooting
  • Consistent Behavior: Predictable API responses
    • Same input produces same outcome
    • No unexpected behaviors during market stress

Major Advantages of Market Making

Market making offers several advantages compared to directional trading:

1. Financial Advantages

  • Consistent Revenue Stream: Income from bid-ask spread rather than directional bets
    • More predictable earnings pattern
    • Less dependent on market direction
  • Higher Sharpe Ratio: Better risk-adjusted returns
    • Typically lower volatility of returns
    • More consistent daily profitability
  • Volume Discounts: Often qualifies for reduced fees
    • Exchange rebates for liquidity provision
    • Lower per-trade costs with high volume

2. Risk Management Advantages

  • Limited Overnight Exposure: Typically reduced or zero overnight positions
    • Less exposure to gap risk
    • Lower capital requirements for margin
  • Diversification Opportunity: Can market make across multiple stocks
    • Natural diversification of risk
    • Less correlation with overall market direction
  • Self-Hedging Nature: Buy and sell activities partially hedge each other
    • Natural offsetting of market risk
    • Built-in risk reduction mechanism

3. Psychological Advantages

  • System-Driven Approach: Less emotional decision making
    • Trading based on spreads and inventory, not market predictions
    • Reduced psychological stress from “being right” about direction
  • Clear Performance Metrics: Easily measured success factors
    • Spread capture rates
    • Inventory management efficiency
    • Transaction cost analysis
  • Skill-Based Results: Success depends more on execution than prediction
    • Rewards process discipline over speculative ability
    • More similar to running a business than gambling

A Day in the Life of a Reliance Market Maker

9:15 AM: Market Opens

  • Reliance opens at ₹1,246
  • Initial quotes: Buy@₹1,245, Sell@₹1,247
  • Order Strategy: Place symmetrical limit orders (500 shares on each side)
  • First hour trading: Buy 2,000 shares, Sell 1,200 shares
  • Inventory: +800 shares

11:30 AM: News Released

  • Reliance announces new partnership
  • More buyers enter the market
  • You adjust quotes to: Buy@₹1,244.50, Sell@₹1,247.50
  • Order Strategy: Reduce buy order size to 300 shares, increase sell order size to 700 shares
  • Trading: Buy 1,500 more shares, Sell 2,800 shares
  • Inventory: -500 shares (now short)

1:00 PM: Managing Short Position

  • Being short, you adjust quotes to: Buy@₹1,245.50, Sell@₹1,248
  • The higher bid attracts sellers
  • Order Strategy: Increase buy order size to 800 shares, decrease sell order size to 300 shares
  • Trading: Buy 1,800 shares, Sell 700 shares
  • Inventory: +600 shares (now long)

3:00 PM: Approaching Close

  • With moderate long inventory, you adjust: Buy@₹1,244, Sell@₹1,246
  • Focus on reducing position before close
  • Order Strategy: Minimal buy orders (100 shares), aggressive sell orders (1,000 shares) with some placed at market
  • Last 30 minutes: Buy 400 shares, Sell 800 shares
  • Final inventory: +200 shares (small overnight position)

Day Results:

  • Total bought: 5,700 shares
  • Total sold: 5,500 shares
  • Average spread captured: ₹2 per share
  • Gross profit: ~₹11,000
  • Transaction costs: ~₹10,064 (110 total trades)
  • Net profit: ~₹936 plus/minus overnight value change on 200 shares

Tips for Traders Considering Market Making

  1. Start Small: Begin with one liquid stock and modest inventory limits
    • Example: Market make only Reliance with ±1,000 share limit
  2. Monitor Your Inventory Constantly: Use real-time dashboards
    • Know your position at all times
    • Set alerts for inventory thresholds
  3. Understand Each Stock’s Behavior:
    • Some stocks have predictable intraday patterns
    • Some have regular buy/sell imbalances at certain times
    • This knowledge helps manage inventory better
  4. Test Different Times of Day:
    • Morning sessions often have more volatility = wider spreads but more inventory risk
    • Midday may have less volume but more balanced flow
    • Find your optimal trading windows
  5. Be Disciplined About Closing Inventory:
    • Set a “maximum overnight position” and stick to it
    • Be willing to take small losses to avoid large overnight risks
  6. Master Order Management:
    • Learn when to use passive versus aggressive orders
    • Develop rules for order size adjustments based on inventory
    • Create systems for automatic order adjustments as inventory changes
  7. Scale Your Strategy Appropriately:
    • Trade sizes large enough to overcome transaction costs (minimum 100 shares)
    • Understand your breakeven point per stock
    • Widen spreads for less liquid names
  8. Start with API-Based Market Making:
    • Begin with broker APIs before considering HFT
    • Focus on stocks with wider natural spreads
    • Build skills before investing in expensive infrastructure

Conclusion: The Art of Inventory Management

Successful market making isn’t about predicting if Reliance will go up or down. It’s about:

  • Providing liquidity to both sides of the market
  • Capturing the bid-ask spread as compensation for that service
  • Managing inventory risk throughout the day
  • Understanding order flow and price discovery dynamics
  • Using the right order types and placement strategies for each inventory situation
  • Scaling trade sizes to overcome transaction costs
  • Building the technical and psychological skills needed for the discipline

By focusing on these principles rather than directional trading, market makers can generate consistent profits while providing a valuable service to the market. The key is disciplined inventory management, strategic order placement, and understanding the mechanics of the two-way auction process that drives modern markets.

In our next blog, we’ll explore advanced techniques including the Avellaneda-Stoikov model, which provides mathematical precision to these market making principles.

Rajandran R Creator of OpenAlgo - OpenSource Algo Trading framework for Indian Traders. Building GenAI Applications. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Building Algo Platforms, Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in

Why Your Stop-Loss Orders Are Secret But Still Getting…

When trading in the markets, two critical concepts often come into play: the Order Book and the Stop-Loss Book. Understanding the difference between these...
Rajandran R
4 min read

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More