Complete Example
market-maker.ts
Key Concepts
Post-only orders
Post-only orders
Use
PostOnlyParams.MUST_POST_ONLY to ensure you always provide liquidity and earn maker fees.Inventory management
Inventory management
Monitor position size and adjust quotes or hedge when inventory gets too large.
Quote updates
Quote updates
Update quotes frequently to stay competitive and adjust to market conditions.
Risk management
Risk management
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