Overview
Cross Exchange Market Making (XEMM) allows you to make markets on one exchange (maker) while hedging filled orders on another exchange (taker). This strategy profits from price differences between exchanges while maintaining market-neutral exposure.How It Works
- Monitor Price Difference: Continuously calculates profitability between maker and taker exchanges
- Place Maker Orders: Places limit orders on the maker exchange when profitability threshold is met
- Hedge on Taker: When maker order fills, immediately hedges with market order on taker exchange
- Capture Spread: Profits from the price difference minus fees
Unlike pure arbitrage, XEMM places orders on one side and waits for fills, acting as a market maker.
When to Use
Ideal Conditions
- Consistent price spreads between exchanges
- Maker exchange offers fee rebates
- Taker exchange has deep liquidity
- Stable trading pairs (major assets)
Avoid When
- Price spreads are unstable
- High withdrawal fees between exchanges
- Low liquidity on taker exchange
- Gateway/DEX with high gas costs as taker
Core Configuration Parameters
Exchange Setup
Trading pair on maker exchange in BASE-QUOTE formatExample:
ETH-USDTThe taker exchange connector nameExample:
binance, uniswap_ethereumProfitability
Minimum profit percentage required to place orders. Enter
1 for 1%.Example: 0.5 requires 0.5% profit after all costsRange: -100% to 100%Order size in base assetExample:
0.1 for 0.1 ETH per orderOrder Behavior
Adjust maker order price to be one tick above top bid or below top askThis ensures your orders are at the top of the order book.
How to refresh orders on the maker exchangeOptions:
active_order_refresh: Cancel and replace orders continuouslypassive_order_refresh: Let orders expire naturally
Passive Order Refresh Parameters
Profitability threshold to cancel orders in passive mode. Enter
1 for 1%.Example: 2.0 cancels orders when profitability drops below 2%Minimum seconds before orders expire in passive mode
Order Sizing
Percentage of taker exchange volume to use for order sizing. Enter
1 for 1%.Range: 0% to 100%Percentage of taker balance available for hedging. Enter
1 for 1%.Range: 0% to 100%Maximum order size as percentage of total portfolio. Enter
50 for 50%.Range: 0% to 100%Conversion Rates
Method to convert between different assets on maker and taker exchangesOptions:
rate_oracle_conversion_rate: Use Hummingbot’s rate oracle (recommended)fixed_conversion_rate: Specify manual conversion rates
Fixed Conversion Rate Parameters
Conversion rate for base assets (when using fixed mode)Example:
1.25 if 1 DAI = 1.25 USDTConversion rate for quote assets (when using fixed mode)
Risk Management
Additional buffer for taker market orders to ensure fills. Enter
1 for 1%.Example: 2.0 adds 2% slippage buffer to taker ordersRange: 0% to 100%Minimum volume required at top of order bookExample:
1.0 requires 1 base asset at best bid/askMinimum seconds between order adjustmentsPrevents excessive order updates during price fluctuations.
Example Configurations
Basic CEX to CEX
- Makes markets for BTC-USDT
- Hedges on Binance
- Requires 0.3% minimum profit
- Uses rate oracle for conversions
CEX to AMM (Gateway)
- Higher
min_profitabilityto account for gas costs - Larger
slippage_bufferfor AMM slippage - Passive order refresh to reduce gas usage
With Fixed Conversion Rates
Advanced Configuration
Order Refresh Modes
- Active Refresh
- Passive Refresh
- Continuously cancels and replaces orders
- Best for volatile markets
- Higher API usage
- Recommended for CEX-to-CEX
Profitability Calculation
The strategy calculates profitability including all costs:Tips for Success
Monitor Both Exchanges
Monitor Both Exchanges
Ensure sufficient balances on both maker and taker exchanges. The bot needs quote asset on maker and base asset on taker (or vice versa for sell orders).
Account for All Costs
Account for All Costs
Include in your
min_profitability:- Maker and taker exchange fees
- Withdrawal fees (if rebalancing)
- Gas costs (for DEX takers)
- Spread costs on taker
Test with Small Amounts
Test with Small Amounts
Start with minimum order sizes to verify the strategy works as expected before scaling up.
Use Rate Oracle
Use Rate Oracle
For most scenarios,
rate_oracle_conversion_rate is more reliable than fixed rates, especially for volatile pairs.Risk Management
Mitigation:- Set conservative
min_profitability(>= 0.5% for CEX, >= 2% for DEX) - Use adequate
slippage_buffer(2-3% for AMMs) - Monitor and rebalance exchange balances regularly
- Use
order_size_taker_balance_factorto reserve capital
Source Code Reference
Configuration:/source/hummingbot/strategy/cross_exchange_market_making/cross_exchange_market_making_config_map_pydantic.py:198
Strategy Implementation: /source/hummingbot/strategy/cross_exchange_market_making/cross_exchange_market_making.py
Related Strategies
- AMM Arbitrage: Direct arbitrage without market making
- Pure Market Making: Single exchange market making