Hummingbot Market Making Setup & Strategy Tutorials
Introduction
If you're a developer or algo trader wanting to get your feet wet with liquidity provision, Hummingbot offers a solid open-source framework tailored for market making and arbitrage bots. This article focuses on the market making side — from installing the bot via Docker, to running pure market making strategies, all the way to more advanced Avellaneda-Stoikov variants and inventory risk management.
I've personally wired up Hummingbot on both testnet and mainnet, so I'll walk you through the practical setup stages, illustrate key parameter choices, and share common pitfalls. Along the way, I'll also briefly contrast Hummingbot with Freqtrade to help you choose your toolset. Let's jump right in.
Prerequisites & Installation: Hummingbot Docker Install Tutorial
Running Hummingbot inside Docker containers simplifies environment management and upgrades. Here's a step-by-step to get you started on Ubuntu (similar on macOS/Windows with Docker Desktop).
What you need:
- Docker installed (20.10+ recommended)
- At least 8GB RAM
- Basic command-line familiarity
Install steps:
## Pull the latest Hummingbot image from Docker Hub
docker pull hummingbot/hummingbot:latest
## Create a directory for Hummingbot configs and logs
mkdir -p ~/hummingbot_files
## Run the container with volume mount for persistence
docker run -it --rm \
-v ~/hummingbot_files:/hummingbot_files \
hummingbot/hummingbot:latest
This drops you into the Hummingbot CLI inside Docker. From here, you can initialize configurations, connect exchange APIs, and start strategies. Working inside Docker shields your host system from Python dependency hell or version conflicts I've hit before.
Setting Up Hummingbot for Market Making
Once inside the bot CLI, the first step is setting up your exchange and wallet credentials:
? Select your exchange: Binance
? Enter API key: [your_key]
? Enter API secret: [your_secret]
Security note: Avoid using mainnet keys with full withdrawal permissions during testing. Use sub-accounts or read-only keys when possible.
Next, create a new strategy:
create
? Enter strategy name: my_market_maker
? Select strategy: pure_market_making
? Trading pair (e.g. ETH-USDT): ETH-USDT
The pure_market_making strategy is the simplest Hummingbot market making approach, focused on placing buy and sell orders near the mid-market price.
Pure Market Making Strategy Deep Dive
This strategy repeatedly places orders on both sides of the order book at fixed spreads. Here’s an example config snippet:
| Parameter |
Description |
Example |
order_amount |
Size of each buy/sell order |
0.01 ETH |
bid_spread |
Percentage below mid-price for buy orders |
0.2% |
ask_spread |
Percentage above mid-price for sell orders |
0.2% |
order_refresh_time |
Frequency to refresh orders, in seconds |
30 |
This setup keeps your orders tight around the midpoint, capturing small spreads as market moves. It’s a great starter strategy — simple, low logic complexity, but works fine in high liquidity pairs.
You start it with:
start
Watch as the bot populates bids and asks. Beware of sudden volatile moves wiping your inventory — lack of smart inventory management is a known gap here.
Avellaneda-Stoikov Strategy Guide
For those wanting to go beyond fixed spreads, the Avellaneda-Stoikov (AS) model adapts spreads dynamically based on inventory and volatility.
Why use Avellaneda-Stoikov?
- It attempts to optimize quotes to minimize inventory risk while still earning spreads.
- It models expected price moves and balances your bid/ask volume accordingly.
Hummingbot supports this strategy, configurable with these core parameters:
| Parameter |
Purpose |
Example |
kappa |
Risk aversion coefficient |
1.5 |
volatility |
Estimated mid-price volatility (annualized) |
0.03 (3%) |
inventory_risk_aversion |
Scales penalty for holding inventory |
1.0 |
Here’s a minimal example to launch the AS bot:
create
? Select strategy: avellaneda_stoikov
? Trading pair: ETH-USDT
## Then fill in or update parameters interactively or via config file
Internally, the bot uses the AS formula to calculate dynamic bid and ask spread distances and adjust order sizes in response to your current holdings.
In my experience, tuning volatility and risk aversion parameters is critical — start conservatively, then monitor your PnL and inventory skew.
Managing Inventory Risk in Hummingbot
Inventory risk is a market maker’s constant headache. Hummingbot provides utilities beyond AS to help manage this:
- Inventory skew adjustment: Adjusts order sizes to offset accumulated inventory bias.
- Order refresh configuration: Controls how often orders get canceled/replaced, reducing stale orders in fast markets.
- Position limits: Manual caps on how much you hold per asset.
To illustrate, here's how you might configure inventory skew in a pure market making strategy:
inventory_skew_enabled: true
inventory_target_base_pct: 50 # target 50% of portfolio in base asset
inventory_range_pct: 20 # +/- 20% range allowed
skew_fraction_limit: 0.5 # max order size adjustment factor
This setup aims to keep your holdings balanced between base and quote currency, reducing exposure to adverse market moves. You can tweak these based on your risk appetite.
Heads up: Keep an eye on how your orders behave in sudden price dips or rallies; aggressive skew limits can cause liquidity gaps.
Brief Look: Hummingbot Arbitrage Strategy Tutorial
While the core focus here is market making, Hummingbot also supports arbitrage strategies such as two-market arbitrage and cross-exchange setups.
Quick summary:
- Two-market arbitrage: Monitors price differences for the same asset pair on two exchanges, placing offsetting buy/sell orders to capture spreads.
- Cross-exchange arbitrage: Handles asset and quote transfer delays, swaps, and fees.
You can initialize arbitrage strategies in the CLI with:
create
? Select strategy: arbitrage
But be warned: arbitragebots require tight latency management and significant setup around transfer times and balances. It’s a more advanced step after you nail market making basics.
Freqtrade vs Hummingbot Comparison
Often developers choose between Hummingbot and Freqtrade when building algo trading systems. Here's a quick factual comparison relevant to market making and arbitrage:
| Feature |
Hummingbot |
Freqtrade |
| Language |
Python |
Python |
| Primary Use |
Market making, arbitrage |
Spot/derivatives algorithmic trading |
| Market Making Support |
Native pure market making strategy + AS model |
Possible but mostly manual implementation |
| Exchange Support |
Major CEX + limited DEXs |
Broad CEX support + custom connectors |
| Strategy Complexity |
Focus on liquidity provision logic |
Flexible — supports ML/data-driven strategies |
| License |
MIT |
MIT |
| Community Maturity |
Growing open-source, active docs |
More mature in algo trading niche |
In my experience, Hummingbot shines for market making with built-in constructs to manage order books and inventory out-of-the-box, whereas Freqtrade excels if you want custom data-driven trading signals and ML integration (see freqai-ml-integrations for examples).
Conclusion & Next Steps
Setting up Hummingbot for market making is straightforward once you have Docker installed and exchange credentials ready. Starting with the pure market making strategy helps you understand order placement mechanics, while the Avellaneda-Stoikov model introduces adaptive spread management for better risk control.
Don’t underestimate inventory risk — experiment with skew controls and keep logs for PnL analysis. And if you want to explore arbitrage, plan for more infrastructure around transfers and latency.
For additional tooling and complementary tutorials, consider browsing through related docs such as trading-bot-frameworks-comparison or trading-bot-troubleshooting.
Keep iterating. Algo trading at scale is a marathon, not a sprint.
This marks a good starting point for developers building autonomous on-chain agents or integrating agent payment protocols that need live market data and liquidity infrastructure. I’ve shared my firsthand tips — now it’s your turn to hack and build something killer.