Overview
This Python-based Triangular Arbitrage Bot automates profitable cryptocurrency trading by scanning for price discrepancies across multiple exchanges. It leverages the CCXT library to interact with exchanges like Binance, KuCoin, OKX, and Huobi, executing trades to exploit arbitrage opportunities.
Key Features
- Multi-Exchange Support: Trades on Binance, KuCoin, OKX, and Huobi.
- Real-Time Market Scanning: Identifies arbitrage opportunities across USDT-quoted pairs (e.g., BTC/USDT → ETH/BTC → ETH/USDT).
- Fee-Aware Calculations: Accounts for exchange fees and order book impact.
- Telegram Notifications: Alerts users about profitable trades via Telegram.
- Detailed Logging: Records all activities in
arbitrage.log.
How It Works
Market Data Fetching:
- Fetches order book data from supported exchanges using CCXT.
Opportunity Identification:
- Scans for triangular paths (e.g., USDT → BTC → ETH → USDT) with profitable price gaps.
Trade Execution:
- Automatically executes trades if profit exceeds a user-defined threshold.
Profit Tracking:
- Logs trades and sends Telegram alerts with profit percentages and pair details.
👉 Learn more about optimizing arbitrage strategies
Prerequisites
| Dependency | Installation Command |
|-----------------|----------------------|
| Python 3.7+ | python --version |
| CCXT | pip install ccxt |
| Pandas | pip install pandas |
| Python-dotenv | pip install python-dotenv |
Setup & Configuration
Clone the Repository:
git clone https://github.com/guldo111/triangular-arbitrage-bot-multi-exchange.gitInstall Dependencies:
pip install -r requirements.txtConfigure API Keys:
- Rename
config.env.exampletoconfig.env. - Add exchange API keys and Telegram bot tokens.
- Rename
Usage
Run the Bot:
python tri_arb_bot.pyMonitor Trades:
- The bot logs opportunities and executes trades automatically.
- Telegram notifications detail profitable trades.
👉 Explore advanced trading configurations
FAQ
Q1: Is triangular arbitrage risk-free?
A: No. Market volatility, latency, and exchange fees can impact profitability.
Q2: Which exchanges work best?
A: High-liquidity exchanges (e.g., Binance, OKX) reduce slippage and improve success rates.
Q3: How much USDT is needed to start?
A: Start with at least 100 USDT to account for minimum trade sizes and fees.
Disclaimer
- Educational Use Only: Test thoroughly in sandbox environments before live trading.
- Market Risks: Arbitrage profitability depends on real-time market conditions.
- MIT Licensed: Attribute the original work if modifying/sharing the code.
Contributing & Support
Submit issues or pull requests via GitHub. For questions, reach out to the repository maintainers.