Skip to main content

Overview

The MarketMakerStrategy provides a complete market-making implementation with:
  • Automated quote generation and management
  • Inventory-based price skewing
  • Position limits and risk controls
  • Multi-level quoting support

MarketMakerConfig

Configure your market-making strategy with MarketMakerConfig:
Location: nano-strategy/src/market_maker.rs:12-32

Default Configuration

Location: nano-strategy/src/market_maker.rs:34-48

Creating a Market Maker

Inventory Skewing

The market maker automatically adjusts quote prices based on inventory to reduce risk:
Location: nano-strategy/src/market_maker.rs:196-222

How Inventory Skewing Works

  1. Neutral Position (inventory = 0)
    • Quotes are symmetric around mid price
    • Bid: mid - half_spread
    • Ask: mid + half_spread
  2. Long Position (inventory > 0)
    • Bid is lowered (less aggressive buying)
    • Ask is lowered (more aggressive selling)
    • Encourages reducing inventory
  3. Short Position (inventory < 0)
    • Bid is raised (more aggressive buying)
    • Ask is raised (less aggressive selling)
    • Encourages covering short

Example

Quote Management

The QuoteManager tracks all active orders:
Location: nano-strategy/src/market_maker.rs:51-61

Key Methods

Location: nano-strategy/src/market_maker.rs:63-164

Multi-Level Quoting

Generate quotes at multiple price levels:
Location: nano-strategy/src/market_maker.rs:254-322

Level Spacing

With num_levels = 3 and tick_size = 25:

Position Limits

The strategy respects position limits:
Location: nano-strategy/src/market_maker.rs:266-269

Quote Refreshing

Quotes are refreshed periodically:
Location: nano-strategy/src/market_maker.rs:224-227, 348-366

Canceling Stale Quotes

Orders too far from the best bid/offer are cancelled:
Location: nano-strategy/src/market_maker.rs:229-252

Complete Example

Monitoring

Access strategy state:

Best Practices

  1. Start with wider spreads - Use base_spread_ticks >= 2 to ensure profitability
  2. Tune inventory skewing - Adjust inventory_skew_factor based on market volatility:
    • Higher volatility → stronger skewing (0.7-1.0)
    • Lower volatility → gentler skewing (0.3-0.5)
  3. Set appropriate position limits - Don’t exceed your risk tolerance:
  4. Monitor fill rates - If fills are too low, tighten spreads or increase levels
  5. Use appropriate refresh intervals - Balance between:
    • Faster updates (50-100ms) for active markets
    • Slower updates (200-500ms) for less liquid markets

Next Steps

Signal Generation

Add ML-based signals to your market maker

RL Strategies

Train RL agents for optimal market making