Skip to main content

Multi-exchange cryptocurrency arbitrage detection tool using CCXT

Project description

Arbitbot - Multi-Exchange Crypto Arbitrage Detector

A powerful tool to detect cryptocurrency arbitrage opportunities across multiple exchanges in real-time using CCXT.

Features

Real-time Arbitrage Detection

  • Monitors 14+ cryptocurrencies across 9 major exchanges
  • Complete pairing mode: generates all A→B combinations for maximum opportunity coverage
  • Real data only - no simulations or mock data

🚀 Multi-Exchange Support

  • Binance, Bybit, OKX, KuCoin, Huobi, Gate, Kraken, Coinbase, Bitfinex
  • Concurrent price fetching with built-in rate limiting
  • Automatic exchange connection management

📊 Advanced Features

  • Configurable profit threshold (0.01% - 5.0%)
  • Customizable taker fees per exchange
  • Real-time result display with top 10 opportunities
  • Concurrent processing for fast detection

🔔 Telegram Notifications

  • Push notifications for profitable arbitrage opportunities
  • HTML-formatted messages with detailed profit information
  • Configurable alerts

Installation

From PyPI

pip install arbitbot

From Source

git clone https://github.com/Hung-Ching-Lee/Arbitbot.git
cd Arbitbot
pip install -e .

Quick Start

1. Interactive Jupyter Notebook (Recommended)

jupyter notebook Arbitbot_Interactive.ipynb

Then:

  1. Select exchanges to monitor (multi-select)
  2. Choose cryptocurrencies (multi-select)
  3. Set minimum profit threshold
  4. Configure Telegram (optional)
  5. Click "🚀 Start Detection"

2. Python Script

from arbitbot import ArbitrageDetector, send_telegram_notification

# Initialize detector
detector = ArbitrageDetector()

# Set fees for exchanges
detector.fees = {
    'binance': 0.001,
    'bybit': 0.0007,
    'okx': 0.0008,
}

# Initialize exchanges
exchanges = ['binance', 'bybit', 'okx']
detector.initialize_exchanges(exchanges)

# Define cryptocurrency to monitor
crypto = {'symbol': 'BTC/USDT', 'name': 'Bitcoin'}

# Get prices from all exchanges
price_data = detector.get_crypto_all_prices(crypto, exchanges)

# Find arbitrage opportunities
opportunities = detector.find_all_arbitrage_pairs(price_data)

# Filter by profit threshold
profitable = [op for op in opportunities if op['profit_percent'] >= 0.5]

# Print results
for op in profitable:
    print(f"Buy {op['symbol']} at {op['buy_exchange']} for \${op['buy_price']:.6f}")
    print(f"Sell at {op['sell_exchange']} for \${op['sell_price']:.6f}")
    print(f"Profit: {op['profit_percent']:.4f}%\n")

# Send Telegram notification
if profitable:
    best = max(profitable, key=lambda x: x['profit_percent'])
    msg = f"Arbitrage: Buy {best['buy_exchange']} @ \${best['buy_price']:.6f}, Sell {best['sell_exchange']} @ \${best['sell_price']:.6f}, Profit: {best['profit_percent']:.4f}%"
    send_telegram_notification(TOKEN, CHAT_ID, msg)

Telegram Configuration

Get Bot Token

  1. Message @BotFather on Telegram
  2. Send /newbot and follow instructions
  3. Copy the token provided

Get Chat ID

  1. Message @userinfobot
  2. Reply will contain your Chat ID
  3. Send any message to your bot to activate it

Supported Cryptocurrencies

BTC, ETH, XRP, DOGE, SOL, ADA, DOT, LTC, BCH, LINK, VET, TRX, MATIC, AVAX

Supported Exchanges

Binance, Bybit, OKX, KuCoin, Huobi, Gate, Kraken, Coinbase, Bitfinex

API Reference

ArbitrageDetector

detector = ArbitrageDetector()
detector.initialize_exchanges(['binance', 'bybit'])
detector.fees = {'binance': 0.001, 'bybit': 0.0007}
price_data = detector.get_crypto_all_prices(crypto, exchanges)
opportunities = detector.find_all_arbitrage_pairs(price_data)

Telegram Notifications

from arbitbot import send_telegram_notification
send_telegram_notification(token, chat_id, message)

Requirements

  • Python ≥ 3.8
  • ccxt ≥ 1.80.0
  • requests ≥ 2.28.0
  • pandas ≥ 1.5.0

License

MIT License

Disclaimer

⚠️ Cryptocurrency trading involves substantial risk. This tool is for educational purposes only. Always test with small amounts before actual trading.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arbitbot-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arbitbot-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file arbitbot-0.1.0.tar.gz.

File metadata

  • Download URL: arbitbot-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for arbitbot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8c73a02b2b2abec90109a6aa22bca10c5ca3ab0badd239c2f61c52626aab668d
MD5 513cc51cf1ae4804e297a43a0dd605f9
BLAKE2b-256 d18b9edfe3496aefbd15a79847c95caa91dfe2b691280ec7ef962fb59baa3cb2

See more details on using hashes here.

File details

Details for the file arbitbot-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: arbitbot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for arbitbot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d33dbd443a08455ba5ef9de48f4dd69d13b873befd7a6ae20669f0612fba9bc
MD5 f9e418756ff25e472a9686fe536b3d1a
BLAKE2b-256 c1d229bcdfd578e8fb20cd33f147c2a58bd8328e1df811d205490f14a28d695f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page