Crypto Bots

Crypto Arbitrage Bots Explained: How to Earn Passive Income in 2025

Crypto arbitrage bots exploit price differences between exchanges to generate profit automatically. Learn how they work, the different types, and how to get started safely.

A
AI Agents Hubยท2025-03-03ยท3 min readยท564 words

Builder of AI agents, crypto trading bots, and open-source automation tools. Sharing practical guides on how to build, deploy, and profit from AI and DeFi technology.

What Is Crypto Arbitrage?

Crypto arbitrage is the practice of simultaneously buying a cryptocurrency on one exchange where it's priced lower and selling it on another where it's priced higher. The difference โ€” minus fees โ€” is your profit.

Sounds simple. But the windows are tiny. We're talking fractions of a second and price gaps as small as 0.1โ€“0.5%. That's where arbitrage bots come in.

How Arbitrage Bots Work

A well-built arbitrage bot:

  1. Monitors dozens of exchanges simultaneously for price discrepancies
  2. Calculates whether the gap is large enough to profit after fees
  3. Executes both legs of the trade in milliseconds
  4. Manages risk by handling slippage, failed transactions, and network delays

Types of Crypto Arbitrage

1. Simple (Spatial) Arbitrage

Buy ETH on Exchange A at $3,000, sell on Exchange B at $3,030. Classic and straightforward.

2. Triangular Arbitrage

Exploit pricing inefficiencies between three trading pairs on the same exchange:

  • Convert BTC โ†’ ETH โ†’ USDT โ†’ BTC
  • If the math works out in your favor, you end up with more BTC than you started

3. Cross-Chain Arbitrage

Same asset, different blockchains. BTC on Ethereum (WBTC) might briefly trade at a premium vs. native BTC.

4. Flash Loan Arbitrage (DeFi)

Borrow millions with no collateral, execute the arbitrage, repay the loan โ€” all in one transaction. No capital required, but requires Solidity knowledge.

5. Statistical Arbitrage

Use machine learning to identify pairs of assets that historically move together but have temporarily diverged. Also called "pairs trading."

Real Numbers: What Returns Are Realistic?

Arbitrage is low risk, low margin. Typical individual trades return 0.1โ€“0.5%. But with automation, you can execute hundreds or thousands of trades per day.

| Strategy | Daily Trades | Avg Profit/Trade | Monthly Return (estimate) | |----------|-------------|-----------------|--------------------------| | CEX-CEX | 100-500 | 0.1โ€“0.3% | 3โ€“10% | | DEX-DEX | 50-200 | 0.3โ€“0.8% | 5โ€“15% | | Flash Loan | 10-50 | 0.5โ€“2.0% | 10โ€“30%* |

*Flash loans require deep technical knowledge and carry smart contract risk.

Getting Started: A Simple Python Arbitrage Bot

import ccxt
import time

exchange_a = ccxt.binance({'apiKey': 'KEY_A', 'secret': 'SECRET_A'})
exchange_b = ccxt.coinbase({'apiKey': 'KEY_B', 'secret': 'SECRET_B'})

def check_arbitrage(symbol='ETH/USDT', min_profit_pct=0.3):
    ticker_a = exchange_a.fetch_ticker(symbol)
    ticker_b = exchange_b.fetch_ticker(symbol)
    
    price_a = ticker_a['ask']  # Buy price on A
    price_b = ticker_b['bid']  # Sell price on B
    
    profit_pct = ((price_b - price_a) / price_a) * 100
    
    if profit_pct > min_profit_pct:
        print(f"OPPORTUNITY: Buy on A @ {price_a}, sell on B @ {price_b}")
        print(f"Estimated profit: {profit_pct:.2f}%")
        # Execute trades here
        return True
    return False

while True:
    check_arbitrage()
    time.sleep(1)

Key Risks to Understand

  • Execution risk โ€” Price can change between signal and execution
  • Fee erosion โ€” Maker/taker fees, gas fees can eliminate profit
  • Liquidity risk โ€” Large orders move the market against you
  • Exchange risk โ€” Withdrawal limits, KYC delays, or exchange downtime
  • Network congestion โ€” On DeFi, gas spikes can kill profits

Tools You Need

  • ccxt โ€” Python library supporting 100+ crypto exchanges
  • web3.py / ethers.js โ€” For DeFi and smart contract interaction
  • Redis โ€” For low-latency data caching
  • A fast VPS โ€” Colocated near exchange servers for speed

Get the Full Bot

Download our open-source arbitrage bot from the Tools page. It supports 12 exchanges out of the box, includes backtesting, and has full documentation.

Related Articles