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
Theconnect command allows you to add and manage connections to cryptocurrency exchanges. It securely stores your API credentials and validates the connection before saving.
Basic Usage
View Connections
- All available exchanges
- Whether API keys have been added
- Whether the connection is confirmed (validated)
Connect to Exchange
Name of the exchange to connect (e.g.,
binance, kucoin, coinbase_pro)- Prompt for required API credentials
- Validate the credentials by testing the connection
- Save the credentials securely if validation succeeds
Connection Workflow
Replacing Existing Connections
If you already have credentials saved for an exchange:Yes or Y to update the credentials, or No to keep existing ones.
Exchange-Specific Notes
Kraken
Gateway Connectors (DEX)
For decentralized exchanges that use Gateway:connect for a Gateway connector:
API Credential Requirements
Different exchanges require different credentials:Standard (API Key + Secret)
- Binance
- KuCoin
- OKX
- Bybit
Additional Parameters
Some exchanges require extra credentials: Coinbase Pro- API Key
- Secret Key
- Passphrase
- API Key
- Secret Key
- Passphrase
- API Key
- Secret Key
Security Features
Encrypted Storage
All API credentials are:- Encrypted using your Hummingbot password
- Stored in the
conf/connectors/directory - Hidden during input (for secret keys and passphrases)
Password Protection
Your credentials are encrypted with the password you set when first launching Hummingbot. This password is required to:- Decrypt credentials on startup
- Access any secure configuration values
Connection Validation
Before saving credentials, Hummingbot:- Tests the API connection
- Verifies permissions
- Checks if the keys are valid
Implementation Details
The connect command is implemented in/hummingbot/client/command/connect_command.py:22 and provides:
- Async validation with configurable timeout (default 30s)
- Secure credential prompting (passwords hidden)
- Automatic reconnection during validation
- Gateway connector detection to route to appropriate command
- Connector config file management
Supported Exchanges
Centralized exchanges (CEX) that support theconnect command:
- Binance
- Binance US
- Coinbase Pro / Advanced Trade
- KuCoin
- Kraken
- OKX
- Bybit
- Gate.io
- AscendEX
- Bitfinex
- Bittrex
- And many more…
Common Use Cases
Initial Setup
Connect to your primary exchange:Multi-Exchange Arbitrage
Connect to multiple exchanges:Updating Credentials
Rotate API keys for security:Troubleshooting
Connection Failed
If connection validation fails:-
Verify API credentials
- Double-check API key and secret
- Ensure no extra spaces when copying
-
Check API permissions
- Most strategies need: Read, Trade
- Some exchanges require: Read, Trade, Withdraw (for balance checks)
-
IP Restrictions
- Remove IP whitelist restrictions during initial setup
- Or add your server’s IP to the whitelist
-
Exchange-specific issues
- Kraken: Check Nonce Window setting
- Some exchanges: Verify account is fully verified
Timeout Errors
If connection times out:- Check internet connection
- Verify exchange is online (check status page)
- Increase timeout:
Invalid API Key Format
Some exchanges have specific API key formats:- Ensure you’re using the correct exchange name
- Some exchanges have multiple versions (e.g.,
binancevsbinance_us) - Copy keys without line breaks or spaces
API Key Best Practices
Enable Read + Trade Only
Disable withdrawal permissions unless absolutely necessary
Rotate Regularly
Change API keys every few months for security
Use IP Restrictions
After initial setup, restrict API access to your server’s IP
Separate Keys per Bot
Create different API keys for different bots or strategies