Skip to main content

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.

Gateway configuration involves setting up secure communication, managing wallet connections, and configuring blockchain network settings.

Development vs Production Modes

Gateway can operate in two distinct modes with different security characteristics:

Development Mode (Default)

Development mode is not secure for production use. Only use it for local testing and development.
Development mode characteristics:
  • Protocol: HTTP (unencrypted)
  • Default Port: 15888
  • Authentication: None
  • Certificates: Not required
  • Use Cases: Local testing, development, learning
Configuration:
# Start Gateway in development mode (default)
DEV=true docker-compose up -d

Production Mode

Production mode provides encrypted HTTPS communication and certificate-based authentication.
Production mode characteristics:
  • Protocol: HTTPS (encrypted)
  • Default Port: 15888
  • Authentication: Mutual TLS (client certificates)
  • Certificates: Required (CA cert, client cert, client key)
  • Use Cases: Production trading, remote access, any deployment with real funds
Configuration:
1

Generate Certificates

From the Hummingbot CLI, generate SSL certificates:
gateway generate-certs
This creates three files in the certs/ directory:
  • ca_cert.pem - Certificate Authority certificate
  • client_cert.pem - Client certificate for authentication
  • client_key.pem - Private key for the client certificate
2

Enable Production Mode

Set the DEV environment variable to false:
# Stop containers
docker-compose down

# Start in production mode
DEV=false docker-compose up -d
3

Verify HTTPS

Confirm Gateway is using HTTPS:
# In Hummingbot CLI
gateway status
The output should show an HTTPS URL (https://localhost:15888).
Certificates are automatically loaded from the certs/ directory. Hummingbot will use these certificates to establish secure communication with Gateway.

Security Best Practices

Always Use HTTPS in Production

Never run Gateway in development mode (HTTP) with real funds or on untrusted networks.

Protect Your Certificates

Keep certificate files secure. Anyone with access to your certificates can communicate with Gateway.

Use Firewall Rules

Restrict access to port 15888 using firewall rules if running on a remote server.

Regular Certificate Rotation

Regenerate certificates periodically for enhanced security.

Wallet Configuration

Gateway requires wallet private keys to sign and submit blockchain transactions.

Adding a Wallet

To add a wallet to Gateway:
1

Access Gateway Connect Command

In the Hummingbot CLI:
gateway connect ethereum
Replace ethereum with your target chain.
2

Enter Private Key

You’ll be prompted to enter your wallet’s private key:
Enter your ethereum private key >>>
Your private key is stored locally in encrypted format. Never share your private key or expose it in logs.
3

Verify Connection

Check your wallet connection:
gateway connector-status

Multiple Wallets

You can configure different wallets for different chains:
# Add Ethereum wallet
gateway connect ethereum

# Add Polygon wallet (can be the same private key)
gateway connect polygon

# Add Solana wallet (different key format)
gateway connect solana
You can use the same private key (wallet address) across EVM-compatible chains like Ethereum, Polygon, BSC, and Avalanche.

Wallet Security

Wallet private keys are stored in Gateway’s configuration:
  • Location: conf/connectors/ directory
  • Format: Encrypted JSON files
  • Encryption: Uses the same password as your Hummingbot configuration
Backup your conf/ directory regularly. Loss of this directory means loss of access to your configured wallets within Gateway.

Network Configuration

Gateway connects to blockchain networks via RPC endpoints. You can configure custom RPC endpoints for better performance or privacy.

Using Default RPC Endpoints

Gateway comes with default public RPC endpoints for common chains. These work out of the box but may have rate limits.

Configuring Custom RPC Endpoints

For production use, configure your own RPC endpoints:
# Edit conf/ethereum.yml
networks:
  mainnet:
    nodeURL: 'https://your-ethereum-node-url'
    chainID: 1

RPC Provider Recommendations

Alchemy provides reliable RPC endpoints with generous free tiers.
  • Free tier: 300M compute units/month
  • Supported chains: Ethereum, Polygon, Arbitrum, Optimism
  • Dashboard: alchemy.com
nodeURL: 'https://eth-mainnet.g.alchemy.com/v2/YOUR-API-KEY'

Gas Configuration

Configure gas settings for optimal transaction execution:

Gas Price Strategy

Gateway supports multiple gas price strategies:
# conf/ethereum.yml
gas:
  # Strategy: 'fast', 'medium', 'slow', or 'custom'
  strategy: 'fast'
  
  # Custom gas price (in Gwei) - only used if strategy is 'custom'
  customGasPrice: 50
  
  # Gas limit multiplier (1.0 = 100% of estimated gas)
  gasLimitMultiplier: 1.2
Strategy options:
  • fast - Higher gas price for faster confirmation (1-2 blocks)
  • medium - Standard gas price (2-5 blocks)
  • slow - Lower gas price for cost savings (5+ blocks)
  • custom - Specify exact gas price in Gwei

EIP-1559 Support

For chains supporting EIP-1559 (like Ethereum post-London fork):
gas:
  eip1559:
    enabled: true
    maxPriorityFeePerGas: 2  # in Gwei
    maxFeePerGas: 100         # in Gwei

Connector-Specific Configuration

Each DEX connector may have additional configuration options:

Uniswap Configuration

# conf/uniswap.yml
uniswap:
  router:
    version: 'v3'  # 'v2' or 'v3'
  
  # Slippage tolerance (percentage)
  slippageTolerance: 1.0
  
  # Transaction deadline (seconds from now)
  ttl: 300

SushiSwap Configuration

# conf/sushiswap.yml
sushiswap:
  # Slippage tolerance (percentage)
  slippageTolerance: 2.0
  
  # Transaction deadline (seconds from now)
  ttl: 600

Environment Variables

Key environment variables for Gateway configuration:
VariableDescriptionDefault
DEVEnable development mode (HTTP)true
GATEWAY_HOSTGateway host addresslocalhost
GATEWAY_PORTGateway port15888
CERT_PATHPath to certificates directory/home/gateway/certs
CONFIG_PATHPath to configuration directory/home/gateway/conf

Configuration Files

Gateway configuration is stored in YAML files:
conf/
├── ssl.yml                  # SSL/TLS configuration
├── server.yml               # Server settings
├── ethereum.yml             # Ethereum network config
├── polygon.yml              # Polygon network config
├── binance-smart-chain.yml  # BSC network config
├── avalanche.yml            # Avalanche network config
└── connectors/
    ├── uniswap.yml          # Uniswap connector config
    ├── sushiswap.yml        # SushiSwap connector config
    └── pancakeswap.yml      # PancakeSwap connector config
After modifying configuration files, restart Gateway for changes to take effect:
docker-compose restart gateway

Testing Configuration

Verify your Gateway configuration:
1

Check Gateway Status

gateway status
2

Test Chain Connection

gateway test-connection ethereum
3

Verify Wallet Balance

balance
Check that your wallet balances are displayed correctly.
4

Test Token Approval (Optional)

gateway approve-token ethereum uniswap WETH

Troubleshooting

Symptom: SSL/TLS connection errorsSolution:
  1. Regenerate certificates: gateway generate-certs
  2. Verify certificate files exist in certs/ directory
  3. Ensure Gateway is running in production mode: DEV=false
  4. Restart Gateway after regenerating certificates
Symptom: “Unable to connect to network” errorsSolution:
  1. Verify RPC endpoint URL is correct
  2. Check that RPC provider is online and accessible
  3. Ensure API key (if required) is valid
  4. Test RPC endpoint manually:
    curl -X POST -H "Content-Type: application/json" \
      --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
      YOUR_RPC_URL
    
Symptom: Gateway cannot find configured walletSolution:
  1. Reconnect wallet: gateway connect <chain>
  2. Verify wallet configuration exists in conf/connectors/
  3. Check that encryption password matches Hummingbot password
Symptom: Transactions fail or revertSolution:
  1. Increase gas limit multiplier in configuration
  2. Adjust slippage tolerance for the connector
  3. Ensure sufficient native token balance for gas fees
  4. Check Gateway logs for detailed error messages

Next Steps

Supported Chains

View all available blockchains and DEX protocols

AMM DEX Connectors

Learn about trading on AMM DEXs

CLI Commands

Gateway-related CLI commands reference

Security

Security best practices for Hummingbot