Skip to main content
AMM DEX connectors enable interaction with Automated Market Maker protocols through the Hummingbot Gateway middleware. These connectors provide access to decentralized liquidity pools, DEX aggregators, and concentrated liquidity protocols across multiple blockchain networks.

How AMM DEX Connectors Work

AMM DEX connectors operate through the Gateway middleware, which provides standardized interfaces to different DeFi protocols:

Gateway Middleware

TypeScript-based API layer that translates Hummingbot commands to protocol-specific calls

Liquidity Pools

Trade against algorithmic liquidity pools instead of order books

Multi-Chain Support

Connect to AMMs across Ethereum, Polygon, Avalanche, Solana, and more

Smart Routing

DEX aggregators automatically find optimal swap paths across multiple pools

AMM Sub-Types

Smart routing protocols that find optimal trade paths:How they work:
  • Split trades across multiple DEXs and pools
  • Optimize for best price execution
  • Minimize slippage and price impact
  • Compare routes in real-time
Examples: 0x Protocol, Jupiter, Uniswap Auto RouterBest for: Large trades, best price execution, multi-pool arbitrage

Installing Gateway

Gateway is required for all AMM DEX connectors:
1

Install Gateway during setup

When setting up Hummingbot, answer y when prompted:
make setup
# Answer 'y' when prompted:
Include Gateway? [y/N] y
2

Configure Gateway certificates

For production use with HTTPS:
# In Hummingbot
gateway generate-certs
Gateway runs in development mode (HTTP) by default. Use DEV=false for production HTTPS mode.
3

Connect wallet to Gateway

Configure your wallet for the desired blockchain:
gateway connect [chain]
Enter your private key when prompted.
4

Test Gateway connection

Verify Gateway is running:
gateway status
Gateway requires your wallet private key to sign transactions. Use a dedicated trading wallet, never your primary holdings wallet.

Router (DEX Aggregator) Connectors

DEX aggregators find optimal swap routes across multiple AMMs:
Connector ID: 0xProfessional-grade DEX aggregator across EVM chains.Features:
  • Aggregates 100+ DEXs on supported chains
  • Smart order routing (SOR)
  • RFQ (Request for Quote) from market makers
  • Multi-chain support (Ethereum, Polygon, BSC, Arbitrum, etc.)
Networks: Ethereum, Polygon, BSC, Arbitrum, Optimism, AvalancheExchange Documentation
Connector ID: jupiterLeading DEX aggregator on Solana.Features:
  • Aggregates all major Solana DEXs
  • Advanced routing algorithms
  • Extremely low fees
  • High-speed execution
  • Limit orders via Jupiter
Network: SolanaExchange Documentation
Connector ID: uniswap (auto-routing mode)Uniswap’s smart order router.Features:
  • Routes across V2 and V3 pools
  • Multi-hop optimization
  • Gas-optimized routing
  • Best price execution
Networks: Ethereum, Polygon, Arbitrum, Optimism, BaseExchange Documentation

AMM (Constant Product) Connectors

Traditional AMMs using constant product (x*y=k) formula:

Balancer

Connector ID: balancerMulti-token pools with customizable weights.Networks: Ethereum, Polygon, ArbitrumDocs

Curve

Connector ID: curveStablecoin-optimized AMM with low slippage.Networks: Ethereum, Polygon, Arbitrum, OptimismDocs

PancakeSwap

Connector ID: pancakeswapLeading AMM on BNB Chain.Networks: BSC, EthereumDocs

QuickSwap

Connector ID: quickswapPolygon’s primary AMM.Networks: Polygon, Polygon zkEVMDocs

Raydium

Connector ID: raydium (AMM mode)Solana’s leading AMM and liquidity provider.Network: SolanaDocs

SushiSwap

Connector ID: sushiswapMulti-chain AMM fork of Uniswap V2.Networks: Ethereum, Polygon, Arbitrum, AvalancheDocs

Trader Joe

Connector ID: traderjoeAvalanche’s native AMM.Network: AvalancheDocs

Uniswap V2

Connector ID: uniswap (V2 mode)Original constant product AMM.Networks: Ethereum and forksDocs

CLMM (Concentrated Liquidity) Connectors

Advanced AMMs with custom price range liquidity:
Connector ID: meteoraDynamic liquidity pools on Solana.Features:
  • Dynamic fee tiers
  • Concentrated liquidity
  • Multi-token pools
  • High capital efficiency
Network: SolanaExchange Documentation
Connector ID: raydium (CLMM mode)Concentrated liquidity on Solana.Features:
  • Custom price ranges
  • Multiple fee tiers
  • Integrated with Raydium AMM
  • High yields for LPs
Network: SolanaExchange Documentation
Connector ID: uniswap (V3 mode)Industry-leading concentrated liquidity protocol.Features:
  • Custom price ranges
  • Multiple fee tiers (0.01%, 0.05%, 0.3%, 1%)
  • NFT position tokens
  • Superior capital efficiency
Networks: Ethereum, Polygon, Arbitrum, Optimism, BaseExchange Documentation

Supported Features by Sub-Type

FeatureRouterAMMCLMM
Token swapsYesYesYes
Liquidity provisionNoYesYes
Custom price rangesNoNoYes
Multi-hop routingYesLimitedLimited
Fee tiersN/AFixedMultiple
Price impactMinimizedHigherLower
Gas optimizationYesStandardStandard

Trading on AMM DEXs

Understanding Slippage

AMMs experience price impact from trades:
Slippage Factors
  • Pool liquidity depth
  • Trade size relative to pool
  • Price volatility
  • Network congestion (gas prices)
Larger trades = higher slippage
# Example: Price impact calculation
pool_liquidity = 1000000  # $1M pool
trade_size = 50000  # $50k trade

# Simplified price impact
impact_percentage = (trade_size / pool_liquidity) * 100
print(f"Estimated price impact: {impact_percentage}%")  # ~5%

# Actual impact depends on AMM curve
Minimizing Slippage
  1. Use DEX aggregators for large trades
  2. Split large orders across multiple transactions
  3. Trade during high liquidity periods
  4. Choose pools with deeper liquidity
  5. Use CLMM pools for better execution

Gas Fees on AMM DEXs

Gas costs vary significantly by network:
NetworkTypical Swap CostLiquidity Add/Remove
Ethereum$5-50$20-100
Polygon$0.01-0.10$0.05-0.30
Arbitrum$0.10-1.00$0.50-3.00
Optimism$0.10-1.00$0.50-3.00
BSC$0.10-0.50$0.30-1.50
Avalanche$0.50-2.00$1.00-5.00
Solana$0.0001-0.001$0.001-0.01
Gas costs fluctuate with network congestion. Monitor gas prices before executing large trades.

Liquidity Provision

AMM and CLMM connectors support liquidity provision:
Provide liquidity to constant product pools:Process:
  1. Deposit equal value of both tokens
  2. Receive LP tokens representing your share
  3. Earn fees from all swaps (pro-rata)
  4. Withdraw anytime by burning LP tokens
Risks:
  • Impermanent loss from price divergence
  • Smart contract risk
  • Concentration risk in single pool

Configuration Example

Example Gateway configuration for AMM connector:
connector: uniswap
chain: ethereum
network: mainnet
market: WETH-USDC
amount: 1.0
slippage: 1.0  # 1% max slippage

Multi-Chain Support

AMM connectors support multiple blockchain networks:

Ethereum

Mainnet and testnetsHighest liquidity, highest gas

Polygon

Low-cost EVM sidechainFast and cheap transactions

Arbitrum

Optimistic rollup L2Lower fees, Ethereum security

Optimism

Optimistic rollup L2Growing ecosystem

BSC

Binance Smart ChainLarge user base

Avalanche

High-performance L1Fast finality

Solana

High-speed L1Ultra-low fees

Base

Coinbase L2Growing adoption

Next Steps

Gateway Installation

Install and configure Gateway middleware

CLOB DEX

Explore order book DEX connectors

Liquidity Strategies

Learn liquidity provision strategies

Multi-Chain Trading

Cross-chain arbitrage opportunities

Build docs developers (and LLMs) love