Table of Contents
- Introduction
- Installation
- Hummingbot Commands
- Initial Configuration
- Connecting Exchanges
- Cross Exchange Market Making
- Spot-Perpetual Arbitrage
- Monitoring
- Troubleshooting
- Official Resources
Introduction
What is Hummingbot?
Hummingbot is an open-source algorithmic trading platform that allows you to create and execute automated trading strategies across multiple cryptocurrency exchanges.
Main Architecture:
- CLI (Command Line Interface)
- Cython-based system for high performance
- Connectors for 30+ exchanges
- v1 strategies (traditional) and v2 (modular)
What is Cython?
Cython = Python + C Performance
Cython is an extension which gives Python a C-like performance. Hummingbot uses Cython for performance-critical components:
-
Clock System (
clock.pyx
) - Ultra-precise timing for trading operations - Order Books - Lightning-fast order book processing
- Event System - Instant event propagation for market data
- Strategy Base - High-speed execution of trading logic
This gives Hummingbot near C-language speed for critical operations while maintaining Python's flexibility. Essential for arbitrage where milliseconds matter in capturing market opportunities.
Available Arbitrage Strategies
- Cross Exchange Market Making - Makes market on one exchange using prices from another
- Spot Perpetual Arbitrage - Exploits differences between spot and perpetual markets
- AMM Arbitrage - Arbitrage with Automated Market Makers
Installation
Docker (Recommended)
# Clone repository
git clone https://github.com/hummingbot/hummingbot.git
cd hummingbot
# Start with Docker Compose
docker compose up -d
# Connect to container
docker attach hummingbot
Source
git clone https://github.com/hummingbot/hummingbot.git
cd hummingbot
pip install -e .
python bin/hummingbot.py
Using Conda/Miniconda:
git clone https://github.com/hummingbot/hummingbot.git
cd hummingbot
conda activate hummingbot
./install
./compile
./start
Hummingbot Commands
The available commands in Hummingbot are:
Essential Commands
-
help
- Shows general help or specific command help -
connect [exchange]
- Connects to an exchange -
create
- Creates new strategy -
import [config]
- Imports existing configuration -
start [strategy]
- Starts strategy -
stop
- Stops active strategy -
status
- Shows current status -
balance
- Shows exchange balances -
history
- Shows trade history -
config [parameter]
- Configures parameters -
export
- Exports data to CSV -
exit
- Exit Hummingbot
Information Commands
-
ticker [exchange] [pair]
- Shows current prices -
order_book [exchange] [pair]
- Shows order book -
rate
- Shows rate oracle conversion rates
Advanced Commands
-
gateway [subcommand]
- Gateway commands (DEX) -
mqtt [subcommand]
- MQTT commands for automation
Initial Configuration
1. First Access
When starting Hummingbot for the first time:
# Set password for encryption
Enter your new password: ********
Please reconfirm your password: ********
2. Global Configuration
# View current configurations
config
# Configure important parameters
config kill_switch_mode
>>> kill_switch_enabled
config kill_switch_rate
>>> -5.0 # Stop if losing 5%
config rate_oracle_source
>>> binance
3. View Initial Status
status
# Shows current configurations and connections
Connecting Exchanges
Binance
connect binance
# Follow prompts for:
# - API Key
# - Secret Key
# - For testnet, provide testnet keys
OKX
connect okx
# Follow prompts for:
# - API Key
# - Secret Key
# - Passphrase
# - Environment (live/sandbox)
Hyperliquid
connect hyperliquid
# Follow prompts for:
# - Private Key
# - Vault Address (optional)
Verify Connections
balance
# Shows balances from all connected exchanges
status
# Shows connection status
Cross Exchange Market Making
1. Create Strategy
create
# Follow prompts:
What is your market making strategy?
>>> cross_exchange_market_making
Import previous configs or create a new config file?
>>> create
Enter a configuration name for your strategy:
>>> my_xemm_strategy
2. Strategy Configuration
During creation, configure:
- Maker Market: Exchange where you'll place limit orders
- Taker Market: Exchange for market orders
- Trading Pairs: Pairs to trade (e.g., BTC-USDT)
- Min Profitability: Minimum profitability (e.g., 0.003 = 0.3%)
- Order Amount: Order size
- Conversion Rate: rate_oracle recommended
3. Execute
start my_xemm_strategy
# Monitor with:
status
history
4. Stop
stop
Spot-Perpetual Arbitrage
1. Create Strategy
create
What is your market making strategy?
>>> spot_perpetual_arbitrage
Import previous configs or create a new config file?
>>> create
Enter a configuration name for your strategy:
>>> spot_perp_arb
2. Configuration
During creation:
- Spot Connector: Spot exchange (e.g., binance)
- Derivative Connector: Perpetual exchange (e.g., hyperliquid_perpetual)
- Trading Pairs: Corresponding pairs
- Min Divergence: Minimum difference for trading
- Order Amount: Order size
- Max Inventory: Maximum exposure allowed
3. Execute and Monitor
start spot_perp_arb
# Monitor:
status
balance
history
Monitoring
Monitoring Commands
# General status
status
# Balances
balance
# Trade history
history
# Current prices
ticker binance BTC-USDT
# Order book
order_book binance BTC-USDT
Export Data
# Export history to CSV
export
# Follow prompts to choose period and format
Runtime Configuration
# Adjust parameters without stopping strategy
config min_profitability
>>> 0.004
config order_amount
>>> 0.005
Troubleshooting
Connection Issues
# Check connection status
status
# Reconnect exchange
connect binance
# Check balances
balance
Strategy Issues
# View current configuration
config
# Stop strategy
stop
# Reconfigure if necessary
config [parameter]
>>> new_value
# Restart
start [strategy_name]
Debug
# Increase log verbosity
config log_level
>>> DEBUG
# View detailed configurations
help config
Important Configurations
Kill Switch
config kill_switch_mode
>>> kill_switch_enabled
config kill_switch_rate
>>> -5.0 # Stop with 5% loss
Rate Oracle
config rate_oracle_source
>>> binance # or coingecko, kucoin, etc.
Logging
config log_level
>>> INFO # or DEBUG for more details
Configuration Files
Configurations are stored in conf/
:
-
conf_client.yml
- Global configurations -
conf_[strategy_name]_strategy.yml
- Strategy configurations -
conf_fee_overrides.yml
- Fee overrides
MQTT (Advanced Automation)
# Start MQTT bridge
mqtt start
# Stop MQTT bridge
mqtt stop
# MQTT status
mqtt status
Gateway (for DEX)
# Check Gateway status
gateway status
# Connect to Gateway
gateway connect
# List available connectors
gateway list
Official Resources
Documentation
Community
Scripts and Tools
Limitations and Warnings
Risks
- Automated trading involves significant risks
- Always test on testnet first
- Monitor positions regularly
- Use kill switch for protection
Support
- For bugs: GitHub Issues
- For questions: Discord
- For documentation: Official website
Guide based on actual Hummingbot v2.7.0+ source code
Top comments (0)