Skip to main content
This example demonstrates a basic market making strategy that quotes bid/ask orders around the oracle price.

Complete Example

market-maker.ts

Key Concepts

Use PostOnlyParams.MUST_POST_ONLY to ensure you always provide liquidity and earn maker fees.
Monitor position size and adjust quotes or hedge when inventory gets too large.
Update quotes frequently to stay competitive and adjust to market conditions.
Set position limits and stop-losses to manage risk.

Advanced Features

Dynamic Spreads

Inventory Skewing

Production Considerations

  • Error handling: Robust retry logic
  • Monitoring: Track fills, PnL, and position
  • Risk limits: Maximum position size
  • Multiple markets: Diversify across markets
  • Gas optimization: Batch operations
For production market making, see keeper-bots-v2 for reference implementations.

Next Steps

Liquidation Bot

Build a liquidation bot

Advanced Features

Advanced SDK features