← Back to Blog
STRATEGY

Multi-Pair Spread Bot: Liquidity Mining Across LMEX Markets

May 20, 2026 · 7 min read · LMEX.AI

A single-pair market-making bot is risky. The pair you chose might go through extended quiet periods, decoupling moves, or regime changes that hurt your specific strategy. A multi-pair version of the same idea spreads exposure across uncorrelated markets and produces dramatically smoother returns — at the cost of meaningfully more complexity.


This article walks through what a multi-pair spread bot actually is, the architecture for running one on LMEX, and the operational issues that matter in practice.


The idea


A spread bot — also called a market maker or liquidity provider — sits in the order book quoting both sides of the market. Buy at the bid, sell at the ask, capture the spread. On LMEX, you also earn maker rebates on each fill, which is meaningful at scale.


A single-pair version has limits. BTC-PERP might quote a 0.01% spread that gets crossed every few seconds during active hours. ETH-PERP might be similar but with different microstructure. SOL-PERP might pay better but have more dangerous flash-move risk.


Running 5-15 pairs simultaneously means you have something working at any given moment. Some pairs are quiet; others are active. Some pairs widen; others tighten. The portfolio is less dependent on any single market.


The reward: 8-25% annual return on deployed capital with relatively low directional exposure, scaled across hundreds of fills per day.


The basic architecture


A working multi-pair spread bot has three components running concurrently:


Quoting layer. For each pair, maintains a buy quote at bid + offset and a sell quote at ask − offset. Cancels and replaces quotes when the market moves. Targets a specific number of basis points of edge per fill.


**Inventory management layer.** Tracks net position across all pairs. When inventory gets too long, skew quotes to favour selling (move quotes down). When too short, favour buying. The goal is to stay flat over time while collecting spread.


**Risk management layer.** Cancels all quotes if account drawdown exceeds a threshold, or if volatility spikes beyond expected ranges, or if any single position grows beyond per-pair limits. The kill switch is non-negotiable.


The interplay between these three is what makes spread botting hard. Pure quoting without inventory management leads to one-sided fills and directional risk. Inventory management without risk limits leads to disasters during regime changes. Risk management without quoting earns nothing.


A minimal implementation


A skeleton for the quoting layer:


import ccxt
import asyncio

exchange = ccxt.lmex({'apiKey': '...', 'secret': '...'})

PAIRS = ['BTC-PERP', 'ETH-PERP', 'SOL-PERP', 'BNB-PERP', 'AVAX-PERP']
QUOTE_SIZE_USD = 1000  # per side per pair
EDGE_BPS = 5  # 0.05% edge per fill

async def quote_pair(symbol):
    while True:
        try:
            ticker = exchange.fetch_ticker(symbol)
            mid = (ticker['bid'] + ticker['ask']) / 2
            edge = mid * EDGE_BPS / 10000
            
            buy_price = mid - edge
            sell_price = mid + edge
            qty = QUOTE_SIZE_USD / mid
            
            # Cancel existing quotes
            exchange.cancel_all_orders(symbol)
            
            # Place new quotes
            exchange.create_order(symbol, 'limit', 'buy', qty, buy_price, {'postOnly': True})
            exchange.create_order(symbol, 'limit', 'sell', qty, sell_price, {'postOnly': True})
            
            await asyncio.sleep(2)
        except Exception as e:
            print(f"Error on {symbol}: {e}")
            await asyncio.sleep(5)

async def main():
    await asyncio.gather(*[quote_pair(s) for s in PAIRS])

asyncio.run(main())

This is the absolute bones. Production code needs:

  • Inventory tracking and quote skewing
  • Position size limits per pair
  • WebSocket order book subscription (not REST polling)
  • Order state tracking (which order IDs are live)
  • Reconnection and error recovery
  • Cancel-all kill switch on volatility events

  • The skeleton is 30 lines. The production version is 1500 lines. That gap is where bots quietly fail.


    What goes wrong


    Multi-pair spread botting has predictable failure modes:


    **Inventory accumulation in trending markets.** A pair trends down. Your buy quotes get filled repeatedly; your sell quotes don't. You accumulate a long position into the trend, which then continues against you. By the time the trend reverses, drawdown is significant.


    The fix: aggressive quote skewing based on inventory. If you're already long the pair by 2× quote size, dramatically reduce the buy quote and tighten the sell quote. If still trending against you, stop quoting that pair entirely.


    **Correlated fills across pairs.** Crypto markets correlate heavily during stress events. A market crash hits all pairs simultaneously. Your inventory across BTC, ETH, SOL, and BNB all goes long at the same time. What looked like a diversified portfolio is actually 5 expressions of "long crypto."


    The fix: cap total portfolio exposure regardless of individual pair limits. If aggregate long exposure exceeds threshold, stop accepting any more long fills across all pairs.


    **Exchange API rate limiting.** Quoting 15 pairs with frequent cancel-and-replace requires hundreds of API calls per minute. LMEX has generous limits but they're not unlimited. Hitting the limit means your quotes stop refreshing, leaving stale orders that get adversely selected.


    The fix: use WebSocket order placement where possible, batch order operations, and prioritise active pairs over quiet ones.


    **Volatility spikes that move past your stops.** A flash crash moves the market 5% in seconds. Your buy quotes at the previous mid get filled instantly at terrible prices. Risk management triggered too late.


    The fix: monitor short-term volatility in real time. When 1-minute realised volatility spikes above 3× trailing average, cancel all quotes immediately and pause until conditions normalise.


    Sizing and economics


    The economics matter. A spread bot earning 5 basis points per fill, doing 200 fills per day per pair, on \$1,000 quotes:

  • Per pair daily revenue: 200 × \$1,000 × 0.0005 = \$100
  • Across 10 pairs: \$1,000 per day gross
  • After 20% adverse selection (toxic flow): \$800 per day
  • After maker rebate income: +\$200 per day
  • Net: ~\$1,000 per day on \$10,000 deployed (\$1,000 × 10 pairs)

  • That's roughly 10% per day on quote size... which would be unbelievable... except the quote size is much less than the actual margin requirement. Real margin needed for 10 pairs with proper position limits is more like \$50,000-100,000. So real annual return is 100-200% in the best case, 30-50% in normal markets, and 10-20% after accounting for drawdowns during bad periods.


    These numbers are sensitive to fee tier, latency, and market conditions. Anyone quoting specific returns without seeing your specific setup is guessing.


    Frequently Asked Questions


    Q: What's the minimum capital to start?

    \$25,000-50,000 for meaningful returns. Below this, fees and minimum order sizes eat too much. Some strategies work at smaller sizes but the economics get harder.


    Q: Should I use leverage?

    Moderate leverage (2-3x) is reasonable since the strategy is meant to be market-neutral. Higher leverage amplifies inventory risk during regime changes. Start at 1× and only increase after months of stable performance.


    Q: How many pairs should I quote?

    Start with 3-5 pairs you understand well. Expanding to 10-15 makes sense after the basic infrastructure is solid. Beyond 15 pairs, marginal benefit diminishes and operational complexity increases sharply.


    Q: Is this fully automatable, or do I need to monitor it?

    Mostly automatable, but never set-and-forget. Daily review of inventory positions, weekly review of which pairs are paying, monthly review of strategy parameters. And alerts for unusual conditions that require immediate attention.


    Related Articles


    → Order Book Imbalance Strategies on LMEX: A Python Implementation Guide
    → Funding Rate Arbitrage: Earn Yield with Zero Market Risk on LMEX
    → Portfolio Risk Management for Algorithmic Traders on LMEX
    ← All ArticlesBuild a Bot →