Documentation Index
Fetch the complete documentation index at: https://mintlify.com/hummingbot/hummingbot/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Pure Market Making is the most fundamental market making strategy in Hummingbot. It places limit buy and sell orders on a single exchange to provide liquidity and earn spreads.How It Works
The strategy continuously places bid and ask orders around the mid-price:- Calculates the mid-price from the order book
- Places a buy order below the mid-price (bid_spread)
- Places a sell order above the mid-price (ask_spread)
- Refreshes orders periodically based on configuration
- Captures the spread when both sides fill
When to Use
Best For
- Stable markets with consistent volume
- Exchanges with rebates for makers
- Trading pairs with tight spreads
- Accumulating inventory over time
Avoid When
- Markets are highly volatile
- Low liquidity pairs with wide spreads
- Exchange has high maker fees
- Dealing with low-float tokens
Core Configuration Parameters
Required Parameters
The spot exchange connector to use (e.g.,
binance, coinbase_pro)Trading pair in BASE-QUOTE format (e.g.,
BTC-USDT)Distance from mid-price to place bid orders. Enter
1 for 1%.Example: 0.5 places bids 0.5% below mid-priceDistance from mid-price to place ask orders. Enter
1 for 1%.Example: 0.5 places asks 0.5% above mid-priceAmount of base asset per orderExample:
0.1 for 0.1 BTC per orderFrequency in seconds to cancel and replace ordersDefault: No default, must be specified
Order Management
Number of orders to place on each sideExample:
3 places 3 buy and 3 sell ordersPercentage increment for subsequent order levels. Required if
order_levels > 1.Example: With bid_spread=0.5 and order_level_spread=0.3, orders are placed at 0.5%, 0.8%, 1.1%Amount to increase/decrease per level. Use negative values to decrease.Example:
0.05 increases each level by 0.05 base assetPercent price change required to refresh orders. Prevents excessive order cancellations.Range: -10% to 10%
Inventory Management
Adjust order sizes based on inventory imbalance
Target base asset percentage when inventory skew is enabled. Enter
50 for 50%.Example: 60 targets 60% base asset, 40% quote assetTolerance range around inventory target as a multiple of order size
Price Sources
Price reference for order placementOptions:
current_market: Use current exchange mid-priceexternal_market: Use another exchange’s pricecustom_api: Use custom API endpoint
Type of price to use as referenceOptions:
mid_price: Average of best bid and asklast_price: Last traded pricelast_own_trade_price: Your last trade pricebest_bid: Top bid pricebest_ask: Top ask priceinventory_cost: Your inventory cost basis
External exchange for price reference (when
price_source=external_market)Trading pair on external exchange
Advanced Features
Keep orders active when one side fills
Spread percentage at which hanging orders are cancelled. Enter
1 for 1%.Jump to top of order book (best bid/ask jumping)
Alternate between buy and sell orders after fills
Price above which only sell orders are placed. Use
-1 to disable.Price below which only buy orders are placed. Use
-1 to disable.Automatically add exchange fees to order prices
Example Configuration
Basic Setup
- Trades ETH-USDT on Binance
- Places orders 0.1% away from mid-price
- Uses 0.05 ETH per order
- Refreshes orders every 30 seconds
Multi-Level Orders
- Level 1: 0.05% spread, 0.01 BTC
- Level 2: 0.10% spread, 0.015 BTC
- Level 3: 0.15% spread, 0.02 BTC
- Level 4: 0.20% spread, 0.025 BTC
- Level 5: 0.25% spread, 0.03 BTC
With Inventory Management
Tips for Success
Start with Conservative Spreads
Start with Conservative Spreads
Begin with spreads of 0.3-0.5% to ensure fills while learning the strategy. Gradually tighten spreads as you gain experience.
Monitor Inventory Balance
Monitor Inventory Balance
Enable inventory skew to prevent accumulating too much of one asset. This is especially important in trending markets.
Use Order Refresh Tolerance
Use Order Refresh Tolerance
Set
order_refresh_tolerance_pct to 0.1-0.2% to reduce order cancellations during minor price fluctuations, saving on fees.Consider Multi-Level Orders
Consider Multi-Level Orders
Using 3-5 order levels provides better capital efficiency and catches both small and large price movements.
Risk Management
Mitigation Strategies:- Set
price_ceilingandprice_floorto limit exposure - Use
filled_order_delayto pause after fills during volatile periods - Enable
add_transaction_coststo ensure profitable spreads - Start with small
order_amountvalues
Source Code Reference
Configuration:/source/hummingbot/strategy/pure_market_making/pure_market_making_config_map.py:120
Strategy Implementation: /source/hummingbot/strategy/pure_market_making/
Related Strategies
- Avellaneda Market Making: Advanced market making with dynamic spreads
- Perpetual Market Making: Market making on derivatives